diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/API/SBData.cpp | 4 | ||||
-rw-r--r-- | lldb/source/API/SBSection.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Symbol/Symbol.cpp | 15 |
3 files changed, 24 insertions, 11 deletions
diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp index 58593416789..e3c1e43f25f 100644 --- a/lldb/source/API/SBData.cpp +++ b/lldb/source/API/SBData.cpp @@ -412,7 +412,7 @@ SBData::GetString (lldb::SBError& error, uint32_t offset) } bool -SBData::GetDescription (lldb::SBStream &description) +SBData::GetDescription (lldb::SBStream &description, lldb::addr_t base_addr) { if (m_opaque_sp) { @@ -423,7 +423,7 @@ SBData::GetDescription (lldb::SBStream &description) 1, m_opaque_sp->GetByteSize(), 16, - LLDB_INVALID_ADDRESS, + base_addr, 0, 0); } diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp index 2636dd02136..3a6efb4d5f1 100644 --- a/lldb/source/API/SBSection.cpp +++ b/lldb/source/API/SBSection.cpp @@ -12,8 +12,9 @@ #include "lldb/Core/DataBuffer.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Log.h" -#include "lldb/Core/Section.h" #include "lldb/Core/Module.h" +#include "lldb/Core/Section.h" +#include "lldb/Core/StreamString.h" namespace lldb_private { @@ -238,6 +239,12 @@ SBSection::GetFileByteSize () } SBData +SBSection::GetSectionData () +{ + return GetSectionData (0, UINT64_MAX); +} + +SBData SBSection::GetSectionData (uint64_t offset, uint64_t size) { SBData sb_data; @@ -319,9 +326,12 @@ SBSection::operator != (const SBSection &rhs) bool SBSection::GetDescription (SBStream &description) { - if (m_opaque_ap.get()) + if (IsValid()) { - description.Printf ("SBSection"); + const Section *section = m_opaque_ap->GetSection(); + const addr_t file_addr = section->GetFileAddress(); + description.Printf ("[0x%16.16llx-0x%16.16llx) ", file_addr, file_addr + section->GetByteSize()); + section->DumpName(description.get()); } else { diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp index 71caa5e3aa0..27780a939ad 100644 --- a/lldb/source/Symbol/Symbol.cpp +++ b/lldb/source/Symbol/Symbol.cpp @@ -177,6 +177,7 @@ void Symbol::GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) const { *s << "id = " << (const UserID&)*this << ", name = \"" << m_mangled.GetName() << '"'; + const Section *section = m_addr_range.GetBaseAddress().GetSection(); if (section != NULL) { @@ -194,12 +195,14 @@ Symbol::GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) } } else - { - if (m_size_is_sibling) - s->Printf (", sibling = %5llu", m_addr_range.GetBaseAddress().GetOffset()); - else - s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset()); - } + s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset()); + } + else + { + if (m_size_is_sibling) + s->Printf (", sibling = %5llu", m_addr_range.GetBaseAddress().GetOffset()); + else + s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset()); } } |