summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Address.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-10-08 00:21:05 +0000
committerGreg Clayton <gclayton@apple.com>2010-10-08 00:21:05 +0000
commit8941142af83243ece14d49c4f7adb551aa19af82 (patch)
tree3a83f7e7b868d8902a5a781d25d623b2e9f2fabd /lldb/source/Core/Address.cpp
parente2245542ce6ec6d47c53ea856dc2beef3dff9f99 (diff)
downloadbcm5719-llvm-8941142af83243ece14d49c4f7adb551aa19af82.tar.gz
bcm5719-llvm-8941142af83243ece14d49c4f7adb551aa19af82.zip
Hooked up ability to look up data symbols so they show up in disassembly
if the address comes from a data section. Fixed an issue that could occur when looking up a symbol that has a zero byte size where no match would be returned even if there was an exact symbol match. Cleaned up the section dump output and added the section type into the output. llvm-svn: 116017
Diffstat (limited to 'lldb/source/Core/Address.cpp')
-rw-r--r--lldb/source/Core/Address.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index c880d84b7c6..d8e1f2568a4 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -466,6 +466,34 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
SectionType sect_type = section->GetType();
switch (sect_type)
{
+ case eSectionTypeData:
+ if (module)
+ {
+ ObjectFile *objfile = module->GetObjectFile();
+ if (objfile)
+ {
+ Symtab *symtab = objfile->GetSymtab();
+ if (symtab)
+ {
+ const addr_t file_Addr = GetFileAddress();
+ Symbol *symbol = symtab->FindSymbolContainingFileAddress (file_Addr);
+ if (symbol)
+ {
+ const char *symbol_name = symbol->GetName().AsCString();
+ if (symbol_name)
+ {
+ s->PutCString(symbol_name);
+ addr_t delta = file_Addr - symbol->GetAddressRangePtr()->GetBaseAddress().GetFileAddress();
+ if (delta)
+ s->Printf(" + %llu", delta);
+ showed_info = true;
+ }
+ }
+ }
+ }
+ }
+ break;
+
case eSectionTypeDataCString:
// Read the C string from memory and display it
showed_info = true;
OpenPOWER on IntegriCloud