summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-07-01 01:26:43 +0000
committerGreg Clayton <gclayton@apple.com>2010-07-01 01:26:43 +0000
commit54b8b8c1a74a78125510a23dc0d02f864c7d0380 (patch)
tree4f6d25fb2932c13c3d61d2fe4d12726c6bbc0b2a
parent05166740eb6ca1ba0d3e9b325a7084993ff89ee8 (diff)
downloadbcm5719-llvm-54b8b8c1a74a78125510a23dc0d02f864c7d0380.tar.gz
bcm5719-llvm-54b8b8c1a74a78125510a23dc0d02f864c7d0380.zip
Fixed up disassembly to not emit the module name before all function names
that are in the disassembly comments since most of them are in the same module (shared library). Fixed a crasher that could happen when disassembling special section data. Added an address dump style that shows the symbol context without the module (used in the disassembly code). llvm-svn: 107366
-rw-r--r--lldb/include/lldb/Core/Address.h1
-rw-r--r--lldb/source/Core/Address.cpp23
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp4
3 files changed, 19 insertions, 9 deletions
diff --git a/lldb/include/lldb/Core/Address.h b/lldb/include/lldb/Core/Address.h
index c7ce0f8701d..87c3fefd6ff 100644
--- a/lldb/include/lldb/Core/Address.h
+++ b/lldb/include/lldb/Core/Address.h
@@ -86,6 +86,7 @@ public:
///< be anything from a symbol context summary (module, function/symbol,
///< and file and line), to information about what the pointer points to
///< if the address is in a section (section of pointers, c strings, etc).
+ DumpStyleResolvedDescriptionNoModule,
DumpStyleDetailedSymbolContext ///< Detailed symbol context information for an address for all symbol
///< context members.
} DumpStyle;
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index 4658cf27add..c857a6b6d1f 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -410,9 +410,13 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
if (m_section == NULL)
style = DumpStyleLoadAddress;
+ Target *target = NULL;
Process *process = NULL;
if (exe_scope)
+ {
+ target = exe_scope->CalculateTarget();
process = exe_scope->CalculateProcess();
+ }
// If addr_byte_size is UINT32_MAX, then determine the correct address
// byte size for the process or default to the size of addr_t
if (addr_size == UINT32_MAX)
@@ -475,6 +479,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
break;
case DumpStyleResolvedDescription:
+ case DumpStyleResolvedDescriptionNoModule:
if (IsSectionOffset())
{
lldb::AddressType addr_type = eAddressTypeLoad;
@@ -524,12 +529,12 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
{
if (ReadAddress (exe_scope, *this, pointer_size, so_addr))
{
- if (so_addr.IsSectionOffset())
+ if (target && so_addr.IsSectionOffset())
{
lldb_private::SymbolContext func_sc;
- process->GetTarget().GetImages().ResolveSymbolContextForAddress (so_addr,
- eSymbolContextEverything,
- func_sc);
+ target->GetImages().ResolveSymbolContextForAddress (so_addr,
+ eSymbolContextEverything,
+ func_sc);
if (func_sc.function || func_sc.symbol)
{
showed_info = true;
@@ -541,7 +546,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
#endif
Address cstr_addr(*this);
cstr_addr.SetOffset(cstr_addr.GetOffset() + pointer_size);
- func_sc.DumpStopContext(s, process, so_addr, true);
+ func_sc.DumpStopContext(s, exe_scope, so_addr, true);
if (ReadAddress (exe_scope, cstr_addr, pointer_size, so_addr))
{
#if VERBOSE_OUTPUT
@@ -625,7 +630,7 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
if (pointer_sc.function || pointer_sc.symbol)
{
s->PutCString(": ");
- pointer_sc.DumpStopContext(s, process, so_addr, false);
+ pointer_sc.DumpStopContext(s, exe_scope, so_addr, false);
}
}
}
@@ -644,20 +649,24 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
if (sc.function || sc.symbol)
{
bool show_stop_context = true;
+ bool show_module = (style == DumpStyleResolvedDescription);
if (sc.function == NULL && sc.symbol != NULL)
{
// If we have just a symbol make sure it is in the right section
if (sc.symbol->GetAddressRangePtr())
{
if (sc.symbol->GetAddressRangePtr()->GetBaseAddress().GetSection() != GetSection())
+ {
+ // don't show the module if the symbol is a trampoline symbol
show_stop_context = false;
+ }
}
}
if (show_stop_context)
{
// We have a function or a symbol from the same
// sections as this address.
- sc.DumpStopContext(s, process, *this, true);
+ sc.DumpStopContext(s, exe_scope, *this, show_module);
}
else
{
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
index 340d90637b9..c831d95aab2 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
@@ -245,7 +245,7 @@ DisassemblerLLVM::Instruction::Dump
if (process && process->IsAlive())
{
if (process->ResolveLoadAddress (operand_value, so_addr))
- so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescription, Address::DumpStyleSectionNameOffset);
+ so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset);
}
else if (inst_addr_ptr)
{
@@ -253,7 +253,7 @@ DisassemblerLLVM::Instruction::Dump
if (module)
{
if (module->ResolveFileAddress (operand_value, so_addr))
- so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescription, Address::DumpStyleSectionNameOffset);
+ so_addr.Dump(&comment, exe_scope, Address::DumpStyleResolvedDescriptionNoModule, Address::DumpStyleSectionNameOffset);
}
}
OpenPOWER on IntegriCloud