summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Core/Section.cpp8
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp8
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h10
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp39
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h6
-rw-r--r--lldb/source/Symbol/ObjectFile.cpp4
7 files changed, 62 insertions, 17 deletions
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index 62687817509..87f75e1f50a 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -61,6 +61,8 @@ const char *Section::GetTypeAsCString() const {
return "objc-cfstrings";
case eSectionTypeDWARFDebugAbbrev:
return "dwarf-abbrev";
+ case eSectionTypeDWARFDebugAbbrevDwo:
+ return "dwarf-abbrev-dwo";
case eSectionTypeDWARFDebugAddr:
return "dwarf-addr";
case eSectionTypeDWARFDebugAranges:
@@ -71,6 +73,8 @@ const char *Section::GetTypeAsCString() const {
return "dwarf-frame";
case eSectionTypeDWARFDebugInfo:
return "dwarf-info";
+ case eSectionTypeDWARFDebugInfoDwo:
+ return "dwarf-info-dwo";
case eSectionTypeDWARFDebugLine:
return "dwarf-line";
case eSectionTypeDWARFDebugLineStr:
@@ -93,8 +97,12 @@ const char *Section::GetTypeAsCString() const {
return "dwarf-rnglists";
case eSectionTypeDWARFDebugStr:
return "dwarf-str";
+ case eSectionTypeDWARFDebugStrDwo:
+ return "dwarf-str-dwo";
case eSectionTypeDWARFDebugStrOffsets:
return "dwarf-str-offsets";
+ case eSectionTypeDWARFDebugStrOffsetsDwo:
+ return "dwarf-str-offsets-dwo";
case eSectionTypeDWARFDebugTypes:
return "dwarf-types";
case eSectionTypeDWARFDebugNames:
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 1001eaef555..efb6a0b85c1 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1897,9 +1897,9 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
else if (name == g_sect_name_dwarf_debug_str_offsets)
sect_type = eSectionTypeDWARFDebugStrOffsets;
else if (name == g_sect_name_dwarf_debug_abbrev_dwo)
- sect_type = eSectionTypeDWARFDebugAbbrev;
+ sect_type = eSectionTypeDWARFDebugAbbrevDwo;
else if (name == g_sect_name_dwarf_debug_info_dwo)
- sect_type = eSectionTypeDWARFDebugInfo;
+ sect_type = eSectionTypeDWARFDebugInfoDwo;
else if (name == g_sect_name_dwarf_debug_line_dwo)
sect_type = eSectionTypeDWARFDebugLine;
else if (name == g_sect_name_dwarf_debug_line_str_dwo)
@@ -1911,9 +1911,9 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
else if (name == g_sect_name_dwarf_debug_loclists_dwo)
sect_type = eSectionTypeDWARFDebugLocLists;
else if (name == g_sect_name_dwarf_debug_str_dwo)
- sect_type = eSectionTypeDWARFDebugStr;
+ sect_type = eSectionTypeDWARFDebugStrDwo;
else if (name == g_sect_name_dwarf_debug_str_offsets_dwo)
- sect_type = eSectionTypeDWARFDebugStrOffsets;
+ sect_type = eSectionTypeDWARFDebugStrOffsetsDwo;
else if (name == g_sect_name_eh_frame)
sect_type = eSectionTypeEHFrame;
else if (name == g_sect_name_arm_exidx)
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index e14e4094f66..dafbb64847c 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1187,11 +1187,13 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
case eSectionTypeDebug:
case eSectionTypeDWARFDebugAbbrev:
+ case eSectionTypeDWARFDebugAbbrevDwo:
case eSectionTypeDWARFDebugAddr:
case eSectionTypeDWARFDebugAranges:
case eSectionTypeDWARFDebugCuIndex:
case eSectionTypeDWARFDebugFrame:
case eSectionTypeDWARFDebugInfo:
+ case eSectionTypeDWARFDebugInfoDwo:
case eSectionTypeDWARFDebugLine:
case eSectionTypeDWARFDebugLineStr:
case eSectionTypeDWARFDebugLoc:
@@ -1204,7 +1206,9 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
case eSectionTypeDWARFDebugRanges:
case eSectionTypeDWARFDebugRngLists:
case eSectionTypeDWARFDebugStr:
+ case eSectionTypeDWARFDebugStrDwo:
case eSectionTypeDWARFDebugStrOffsets:
+ case eSectionTypeDWARFDebugStrOffsetsDwo:
case eSectionTypeDWARFDebugTypes:
case eSectionTypeDWARFAppleNames:
case eSectionTypeDWARFAppleTypes:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index dc678e16702..1e30e17f3cf 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -233,11 +233,11 @@ public:
uint32_t GetPluginVersion() override;
- const lldb_private::DWARFDataExtractor &get_debug_abbrev_data();
- const lldb_private::DWARFDataExtractor &get_debug_addr_data();
+ virtual const lldb_private::DWARFDataExtractor &get_debug_abbrev_data();
+ virtual const lldb_private::DWARFDataExtractor &get_debug_addr_data();
const lldb_private::DWARFDataExtractor &get_debug_aranges_data();
const lldb_private::DWARFDataExtractor &get_debug_frame_data();
- const lldb_private::DWARFDataExtractor &get_debug_info_data();
+ virtual const lldb_private::DWARFDataExtractor &get_debug_info_data();
const lldb_private::DWARFDataExtractor &get_debug_line_data();
const lldb_private::DWARFDataExtractor &get_debug_line_str_data();
const lldb_private::DWARFDataExtractor &get_debug_macro_data();
@@ -245,8 +245,8 @@ public:
const lldb_private::DWARFDataExtractor &get_debug_loclists_data();
const lldb_private::DWARFDataExtractor &get_debug_ranges_data();
const lldb_private::DWARFDataExtractor &get_debug_rnglists_data();
- const lldb_private::DWARFDataExtractor &get_debug_str_data();
- const lldb_private::DWARFDataExtractor &get_debug_str_offsets_data();
+ virtual const lldb_private::DWARFDataExtractor &get_debug_str_data();
+ virtual const lldb_private::DWARFDataExtractor &get_debug_str_offsets_data();
const lldb_private::DWARFDataExtractor &get_debug_types_data();
const lldb_private::DWARFDataExtractor &get_apple_names_data();
const lldb_private::DWARFDataExtractor &get_apple_types_data();
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
index 15fe362fa11..7881448535b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -61,14 +61,6 @@ SymbolFileDWARFDwo::ParseCompileUnit(DWARFUnit *dwarf_cu,
}
DWARFUnit *SymbolFileDWARFDwo::GetCompileUnit() {
- // A clang module is found via a skeleton CU, but is not a proper DWO.
- // Clang modules have a .debug_info section instead of the *_dwo variant.
- if (auto *section_list = m_obj_file->GetSectionList(false))
- if (auto section_sp =
- section_list->FindSectionByType(eSectionTypeDWARFDebugInfo, true))
- if (!section_sp->GetName().GetStringRef().endswith("dwo"))
- return nullptr;
-
// Only dwo files with 1 compile unit is supported
if (GetNumCompileUnits() == 1)
return DebugInfo()->GetCompileUnitAtIndex(0);
@@ -126,6 +118,37 @@ DWARFUnit *SymbolFileDWARFDwo::GetBaseCompileUnit() {
return m_base_dwarf_cu;
}
+const DWARFDataExtractor &SymbolFileDWARFDwo::get_debug_abbrev_data() {
+ return GetCachedSectionData(eSectionTypeDWARFDebugAbbrevDwo,
+ m_data_debug_abbrev);
+}
+
+const DWARFDataExtractor &SymbolFileDWARFDwo::get_debug_addr_data() {
+ // For single file split dwarf case (when we have .dwo sections in a .o),
+ // we do not want to use the .debug_addr section from .o file,
+ // but want to get one from the final executable.
+ // For regular split debug case, .dwo file does not contain the
+ // .debug_addr, so we would always fall back to such lookup anyways.
+ llvm::call_once(m_data_debug_addr.m_flag, [this] {
+ SymbolFileDWARF::LoadSectionData(eSectionTypeDWARFDebugAddr,
+ std::ref(m_data_debug_addr.m_data));
+ });
+ return m_data_debug_addr.m_data;
+}
+
+const DWARFDataExtractor &SymbolFileDWARFDwo::get_debug_info_data() {
+ return GetCachedSectionData(eSectionTypeDWARFDebugInfoDwo, m_data_debug_info);
+}
+
+const DWARFDataExtractor &SymbolFileDWARFDwo::get_debug_str_data() {
+ return GetCachedSectionData(eSectionTypeDWARFDebugStrDwo, m_data_debug_str);
+}
+
+const DWARFDataExtractor &SymbolFileDWARFDwo::get_debug_str_offsets_data() {
+ return GetCachedSectionData(eSectionTypeDWARFDebugStrOffsetsDwo,
+ m_data_debug_str_offsets);
+}
+
SymbolFileDWARF *SymbolFileDWARFDwo::GetBaseSymbolFile() {
return m_base_dwarf_cu->GetSymbolFileDWARF();
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
index 21ad90cca64..b9ed37547ac 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -46,6 +46,12 @@ public:
DWARFUnit *GetBaseCompileUnit() override;
+ const lldb_private::DWARFDataExtractor &get_debug_abbrev_data() override;
+ const lldb_private::DWARFDataExtractor &get_debug_addr_data() override;
+ const lldb_private::DWARFDataExtractor &get_debug_info_data() override;
+ const lldb_private::DWARFDataExtractor &get_debug_str_data() override;
+ const lldb_private::DWARFDataExtractor &get_debug_str_offsets_data() override;
+
protected:
void LoadSectionData(lldb::SectionType sect_type,
lldb_private::DWARFDataExtractor &data) override;
diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp
index d56acd230c3..db9136e4ba8 100644
--- a/lldb/source/Symbol/ObjectFile.cpp
+++ b/lldb/source/Symbol/ObjectFile.cpp
@@ -345,11 +345,13 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
return AddressClass::eData;
case eSectionTypeDebug:
case eSectionTypeDWARFDebugAbbrev:
+ case eSectionTypeDWARFDebugAbbrevDwo:
case eSectionTypeDWARFDebugAddr:
case eSectionTypeDWARFDebugAranges:
case eSectionTypeDWARFDebugCuIndex:
case eSectionTypeDWARFDebugFrame:
case eSectionTypeDWARFDebugInfo:
+ case eSectionTypeDWARFDebugInfoDwo:
case eSectionTypeDWARFDebugLine:
case eSectionTypeDWARFDebugLineStr:
case eSectionTypeDWARFDebugLoc:
@@ -362,7 +364,9 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
case eSectionTypeDWARFDebugRanges:
case eSectionTypeDWARFDebugRngLists:
case eSectionTypeDWARFDebugStr:
+ case eSectionTypeDWARFDebugStrDwo:
case eSectionTypeDWARFDebugStrOffsets:
+ case eSectionTypeDWARFDebugStrOffsetsDwo:
case eSectionTypeDWARFDebugTypes:
case eSectionTypeDWARFAppleNames:
case eSectionTypeDWARFAppleTypes:
OpenPOWER on IntegriCloud