diff options
author | Greg Clayton <gclayton@apple.com> | 2010-12-07 18:05:22 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-12-07 18:05:22 +0000 |
commit | f66935840df3087e865ed18e7eb796b3a9d02876 (patch) | |
tree | 2789041f6a4f6afba03a06151403bf1af3987b59 /lldb/source/Core/Section.cpp | |
parent | 6e517d658ecdc8d555da5eeb6ae0a7b4518c89d3 (diff) | |
download | bcm5719-llvm-f66935840df3087e865ed18e7eb796b3a9d02876.tar.gz bcm5719-llvm-f66935840df3087e865ed18e7eb796b3a9d02876.zip |
Improved the "image dump section" command output by making sure
it indents and shows things correctly. When we are debugging DWARF
in .o files with debug map, we can see the remapped sections by
dumping the sections for the .o files by explicitly dumping the
module by name. For example, debugging the lldb/test/class_types
example on MacOSX without a dSYM file we can make a query that
causes the main.o file to be loaded, then we can do a:
(lldb) image dump section main.o
This will show the exact section map that is used and can help
track down when things are going wrong with DWARF in .o files with
debug map.
llvm-svn: 121154
Diffstat (limited to 'lldb/source/Core/Section.cpp')
-rw-r--r-- | lldb/source/Core/Section.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index df4dc258b10..9ce418dead2 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -234,7 +234,7 @@ Section::Dump (Stream *s, Target *target) const s->Printf("%39s", ""); else { - if (target) + if (target && m_linked_section == NULL) addr = GetLoadBaseAddress (target); if (addr == LLDB_INVALID_ADDRESS) @@ -257,7 +257,7 @@ Section::Dump (Stream *s, Target *target) const if (m_linked_section) { addr = LLDB_INVALID_ADDRESS; - + resolved = true; if (target) { addr = m_linked_section->GetLoadBaseAddress(target); @@ -668,6 +668,7 @@ SectionList::ContainsSection(user_id_t sect_id) const void SectionList::Dump (Stream *s, Target *target, bool show_header) const { + bool target_has_loaded_sections = target && !target->GetSectionLoadList().IsEmpty(); if (show_header && !m_sections.empty()) { // s->Printf("%.*p: ", (int)sizeof(void*) * 2, this); @@ -676,7 +677,7 @@ SectionList::Dump (Stream *s, Target *target, bool show_header) const // s->IndentMore(); // s->Printf("%*s", 2*(sizeof(void *) + 2), ""); s->Indent(); - s->Printf("SectID Type %s Address File Off. File Size Flags Section Name\n", (target && target->GetSectionLoadList().IsEmpty() == false) ? "Load" : "File"); + s->Printf("SectID Type %s Address File Off. File Size Flags Section Name\n", target_has_loaded_sections ? "Load" : "File"); // s->Printf("%*s", 2*(sizeof(void *) + 2), ""); s->Indent(); s->PutCString("---------- -------------- --------------------------------------- ---------- ---------- ---------- ----------------------------\n"); @@ -687,7 +688,7 @@ SectionList::Dump (Stream *s, Target *target, bool show_header) const const_iterator end = m_sections.end(); for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) { - (*sect_iter)->Dump(s, target); + (*sect_iter)->Dump(s, target_has_loaded_sections ? target : NULL); } if (show_header && !m_sections.empty()) |