@@ -336,6 +336,14 @@ static void dumpLoclistsSection(raw_ostream &OS, DIDumpOptions DumpOpts,
336
336
}
337
337
}
338
338
339
+ static void dumpPubTableSection (raw_ostream &OS, DIDumpOptions DumpOpts,
340
+ DWARFDataExtractor Data, bool GnuStyle) {
341
+ DWARFDebugPubTable Table;
342
+ if (Error E = Table.extract (Data, GnuStyle))
343
+ DumpOpts.RecoverableErrorHandler (std::move (E));
344
+ Table.dump (OS);
345
+ }
346
+
339
347
void DWARFContext::dump (
340
348
raw_ostream &OS, DIDumpOptions DumpOpts,
341
349
std::array<Optional<uint64_t >, DIDT_ID_Count> DumpOffsets) {
@@ -626,26 +634,32 @@ void DWARFContext::dump(
626
634
}
627
635
628
636
if (shouldDump (Explicit, " .debug_pubnames" , DIDT_ID_DebugPubnames,
629
- DObj->getPubnamesSection ().Data ))
630
- DWARFDebugPubTable (*DObj, DObj->getPubnamesSection (), isLittleEndian (), false )
631
- .dump (OS);
637
+ DObj->getPubnamesSection ().Data )) {
638
+ DWARFDataExtractor PubTableData (*DObj, DObj->getPubnamesSection (),
639
+ isLittleEndian (), 0 );
640
+ dumpPubTableSection (OS, DumpOpts, PubTableData, /* GnuStyle=*/ false );
641
+ }
632
642
633
643
if (shouldDump (Explicit, " .debug_pubtypes" , DIDT_ID_DebugPubtypes,
634
- DObj->getPubtypesSection ().Data ))
635
- DWARFDebugPubTable (*DObj, DObj->getPubtypesSection (), isLittleEndian (), false )
636
- .dump (OS);
644
+ DObj->getPubtypesSection ().Data )) {
645
+ DWARFDataExtractor PubTableData (*DObj, DObj->getPubtypesSection (),
646
+ isLittleEndian (), 0 );
647
+ dumpPubTableSection (OS, DumpOpts, PubTableData, /* GnuStyle=*/ false );
648
+ }
637
649
638
650
if (shouldDump (Explicit, " .debug_gnu_pubnames" , DIDT_ID_DebugGnuPubnames,
639
- DObj->getGnuPubnamesSection ().Data ))
640
- DWARFDebugPubTable (*DObj, DObj->getGnuPubnamesSection (), isLittleEndian (),
641
- true /* GnuStyle */ )
642
- .dump (OS);
651
+ DObj->getGnuPubnamesSection ().Data )) {
652
+ DWARFDataExtractor PubTableData (*DObj, DObj->getGnuPubnamesSection (),
653
+ isLittleEndian (), 0 );
654
+ dumpPubTableSection (OS, DumpOpts, PubTableData, /* GnuStyle=*/ true );
655
+ }
643
656
644
657
if (shouldDump (Explicit, " .debug_gnu_pubtypes" , DIDT_ID_DebugGnuPubtypes,
645
- DObj->getGnuPubtypesSection ().Data ))
646
- DWARFDebugPubTable (*DObj, DObj->getGnuPubtypesSection (), isLittleEndian (),
647
- true /* GnuStyle */ )
648
- .dump (OS);
658
+ DObj->getGnuPubtypesSection ().Data )) {
659
+ DWARFDataExtractor PubTableData (*DObj, DObj->getGnuPubtypesSection (),
660
+ isLittleEndian (), 0 );
661
+ dumpPubTableSection (OS, DumpOpts, PubTableData, /* GnuStyle=*/ true );
662
+ }
649
663
650
664
if (shouldDump (Explicit, " .debug_str_offsets" , DIDT_ID_DebugStrOffsets,
651
665
DObj->getStrOffsetsSection ().Data ))
0 commit comments