summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/Address.cpp28
-rw-r--r--lldb/source/Core/Module.cpp2
-rw-r--r--lldb/source/Core/Section.cpp22
3 files changed, 40 insertions, 12 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;
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 8194b69e359..251207425d1 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -372,7 +372,7 @@ void
Module::Dump(Stream *s)
{
Mutex::Locker locker (m_mutex);
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+ //s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
s->Printf("Module %s/%s%s%s%s\n",
m_file.GetDirectory().AsCString(),
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index f4e8800222c..3dae577c5c8 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -222,11 +222,11 @@ Section::Compare (const Section& a, const Section& b)
void
-Section::Dump(Stream *s, Target *target) const
+Section::Dump (Stream *s, Target *target) const
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+// s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
- s->Printf("0x%8.8x ", GetID());
+ s->Printf("0x%8.8x %-14s ", GetID(), GetSectionTypeAsCString (m_type));
bool resolved = true;
addr_t addr = LLDB_INVALID_ADDRESS;
@@ -672,16 +672,16 @@ SectionList::Dump (Stream *s, Target *target, bool show_header) const
{
if (show_header && !m_sections.empty())
{
- s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+// s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
+// s->Indent();
+// s->PutCString( "SectionList\n");
+// s->IndentMore();
+// s->Printf("%*s", 2*(sizeof(void *) + 2), "");
s->Indent();
- s->PutCString( "SectionList\n");
- s->IndentMore();
- s->Printf("%*s", 2*(sizeof(void *) + 2), "");
+ s->Printf("SectID Type %s Address File Off. File Size Flags Section Name\n", (target && target->GetSectionLoadList().IsEmpty() == false) ? "Load" : "File");
+// s->Printf("%*s", 2*(sizeof(void *) + 2), "");
s->Indent();
- s->Printf("SectID %s Address File Off. File Size Flags Section Name\n", (target && target->GetSectionLoadList().IsEmpty() == false) ? "Load" : "File");
- s->Printf("%*s", 2*(sizeof(void *) + 2), "");
- s->Indent();
- s->PutCString("---------- --------------------------------------- ---------- ---------- ---------- ----------------------------\n");
+ s->PutCString("---------- -------------- --------------------------------------- ---------- ---------- ---------- ----------------------------\n");
}
OpenPOWER on IntegriCloud