summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/AddressRange.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-09-10 01:30:46 +0000
committerGreg Clayton <gclayton@apple.com>2010-09-10 01:30:46 +0000
commitc9800667e406820f0633a5085220d133c1ae93d4 (patch)
treea0ba2bb9375f9f8c84329037cd3fa0360a2bbb10 /lldb/source/Core/AddressRange.cpp
parentbf4070756f4acbae9a556c56003f0dd71521288e (diff)
downloadbcm5719-llvm-c9800667e406820f0633a5085220d133c1ae93d4.tar.gz
bcm5719-llvm-c9800667e406820f0633a5085220d133c1ae93d4.zip
Cleaned up the output of "image lookup --address <ADDR>" which involved
cleaning up the output of many GetDescription objects that are part of a symbol context. This fixes an issue where no ranges were being printed out for functions, blocks and symbols. llvm-svn: 113571
Diffstat (limited to 'lldb/source/Core/AddressRange.cpp')
-rw-r--r--lldb/source/Core/AddressRange.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/lldb/source/Core/AddressRange.cpp b/lldb/source/Core/AddressRange.cpp
index 47b957aca0a..d84a4e8dfa3 100644
--- a/lldb/source/Core/AddressRange.cpp
+++ b/lldb/source/Core/AddressRange.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "lldb/Core/AddressRange.h"
+#include "lldb/Core/Module.h"
#include "lldb/Core/Stream.h"
#include "lldb/Target/Process.h"
@@ -144,11 +145,11 @@ AddressRange::Dump(Stream *s, Process *process, Address::DumpStyle style, Addres
if (process)
addr_size = process->GetAddressByteSize ();
+ bool show_module = false;
switch (style)
{
default:
break;
-
case Address::DumpStyleSectionNameOffset:
case Address::DumpStyleSectionPointerOffset:
s->PutChar ('[');
@@ -159,6 +160,9 @@ AddressRange::Dump(Stream *s, Process *process, Address::DumpStyle style, Addres
return true;
break;
+ case Address::DumpStyleModuleWithFileAddress:
+ show_module = true;
+ // fall through
case Address::DumpStyleFileAddress:
vmaddr = m_base_addr.GetFileAddress();
break;
@@ -170,9 +174,19 @@ AddressRange::Dump(Stream *s, Process *process, Address::DumpStyle style, Addres
if (vmaddr != LLDB_INVALID_ADDRESS)
{
+ if (show_module)
+ {
+ Module *module = GetBaseAddress().GetModule();
+ if (module)
+ s->Printf("%s", module->GetFileSpec().GetFilename().AsCString());
+ }
s->AddressRange(vmaddr, vmaddr + GetByteSize(), addr_size);
return true;
}
+ else if (fallback_style != Address::DumpStyleInvalid)
+ {
+ return Dump(s, process, fallback_style, Address::DumpStyleInvalid);
+ }
return false;
}
OpenPOWER on IntegriCloud