forked from OSchip/llvm-project
dwarfdump: support indexed string dumping in dwp based on the STR_OFFSETS component of the index
llvm-svn: 253392
This commit is contained in:
parent
8483df6e24
commit
35c2eebfe4
|
@ -37,7 +37,11 @@ DWARFUnit::DWARFUnit(DWARFContext &DC, const DWARFSection &Section,
|
||||||
const DWARFUnitSectionBase &UnitSection,
|
const DWARFUnitSectionBase &UnitSection,
|
||||||
const DWARFUnitIndex::Entry *IndexEntry)
|
const DWARFUnitIndex::Entry *IndexEntry)
|
||||||
: Context(DC), InfoSection(Section), Abbrev(DA), RangeSection(RS),
|
: Context(DC), InfoSection(Section), Abbrev(DA), RangeSection(RS),
|
||||||
LineSection(LS), StringSection(SS), StringOffsetSection(SOS),
|
LineSection(LS), StringSection(SS), StringOffsetSection([&]() {
|
||||||
|
if (const auto *C = IndexEntry->getOffset(DW_SECT_STR_OFFSETS))
|
||||||
|
return SOS.slice(C->Offset, C->Offset + C->Length);
|
||||||
|
return SOS;
|
||||||
|
}()),
|
||||||
AddrOffsetSection(AOS), isLittleEndian(LE), UnitSection(UnitSection),
|
AddrOffsetSection(AOS), isLittleEndian(LE), UnitSection(UnitSection),
|
||||||
IndexEntry(IndexEntry) {
|
IndexEntry(IndexEntry) {
|
||||||
clear();
|
clear();
|
||||||
|
|
|
@ -17,8 +17,7 @@ RUN: llvm-dwarfdump %p/Inputs/dwarfdump-dwp.x86_64.o | FileCheck %s
|
||||||
; CHECK-SAME: abbr_offset = 0x0043
|
; CHECK-SAME: abbr_offset = 0x0043
|
||||||
; CHECK: DW_TAG_compile_unit
|
; CHECK: DW_TAG_compile_unit
|
||||||
; CHECK-NOT: DW_TAG
|
; CHECK-NOT: DW_TAG
|
||||||
; FIXME: Implement str_offsets support so we find b.cpp here \/
|
; CHECK: DW_AT_name {{.*}} "b.cpp"
|
||||||
; CHECK: DW_AT_name {{.*}} "a.cpp"
|
|
||||||
|
|
||||||
; Verify that abbreviations are decoded using the abbrev offset in the index
|
; Verify that abbreviations are decoded using the abbrev offset in the index
|
||||||
; CHECK: DW_TAG_structure_type
|
; CHECK: DW_TAG_structure_type
|
||||||
|
|
Loading…
Reference in New Issue