[Lldb-commits] [lldb] r156969 - in /lldb/branches/lldb-platform-work: ./ examples/python/ include/lldb/API/ scripts/ scripts/Python/interface/ source/API/ source/Expression/ source/Interpreter/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/Process/gdb-remote/ source/Plugins/SymbolFile/DWARF/ source/Symbol/ source/Target/ test/ test/functionalities/abbreviation/ test/functionalities/alias/ tools/driver/
Johnny Chen
johnny.chen at apple.com
Wed May 16 17:31:04 PDT 2012
Author: johnny
Date: Wed May 16 19:31:04 2012
New Revision: 156969
URL: http://llvm.org/viewvc/llvm-project?rev=156969&view=rev
Log:
Merge changes from ToT trunk.
Modified:
lldb/branches/lldb-platform-work/ (props changed)
lldb/branches/lldb-platform-work/examples/python/crashlog.py
lldb/branches/lldb-platform-work/include/lldb/API/SBBreakpointLocation.h
lldb/branches/lldb-platform-work/llvm.zip
lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpointLocation.i
lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl
lldb/branches/lldb-platform-work/scripts/llvm.fix-target-amalgamated.diff
lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp
lldb/branches/lldb-platform-work/source/Expression/ASTResultSynthesizer.cpp
lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp
lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp
lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp
lldb/branches/lldb-platform-work/source/Target/Process.cpp
lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py
lldb/branches/lldb-platform-work/test/functionalities/alias/TestAliases.py
lldb/branches/lldb-platform-work/test/lldbtest.py
lldb/branches/lldb-platform-work/test/redo.py
lldb/branches/lldb-platform-work/tools/driver/Driver.cpp
Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 16 19:31:04 2012
@@ -1 +1 @@
-/lldb/trunk:154223-156888
+/lldb/trunk:154223-156961
Modified: lldb/branches/lldb-platform-work/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/python/crashlog.py?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/python/crashlog.py (original)
+++ lldb/branches/lldb-platform-work/examples/python/crashlog.py Wed May 16 19:31:04 2012
@@ -421,7 +421,8 @@
print image
if matches_found == 0:
for (image_idx, image) in enumerate(crash_log.images):
- if string.find(image.get_resolved_path(), image_path) >= 0:
+ resolved_image_path = image.get_resolved_path()
+ if resolved_image_path and string.find(image.get_resolved_path(), image_path) >= 0:
print image
else:
for crash_log in self.crash_logs:
Modified: lldb/branches/lldb-platform-work/include/lldb/API/SBBreakpointLocation.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/API/SBBreakpointLocation.h?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/API/SBBreakpointLocation.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/API/SBBreakpointLocation.h Wed May 16 19:31:04 2012
@@ -28,6 +28,9 @@
const lldb::SBBreakpointLocation &
operator = (const lldb::SBBreakpointLocation &rhs);
+ break_id_t
+ GetID ();
+
bool
IsValid() const;
Modified: lldb/branches/lldb-platform-work/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/llvm.zip?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
Binary files - no diff available.
Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpointLocation.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpointLocation.i?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpointLocation.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBBreakpointLocation.i Wed May 16 19:31:04 2012
@@ -29,6 +29,9 @@
~SBBreakpointLocation ();
+ break_id_t
+ GetID ();
+
bool
IsValid() const;
Modified: lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl (original)
+++ lldb/branches/lldb-platform-work/scripts/disasm-gdb-remote.pl Wed May 16 19:31:04 2012
@@ -1749,6 +1749,7 @@
my $key = '';
my $value = '';
+ my $comment = '';
if ($_[0] =~ /[0-9a-fA-F]/ && $_[1] =~ /[0-9a-fA-F]/)
{
my $reg_num = get8(\@_);
@@ -1780,7 +1781,26 @@
if (length($char) == 0 or $char eq ';' or $char eq '#') { last; }
$value .= $char;
}
- printf("\t%*s = %s\n", $max_register_name_len, $key, $value);
+ if ($key eq 'metype')
+ {
+ our %metype_to_name = (
+ '1' => ' (EXC_BAD_ACCESS)',
+ '2' => ' (EXC_BAD_INSTRUCTION)',
+ '3' => ' (EXC_ARITHMETIC)',
+ '4' => ' (EXC_EMULATION)',
+ '5' => ' (EXC_SOFTWARE)',
+ '6' => ' (EXC_BREAKPOINT)',
+ '7' => ' (EXC_SYSCALL)',
+ '8' => ' (EXC_MACH_SYSCALL)',
+ '9' => ' (EXC_RPC_ALERT)',
+ '10' => ' (EXC_CRASH)'
+ );
+ if (exists $metype_to_name{$value})
+ {
+ $comment = $metype_to_name{$value};
+ }
+ }
+ printf("\t%*s = %s$comment\n", $max_register_name_len, $key, $value);
}
}
@@ -1791,13 +1811,56 @@
sub dump_stop_reply_packet
{
my $what = shift(@_);
- if ($what eq 'S')
- {
- print 'signal ( 0x' . shift(@_) . shift(@_) . " )\n";
- }
- elsif ($what eq 'T')
+ if ($what eq 'S' or $what eq 'T')
{
- print 'signal ( 0x' . shift(@_) . shift(@_) . " )\n";
+ my $signo = get8(\@_);
+
+ our %signo_to_name = (
+ '1' => ' SIGHUP',
+ '2' => ' SIGINT',
+ '3' => ' SIGQUIT',
+ '4' => ' SIGILL',
+ '5' => ' SIGTRAP',
+ '6' => ' SIGABRT',
+ '7' => ' SIGPOLL/SIGEMT',
+ '8' => ' SIGFPE',
+ '9' => ' SIGKILL',
+ '10' => ' SIGBUS',
+ '11' => ' SIGSEGV',
+ '12' => ' SIGSYS',
+ '13' => ' SIGPIPE',
+ '14' => ' SIGALRM',
+ '15' => ' SIGTERM',
+ '16' => ' SIGURG',
+ '17' => ' SIGSTOP',
+ '18' => ' SIGTSTP',
+ '19' => ' SIGCONT',
+ '20' => ' SIGCHLD',
+ '21' => ' SIGTTIN',
+ '22' => ' SIGTTOU',
+ '23' => ' SIGIO',
+ '24' => ' SIGXCPU',
+ '25' => ' SIGXFSZ',
+ '26' => ' SIGVTALRM',
+ '27' => ' SIGPROF',
+ '28' => ' SIGWINCH',
+ '29' => ' SIGINFO',
+ '30' => ' SIGUSR1',
+ '31' => ' SIGUSR2',
+ '145' => ' TARGET_EXC_BAD_ACCESS', # 0x91
+ '146' => ' TARGET_EXC_BAD_INSTRUCTION', # 0x92
+ '147' => ' TARGET_EXC_ARITHMETIC', # 0x93
+ '148' => ' TARGET_EXC_EMULATION', # 0x94
+ '149' => ' TARGET_EXC_SOFTWARE', # 0x95
+ '150' => ' TARGET_EXC_BREAKPOINT' # 0x96
+ );
+ my $signo_str = sprintf("%i", $signo);
+ my $signo_name = '';
+ if (exists $signo_to_name{$signo_str})
+ {
+ $signo_name = $signo_to_name{$signo_str};
+ }
+ printf ("signal (signo=%u$signo_name)\n", $signo);
dump_stop_reply_data (@_);
}
elsif ($what eq 'W')
Modified: lldb/branches/lldb-platform-work/scripts/llvm.fix-target-amalgamated.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/llvm.fix-target-amalgamated.diff?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/llvm.fix-target-amalgamated.diff (original)
+++ lldb/branches/lldb-platform-work/scripts/llvm.fix-target-amalgamated.diff Wed May 16 19:31:04 2012
@@ -41,6 +41,25 @@
[]>;
// Vector Move Operations.
+Index: lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
+===================================================================
+--- lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp (revision 152265)
++++ lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp (working copy)
+@@ -212,12 +212,12 @@
+ } else {
+ assert(Op.isExpr() && "unknown operand kind in printOperand");
+ // If a symbolic branch target was added as a constant expression then print
+- // that address in hex.
++ // that address in hex. And only print 32 unsigned bits for the address.
+ const MCConstantExpr *BranchTarget = dyn_cast<MCConstantExpr>(Op.getExpr());
+ int64_t Address;
+ if (BranchTarget && BranchTarget->EvaluateAsAbsolute(Address)) {
+ O << "0x";
+- O.write_hex(Address);
++ O.write_hex((uint32_t)Address);
+ }
+ else {
+ // Otherwise, just print the expression.
Index: lib/Target/ARM/ARMInstrThumb2.td
===================================================================
--- lib/Target/ARM/ARMInstrThumb2.td (revision 152265)
@@ -53,41 +72,6 @@
}
let isNotDuplicable = 1, isIndirectBranch = 1 in {
-Index: lib/Target/ARM/ARMInstrThumb.td
-===================================================================
---- lib/Target/ARM/ARMInstrThumb.td (revision 152265)
-+++ lib/Target/ARM/ARMInstrThumb.td (working copy)
-@@ -413,11 +413,11 @@
- "bl${p}\t$func",
- [(ARMtcall tglobaladdr:$func)]>,
- Requires<[IsThumb, IsNotIOS]> {
-- bits<22> func;
-- let Inst{26} = func{21};
-+ bits<24> func;
-+ let Inst{26} = func{23};
- let Inst{25-16} = func{20-11};
-- let Inst{13} = 1;
-- let Inst{11} = 1;
-+ let Inst{13} = func{22};
-+ let Inst{11} = func{21};
- let Inst{10-0} = func{10-0};
- }
-
-@@ -427,10 +427,11 @@
- "blx${p}\t$func",
- [(ARMcall tglobaladdr:$func)]>,
- Requires<[IsThumb, HasV5T, IsNotIOS]> {
-- bits<21> func;
-+ bits<24> func;
-+ let Inst{26} = func{23};
- let Inst{25-16} = func{20-11};
-- let Inst{13} = 1;
-- let Inst{11} = 1;
-+ let Inst{13} = func{22};
-+ let Inst{11} = func{21};
- let Inst{10-1} = func{10-1};
- let Inst{0} = 0; // func{0} is assumed zero
- }
Index: lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp (revision 152265)
@@ -189,6 +173,41 @@
}
case ARM::fixup_arm_thumb_cp:
// Offset by 4, and don't encode the low two bits. Two bytes of that
+Index: lib/Target/ARM/ARMInstrThumb.td
+===================================================================
+--- lib/Target/ARM/ARMInstrThumb.td (revision 152265)
++++ lib/Target/ARM/ARMInstrThumb.td (working copy)
+@@ -413,11 +413,11 @@
+ "bl${p}\t$func",
+ [(ARMtcall tglobaladdr:$func)]>,
+ Requires<[IsThumb, IsNotIOS]> {
+- bits<22> func;
+- let Inst{26} = func{21};
++ bits<24> func;
++ let Inst{26} = func{23};
+ let Inst{25-16} = func{20-11};
+- let Inst{13} = 1;
+- let Inst{11} = 1;
++ let Inst{13} = func{22};
++ let Inst{11} = func{21};
+ let Inst{10-0} = func{10-0};
+ }
+
+@@ -427,10 +427,11 @@
+ "blx${p}\t$func",
+ [(ARMcall tglobaladdr:$func)]>,
+ Requires<[IsThumb, HasV5T, IsNotIOS]> {
+- bits<21> func;
++ bits<24> func;
++ let Inst{26} = func{23};
+ let Inst{25-16} = func{20-11};
+- let Inst{13} = 1;
+- let Inst{11} = 1;
++ let Inst{13} = func{22};
++ let Inst{11} = func{21};
+ let Inst{10-1} = func{10-1};
+ let Inst{0} = 0; // func{0} is assumed zero
+ }
Index: lib/Target/ARM/Disassembler/ARMDisassembler.cpp
===================================================================
--- lib/Target/ARM/Disassembler/ARMDisassembler.cpp (revision 152265)
Modified: lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBBreakpointLocation.cpp Wed May 16 19:31:04 2012
@@ -281,6 +281,18 @@
return true;
}
+break_id_t
+SBBreakpointLocation::GetID ()
+{
+ if (m_opaque_sp)
+ {
+ Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetID ();
+ }
+ else
+ return LLDB_INVALID_BREAK_ID;
+}
+
SBBreakpoint
SBBreakpointLocation::GetBreakpoint ()
{
Modified: lldb/branches/lldb-platform-work/source/Expression/ASTResultSynthesizer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/ASTResultSynthesizer.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ASTResultSynthesizer.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ASTResultSynthesizer.cpp Wed May 16 19:31:04 2012
@@ -260,6 +260,21 @@
// No auxiliary variable necessary; expression returns void
return true;
+ // In C++11, last_expr can be a LValueToRvalue implicit cast. Strip that off if that's the
+ // case.
+
+ do {
+ ImplicitCastExpr *implicit_cast = dyn_cast<ImplicitCastExpr>(last_expr);
+
+ if (!implicit_cast)
+ break;
+
+ if (!implicit_cast->getCastKind() == CK_LValueToRValue)
+ break;
+
+ last_expr = implicit_cast->getSubExpr();
+ } while (0);
+
// is_lvalue is used to record whether the expression returns an assignable Lvalue or an
// Rvalue. This is relevant because they are handled differently.
//
@@ -354,7 +369,7 @@
ExprResult address_of_expr = m_sema->CreateBuiltinUnaryOp(SourceLocation(), UO_AddrOf, last_expr);
- m_sema->AddInitializerToDecl(result_decl, address_of_expr.take(), true, true);
+ m_sema->AddInitializerToDecl(result_decl, address_of_expr.take(), true, false);
}
else
{
@@ -373,7 +388,7 @@
if (!result_decl)
return false;
- m_sema->AddInitializerToDecl(result_decl, last_expr, true, true);
+ m_sema->AddInitializerToDecl(result_decl, last_expr, true, false);
}
DC->addDecl(result_decl);
Modified: lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp Wed May 16 19:31:04 2012
@@ -215,12 +215,14 @@
break;
case lldb::eLanguageTypeC_plus_plus:
m_compiler->getLangOpts().CPlusPlus = true;
+ m_compiler->getLangOpts().CPlusPlus0x = true;
break;
case lldb::eLanguageTypeObjC_plus_plus:
default:
m_compiler->getLangOpts().ObjC1 = true;
m_compiler->getLangOpts().ObjC2 = true;
m_compiler->getLangOpts().CPlusPlus = true;
+ m_compiler->getLangOpts().CPlusPlus0x = true;
break;
}
Modified: lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp Wed May 16 19:31:04 2012
@@ -1326,6 +1326,7 @@
StreamString revised_command_line;
size_t actual_cmd_name_len = 0;
std::string next_word;
+ StringList matches;
while (!done)
{
char quote_char = '\0';
@@ -1346,7 +1347,7 @@
}
else
{
- cmd_obj = GetCommandObject (next_word.c_str());
+ cmd_obj = GetCommandObject (next_word.c_str(), &matches);
if (cmd_obj)
{
actual_cmd_name_len += next_word.length();
@@ -1392,7 +1393,26 @@
if (cmd_obj == NULL)
{
- result.AppendErrorWithFormat ("'%s' is not a valid command.\n", next_word.c_str());
+ uint32_t num_matches = matches.GetSize();
+ if (matches.GetSize() > 1) {
+ std::string error_msg;
+ error_msg.assign ("Ambiguous command '");
+ error_msg.append(next_word.c_str());
+ error_msg.append ("'.");
+
+ error_msg.append (" Possible matches:");
+
+ for (uint32_t i = 0; i < num_matches; ++i) {
+ error_msg.append ("\n\t");
+ error_msg.append (matches.GetStringAtIndex(i));
+ }
+ error_msg.append ("\n");
+ result.AppendRawError (error_msg.c_str(), error_msg.size());
+ } else {
+ // We didn't have only one match, otherwise we wouldn't get here.
+ assert(num_matches == 0);
+ result.AppendErrorWithFormat ("'%s' is not a valid command.\n", next_word.c_str());
+ }
result.SetStatus (eReturnStatusFailed);
return false;
}
Modified: lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Wed May 16 19:31:04 2012
@@ -289,7 +289,7 @@
module_spec.GetUUID() = image_info.uuid;
ModuleSP module_sp (target_images.FindFirstModule (module_spec));
- if (module_sp)
+ if (module_sp && !module_spec.GetUUID().IsValid() && !module_sp->GetUUID().IsValid())
{
// No UUID, we must rely upon the cached module modification
// time and the modification time of the file on disk
@@ -301,22 +301,19 @@
{
if (can_create)
{
- if (!module_sp)
+ module_sp = m_process->GetTarget().GetSharedModule (module_spec);
+ if (!module_sp || module_sp->GetObjectFile() == NULL)
{
- module_sp = m_process->GetTarget().GetSharedModule (module_spec);
- if (!module_sp || module_sp->GetObjectFile() == NULL)
- {
- const bool add_image_to_target = true;
- const bool load_image_sections_in_target = false;
- module_sp = m_process->ReadModuleFromMemory (image_info.file_spec,
- image_info.address,
- add_image_to_target,
- load_image_sections_in_target);
- }
-
- if (did_create_ptr)
- *did_create_ptr = module_sp;
+ const bool add_image_to_target = true;
+ const bool load_image_sections_in_target = false;
+ module_sp = m_process->ReadModuleFromMemory (image_info.file_spec,
+ image_info.address,
+ add_image_to_target,
+ load_image_sections_in_target);
}
+
+ if (did_create_ptr)
+ *did_create_ptr = module_sp;
}
}
return module_sp;
Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Wed May 16 19:31:04 2012
@@ -2497,6 +2497,12 @@
StringExtractorGDBRemote response;
StateType stop_state = process->GetGDBRemote().SendContinuePacketAndWaitForResponse (process, continue_cstr, continue_cstr_len, response);
+ // We need to immediately clear the thread ID list so we are sure to get a valid list of threads.
+ // The thread ID list might be contained within the "response", or the stop reply packet that
+ // caused the stop. So clear it now before we give the stop reply packet to the process
+ // using the process->SetLastStopPacket()...
+ process->ClearThreadIDList ();
+
switch (stop_state)
{
case eStateStopped:
Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed May 16 19:31:04 2012
@@ -2290,86 +2290,94 @@
DWARFDebugInfo* debug_info = DebugInfo();
if (debug_info)
{
- dw_offset_t cu_offset = debug_info->GetCompileUnitAranges().FindAddress(file_vm_addr);
+ const dw_offset_t cu_offset = debug_info->GetCompileUnitAranges().FindAddress(file_vm_addr);
if (cu_offset != DW_INVALID_OFFSET)
{
- uint32_t cu_idx;
+ uint32_t cu_idx = DW_INVALID_INDEX;
DWARFCompileUnit* dwarf_cu = debug_info->GetCompileUnit(cu_offset, &cu_idx).get();
if (dwarf_cu)
{
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
- assert(sc.comp_unit != NULL);
- resolved |= eSymbolContextCompUnit;
-
- if (resolve_scope & eSymbolContextLineEntry)
+ if (sc.comp_unit)
{
- LineTable *line_table = sc.comp_unit->GetLineTable();
- if (line_table != NULL)
+ resolved |= eSymbolContextCompUnit;
+
+ if (resolve_scope & eSymbolContextLineEntry)
{
- if (so_addr.IsLinkedAddress())
+ LineTable *line_table = sc.comp_unit->GetLineTable();
+ if (line_table != NULL)
{
- Address linked_addr (so_addr);
- linked_addr.ResolveLinkedAddress();
- if (line_table->FindLineEntryByAddress (linked_addr, sc.line_entry))
+ if (so_addr.IsLinkedAddress())
+ {
+ Address linked_addr (so_addr);
+ linked_addr.ResolveLinkedAddress();
+ if (line_table->FindLineEntryByAddress (linked_addr, sc.line_entry))
+ {
+ resolved |= eSymbolContextLineEntry;
+ }
+ }
+ else if (line_table->FindLineEntryByAddress (so_addr, sc.line_entry))
{
resolved |= eSymbolContextLineEntry;
}
}
- else if (line_table->FindLineEntryByAddress (so_addr, sc.line_entry))
- {
- resolved |= eSymbolContextLineEntry;
- }
- }
- }
-
- if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock))
- {
- DWARFDebugInfoEntry *function_die = NULL;
- DWARFDebugInfoEntry *block_die = NULL;
- if (resolve_scope & eSymbolContextBlock)
- {
- dwarf_cu->LookupAddress(file_vm_addr, &function_die, &block_die);
- }
- else
- {
- dwarf_cu->LookupAddress(file_vm_addr, &function_die, NULL);
}
- if (function_die != NULL)
+ if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock))
{
- sc.function = sc.comp_unit->FindFunctionByUID (MakeUserID(function_die->GetOffset())).get();
- if (sc.function == NULL)
- sc.function = ParseCompileUnitFunction(sc, dwarf_cu, function_die);
- }
- else
- {
- // We might have had a compile unit that had discontiguous
- // address ranges where the gaps are symbols that don't have
- // any debug info. Discontiguous compile unit address ranges
- // should only happen when there aren't other functions from
- // other compile units in these gaps. This helps keep the size
- // of the aranges down.
- sc.comp_unit = NULL;
- resolved &= ~eSymbolContextCompUnit;
- }
+ DWARFDebugInfoEntry *function_die = NULL;
+ DWARFDebugInfoEntry *block_die = NULL;
+ if (resolve_scope & eSymbolContextBlock)
+ {
+ dwarf_cu->LookupAddress(file_vm_addr, &function_die, &block_die);
+ }
+ else
+ {
+ dwarf_cu->LookupAddress(file_vm_addr, &function_die, NULL);
+ }
- if (sc.function != NULL)
- {
- resolved |= eSymbolContextFunction;
+ if (function_die != NULL)
+ {
+ sc.function = sc.comp_unit->FindFunctionByUID (MakeUserID(function_die->GetOffset())).get();
+ if (sc.function == NULL)
+ sc.function = ParseCompileUnitFunction(sc, dwarf_cu, function_die);
+ }
+ else
+ {
+ // We might have had a compile unit that had discontiguous
+ // address ranges where the gaps are symbols that don't have
+ // any debug info. Discontiguous compile unit address ranges
+ // should only happen when there aren't other functions from
+ // other compile units in these gaps. This helps keep the size
+ // of the aranges down.
+ sc.comp_unit = NULL;
+ resolved &= ~eSymbolContextCompUnit;
+ }
- if (resolve_scope & eSymbolContextBlock)
+ if (sc.function != NULL)
{
- Block& block = sc.function->GetBlock (true);
+ resolved |= eSymbolContextFunction;
- if (block_die != NULL)
- sc.block = block.FindBlockByID (MakeUserID(block_die->GetOffset()));
- else
- sc.block = block.FindBlockByID (MakeUserID(function_die->GetOffset()));
- if (sc.block)
- resolved |= eSymbolContextBlock;
+ if (resolve_scope & eSymbolContextBlock)
+ {
+ Block& block = sc.function->GetBlock (true);
+
+ if (block_die != NULL)
+ sc.block = block.FindBlockByID (MakeUserID(block_die->GetOffset()));
+ else
+ sc.block = block.FindBlockByID (MakeUserID(function_die->GetOffset()));
+ if (sc.block)
+ resolved |= eSymbolContextBlock;
+ }
}
}
}
+ else
+ {
+ GetObjectFile()->GetModule()->ReportWarning ("0x%8.8x: compile unit %u failed to create a valid lldb_private::CompileUnit class.",
+ cu_offset,
+ cu_idx);
+ }
}
}
}
@@ -2399,72 +2407,79 @@
{
SymbolContext sc (m_obj_file->GetModule());
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
- assert(sc.comp_unit != NULL);
-
- uint32_t file_idx = UINT32_MAX;
-
- // If we are looking for inline functions only and we don't
- // find it in the support files, we are done.
- if (check_inlines)
+ if (sc.comp_unit)
{
- file_idx = sc.comp_unit->GetSupportFiles().FindFileIndex (1, file_spec, true);
- if (file_idx == UINT32_MAX)
- continue;
- }
+ uint32_t file_idx = UINT32_MAX;
- if (line != 0)
- {
- LineTable *line_table = sc.comp_unit->GetLineTable();
+ // If we are looking for inline functions only and we don't
+ // find it in the support files, we are done.
+ if (check_inlines)
+ {
+ file_idx = sc.comp_unit->GetSupportFiles().FindFileIndex (1, file_spec, true);
+ if (file_idx == UINT32_MAX)
+ continue;
+ }
- if (line_table != NULL && line != 0)
+ if (line != 0)
{
- // We will have already looked up the file index if
- // we are searching for inline entries.
- if (!check_inlines)
- file_idx = sc.comp_unit->GetSupportFiles().FindFileIndex (1, file_spec, true);
+ LineTable *line_table = sc.comp_unit->GetLineTable();
- if (file_idx != UINT32_MAX)
+ if (line_table != NULL && line != 0)
{
- uint32_t found_line;
- uint32_t line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_idx, line, false, &sc.line_entry);
- found_line = sc.line_entry.line;
+ // We will have already looked up the file index if
+ // we are searching for inline entries.
+ if (!check_inlines)
+ file_idx = sc.comp_unit->GetSupportFiles().FindFileIndex (1, file_spec, true);
- while (line_idx != UINT32_MAX)
+ if (file_idx != UINT32_MAX)
{
- sc.function = NULL;
- sc.block = NULL;
- if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock))
+ uint32_t found_line;
+ uint32_t line_idx = line_table->FindLineEntryIndexByFileIndex (0, file_idx, line, false, &sc.line_entry);
+ found_line = sc.line_entry.line;
+
+ while (line_idx != UINT32_MAX)
{
- const lldb::addr_t file_vm_addr = sc.line_entry.range.GetBaseAddress().GetFileAddress();
- if (file_vm_addr != LLDB_INVALID_ADDRESS)
+ sc.function = NULL;
+ sc.block = NULL;
+ if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock))
{
- DWARFDebugInfoEntry *function_die = NULL;
- DWARFDebugInfoEntry *block_die = NULL;
- dwarf_cu->LookupAddress(file_vm_addr, &function_die, resolve_scope & eSymbolContextBlock ? &block_die : NULL);
-
- if (function_die != NULL)
+ const lldb::addr_t file_vm_addr = sc.line_entry.range.GetBaseAddress().GetFileAddress();
+ if (file_vm_addr != LLDB_INVALID_ADDRESS)
{
- sc.function = sc.comp_unit->FindFunctionByUID (MakeUserID(function_die->GetOffset())).get();
- if (sc.function == NULL)
- sc.function = ParseCompileUnitFunction(sc, dwarf_cu, function_die);
- }
+ DWARFDebugInfoEntry *function_die = NULL;
+ DWARFDebugInfoEntry *block_die = NULL;
+ dwarf_cu->LookupAddress(file_vm_addr, &function_die, resolve_scope & eSymbolContextBlock ? &block_die : NULL);
- if (sc.function != NULL)
- {
- Block& block = sc.function->GetBlock (true);
+ if (function_die != NULL)
+ {
+ sc.function = sc.comp_unit->FindFunctionByUID (MakeUserID(function_die->GetOffset())).get();
+ if (sc.function == NULL)
+ sc.function = ParseCompileUnitFunction(sc, dwarf_cu, function_die);
+ }
- if (block_die != NULL)
- sc.block = block.FindBlockByID (MakeUserID(block_die->GetOffset()));
- else
- sc.block = block.FindBlockByID (MakeUserID(function_die->GetOffset()));
+ if (sc.function != NULL)
+ {
+ Block& block = sc.function->GetBlock (true);
+
+ if (block_die != NULL)
+ sc.block = block.FindBlockByID (MakeUserID(block_die->GetOffset()));
+ else
+ sc.block = block.FindBlockByID (MakeUserID(function_die->GetOffset()));
+ }
}
}
- }
- sc_list.Append(sc);
- line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_idx, found_line, true, &sc.line_entry);
+ sc_list.Append(sc);
+ line_idx = line_table->FindLineEntryIndexByFileIndex (line_idx + 1, file_idx, found_line, true, &sc.line_entry);
+ }
}
}
+ else if (file_spec_matches_cu_file_spec && !check_inlines)
+ {
+ // only append the context if we aren't looking for inline call sites
+ // by file and line and if the file spec matches that of the compile unit
+ sc_list.Append(sc);
+ }
}
else if (file_spec_matches_cu_file_spec && !check_inlines)
{
@@ -2472,16 +2487,10 @@
// by file and line and if the file spec matches that of the compile unit
sc_list.Append(sc);
}
- }
- else if (file_spec_matches_cu_file_spec && !check_inlines)
- {
- // only append the context if we aren't looking for inline call sites
- // by file and line and if the file spec matches that of the compile unit
- sc_list.Append(sc);
- }
- if (!check_inlines)
- break;
+ if (!check_inlines)
+ break;
+ }
}
}
}
@@ -2713,7 +2722,6 @@
case DW_TAG_variable:
{
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, UINT32_MAX);
- assert(sc.comp_unit != NULL);
if (namespace_decl && !DIEIsInNamespace (namespace_decl, dwarf_cu, die))
continue;
Modified: lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp Wed May 16 19:31:04 2012
@@ -577,6 +577,8 @@
case clang::Type::Typedef:
return ClangASTType::GetFormat(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr());
+ case clang::Type::Auto:
+ return ClangASTType::GetFormat(llvm::cast<clang::AutoType>(qual_type)->desugar().getAsOpaquePtr());
case clang::Type::DependentSizedArray:
case clang::Type::DependentSizedExtVector:
case clang::Type::UnresolvedUsing:
@@ -586,7 +588,6 @@
case clang::Type::TemplateTypeParm:
case clang::Type::SubstTemplateTypeParm:
case clang::Type::SubstTemplateTypeParmPack:
- case clang::Type::Auto:
case clang::Type::InjectedClassName:
case clang::Type::DependentName:
case clang::Type::DependentTemplateSpecialization:
Modified: lldb/branches/lldb-platform-work/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Process.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Process.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Process.cpp Wed May 16 19:31:04 2012
@@ -3099,6 +3099,8 @@
// If we are going to stop, then we always broadcast the event.
// If we aren't going to stop, let the thread plans decide if we're going to report this event.
// If no thread has an opinion, we don't report it.
+
+ RefreshStateAfterStop ();
if (ProcessEventData::GetInterruptedFromEvent (event_ptr))
{
if (log)
@@ -3107,7 +3109,6 @@
}
else
{
- RefreshStateAfterStop ();
if (m_thread_list.ShouldStop (event_ptr) == false)
{
Modified: lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py Wed May 16 19:31:04 2012
@@ -30,9 +30,15 @@
COMMAND_FAILED_AS_EXPECTED, error = True,
substrs = ["error: 'gurp' is not a valid command."])
+ # Only one matching command: execute it.
self.expect("h",
startstr = "The following is a list of built-in, permanent debugger commands:")
+ # Several matching commands: list them and error out.
+ self.expect("t",
+ COMMAND_FAILED_AS_EXPECTED, error = True,
+ substrs = ["Ambiguous command 't'. Possible matches:",
+ "target", "thread", "type"])
self.expect("com sou ./change_prompt.lldb",
patterns = ["Executing commands in '.*change_prompt.lldb'"])
Modified: lldb/branches/lldb-platform-work/test/functionalities/alias/TestAliases.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/alias/TestAliases.py?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/alias/TestAliases.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/alias/TestAliases.py Wed May 16 19:31:04 2012
@@ -28,6 +28,23 @@
patterns = [ "Current executable set to .*a.out" ])
+ def cleanup():
+ self.runCmd('command unalias hello', check=False)
+ self.runCmd('command unalias python', check=False)
+ self.runCmd('command unalias pp', check=False)
+ self.runCmd('command unalias alias', check=False)
+ self.runCmd('command unalias unalias', check=False)
+ self.runCmd('command unalias myrun', check=False)
+ self.runCmd('command unalias bp', check=False)
+ self.runCmd('command unalias bpa', check=False)
+ self.runCmd('command unalias bpi', check=False)
+ self.runCmd('command unalias bfl', check=False)
+ self.runCmd('command unalias exprf', check=False)
+ self.runCmd('command unalias exprf2', check=False)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
self.runCmd (r'''command alias hello expr (int) printf ("\n\nHello, anybody!\n\n")''')
self.runCmd ("command alias python script")
Modified: lldb/branches/lldb-platform-work/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lldbtest.py?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lldbtest.py (original)
+++ lldb/branches/lldb-platform-work/test/lldbtest.py Wed May 16 19:31:04 2012
@@ -9,88 +9,23 @@
or when running each test case as a separate python invocation.
./dotest.py provides a test driver which sets up the environment to run the
-entire test suite. Users who want to run a test case on its own can specify the
-LLDB_TEST and PYTHONPATH environment variables, for example:
-
-$ export LLDB_TEST=$PWD
-$ export PYTHONPATH=/Volumes/data/lldb/svn/trunk/build/Debug/LLDB.framework/Resources/Python:$LLDB_TEST:$LLDB_TEST/plugins:$LLDB_TEST/pexpect-2.4
-$ echo $LLDB_TEST
-/Volumes/data/lldb/svn/trunk/test
-$ echo $PYTHONPATH
-/Volumes/data/lldb/svn/trunk/build/Debug/LLDB.framework/Resources/Python:/Volumes/data/lldb/svn/trunk/test:/Volumes/data/lldb/svn/trunk/test/plugins
-$ python function_types/TestFunctionTypes.py
-.
-----------------------------------------------------------------------
-Ran 1 test in 0.363s
-
-OK
-$ LLDB_COMMAND_TRACE=YES python array_types/TestArrayTypes.py
+entire of part of the test suite . Example:
+# Exercises the test suite in the types directory....
+/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 types
...
-runCmd: breakpoint set -f main.c -l 42
-output: Breakpoint created: 1: file ='main.c', line = 42, locations = 1
+Session logs for test failures/errors/unexpected successes will go into directory '2012-05-16-13_35_42'
+Command invoked: python ./dotest.py -A x86_64 types
+compilers=['clang']
-runCmd: run
-output: Launching '/Volumes/data/lldb/svn/trunk/test/array_types/a.out' (x86_64)
-
-...
-
-runCmd: frame variable strings
-output: (char *[4]) strings = {
- (char *) strings[0] = 0x0000000100000f0c "Hello",
- (char *) strings[1] = 0x0000000100000f12 "Hola",
- (char *) strings[2] = 0x0000000100000f17 "Bonjour",
- (char *) strings[3] = 0x0000000100000f1f "Guten Tag"
-}
-
-runCmd: frame variable char_16
-output: (char [16]) char_16 = {
- (char) char_16[0] = 'H',
- (char) char_16[1] = 'e',
- (char) char_16[2] = 'l',
- (char) char_16[3] = 'l',
- (char) char_16[4] = 'o',
- (char) char_16[5] = ' ',
- (char) char_16[6] = 'W',
- (char) char_16[7] = 'o',
- (char) char_16[8] = 'r',
- (char) char_16[9] = 'l',
- (char) char_16[10] = 'd',
- (char) char_16[11] = '\n',
- (char) char_16[12] = '\0',
- (char) char_16[13] = '\0',
- (char) char_16[14] = '\0',
- (char) char_16[15] = '\0'
-}
-
-runCmd: frame variable ushort_matrix
-output: (unsigned short [2][3]) ushort_matrix = {
- (unsigned short [3]) ushort_matrix[0] = {
- (unsigned short) ushort_matrix[0][0] = 0x0001,
- (unsigned short) ushort_matrix[0][1] = 0x0002,
- (unsigned short) ushort_matrix[0][2] = 0x0003
- },
- (unsigned short [3]) ushort_matrix[1] = {
- (unsigned short) ushort_matrix[1][0] = 0x000b,
- (unsigned short) ushort_matrix[1][1] = 0x0016,
- (unsigned short) ushort_matrix[1][2] = 0x0021
- }
-}
-
-runCmd: frame variable long_6
-output: (long [6]) long_6 = {
- (long) long_6[0] = 1,
- (long) long_6[1] = 2,
- (long) long_6[2] = 3,
- (long) long_6[3] = 4,
- (long) long_6[4] = 5,
- (long) long_6[5] = 6
-}
+Configuration: arch=x86_64 compiler=clang
+----------------------------------------------------------------------
+Collected 72 tests
-.
+........................................................................
----------------------------------------------------------------------
-Ran 1 test in 0.349s
+Ran 72 tests in 135.468s
OK
$
Modified: lldb/branches/lldb-platform-work/test/redo.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/redo.py?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/redo.py (original)
+++ lldb/branches/lldb-platform-work/test/redo.py Wed May 16 19:31:04 2012
@@ -113,13 +113,12 @@
global filename_components
test_dir = sys.path[0]
+ if not test_dir:
+ test_dir = os.getcwd()
if not test_dir.endswith('test'):
print "This script expects to reside in lldb's test directory."
sys.exit(-1)
- if not len(sys.argv) > 1:
- usage()
-
index = 1
while index < len(sys.argv):
if sys.argv[index].startswith('-h'):
@@ -166,7 +165,7 @@
os.path.walk(session_dir_path, redo, ".log")
if not redo_specs:
- print "No failures/errors recorded within the session directory, please specify a different session directory."
+ print "No failures/errors recorded within the session directory, please specify a different session directory.\n"
usage()
filters = " -f ".join(redo_specs)
Modified: lldb/branches/lldb-platform-work/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/driver/Driver.cpp?rev=156969&r1=156968&r2=156969&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/driver/Driver.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/driver/Driver.cpp Wed May 16 19:31:04 2012
@@ -135,7 +135,7 @@
void
Driver::CloseIOChannelFile ()
{
- // Write and End of File sequence to the file descriptor to ensure any
+ // Write an End of File sequence to the file descriptor to ensure any
// read functions can exit.
char eof_str[] = "\x04";
::write (m_editline_pty.GetMasterFileDescriptor(), eof_str, strlen(eof_str));
More information about the lldb-commits
mailing list