summaryrefslogtreecommitdiff
path: root/source/Core/Section.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
commitf73363f1dd94996356cefbf24388f561891acf0b (patch)
treee3c31248bdb36eaec5fd833490d4278162dba2a0 /source/Core/Section.cpp
parent160ee69dd7ae18978f4068116777639ea98dc951 (diff)
Notes
Diffstat (limited to 'source/Core/Section.cpp')
-rw-r--r--source/Core/Section.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/source/Core/Section.cpp b/source/Core/Section.cpp
index c9faf9f89157..d9c5d32ee13c 100644
--- a/source/Core/Section.cpp
+++ b/source/Core/Section.cpp
@@ -27,8 +27,8 @@ class DataExtractor;
using namespace lldb;
using namespace lldb_private;
-static const char *GetSectionTypeAsCString(lldb::SectionType sect_type) {
- switch (sect_type) {
+const char *Section::GetTypeAsCString() const {
+ switch (m_type) {
case eSectionTypeInvalid:
return "invalid";
case eSectionTypeCode:
@@ -89,6 +89,10 @@ static const char *GetSectionTypeAsCString(lldb::SectionType sect_type) {
return "dwarf-str";
case eSectionTypeDWARFDebugStrOffsets:
return "dwarf-str-offsets";
+ case eSectionTypeDWARFDebugTypes:
+ return "dwarf-types";
+ case eSectionTypeDWARFDebugNames:
+ return "dwarf-names";
case eSectionTypeELFSymbolTable:
return "elf-symbol-table";
case eSectionTypeELFDynamicSymbols:
@@ -117,6 +121,8 @@ static const char *GetSectionTypeAsCString(lldb::SectionType sect_type) {
return "go-symtab";
case eSectionTypeAbsoluteAddress:
return "absolute";
+ case eSectionTypeDWARFGNUDebugAltLink:
+ return "dwarf-gnu-debugaltlink";
case eSectionTypeOther:
return "regular";
}
@@ -175,9 +181,9 @@ Section::~Section() {
addr_t Section::GetFileAddress() const {
SectionSP parent_sp(GetParent());
if (parent_sp) {
- // This section has a parent which means m_file_addr is an offset into
- // the parent section, so the file address for this section is the file
- // address of the parent plus the offset
+ // This section has a parent which means m_file_addr is an offset into the
+ // parent section, so the file address for this section is the file address
+ // of the parent plus the offset
return parent_sp->GetFileAddress() + m_file_addr;
}
// This section has no parent, so m_file_addr is the file base address
@@ -283,8 +289,7 @@ int Section::Compare(const Section &a, const Section &b) {
void Section::Dump(Stream *s, Target *target, uint32_t depth) const {
// s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
- s->Printf("0x%8.8" PRIx64 " %-16s ", GetID(),
- GetSectionTypeAsCString(m_type));
+ s->Printf("0x%8.8" PRIx64 " %-16s ", GetID(), GetTypeAsCString());
bool resolved = true;
addr_t addr = LLDB_INVALID_ADDRESS;
@@ -326,10 +331,11 @@ void Section::DumpName(Stream *s) const {
// The top most section prints the module basename
const char *name = NULL;
ModuleSP module_sp(GetModule());
- const FileSpec &file_spec = m_obj_file->GetFileSpec();
- if (m_obj_file)
+ if (m_obj_file) {
+ const FileSpec &file_spec = m_obj_file->GetFileSpec();
name = file_spec.GetFilename().AsCString();
+ }
if ((!name || !name[0]) && module_sp)
name = module_sp->GetFileSpec().GetFilename().AsCString();
if (name && name[0])
@@ -556,10 +562,8 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr,
Section *sect = sect_iter->get();
if (sect->ContainsFileAddress(vm_addr)) {
// The file address is in this section. We need to make sure one of our
- // child
- // sections doesn't contain this address as well as obeying the depth
- // limit
- // that was passed in.
+ // child sections doesn't contain this address as well as obeying the
+ // depth limit that was passed in.
if (depth > 0)
sect_sp = sect->GetChildren().FindSectionContainingFileAddress(
vm_addr, depth - 1);