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
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index 4658cf2..c857a6b 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -410,9 +410,13 @@
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 @@
break;
case DumpStyleResolvedDescription:
+ case DumpStyleResolvedDescriptionNoModule:
if (IsSectionOffset())
{
lldb::AddressType addr_type = eAddressTypeLoad;
@@ -524,12 +529,12 @@
{
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 @@
#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 @@
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 @@
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
{