diff options
Diffstat (limited to 'llvm/lib/DebugInfo')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 13 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 12 | ||||
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 13 |
4 files changed, 20 insertions, 26 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp index ddf307de222..ef6da08d34a 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp @@ -7,23 +7,19 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/DWARF/DWARFAddressRange.h" -#include "llvm/DebugInfo/DWARF/DWARFFormValue.h" + #include "llvm/Support/Format.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; void DWARFAddressRange::dump(raw_ostream &OS, uint32_t AddressSize, - DIDumpOptions DumpOpts, - const DWARFObject *Obj) const { + DIDumpOptions DumpOpts) const { OS << (DumpOpts.DisplayRawContents ? " " : "["); OS << format("0x%*.*" PRIx64 ", ", AddressSize * 2, AddressSize * 2, LowPC) << format("0x%*.*" PRIx64, AddressSize * 2, AddressSize * 2, HighPC); OS << (DumpOpts.DisplayRawContents ? "" : ")"); - - if (Obj) - DWARFFormValue::dumpAddressSection(*Obj, OS, DumpOpts, SectionIndex); } raw_ostream &llvm::operator<<(raw_ostream &OS, const DWARFAddressRange &R) { diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index 3071f637b5a..3fad575ff40 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -388,20 +388,16 @@ void DWARFContext::dump( dumpDebugType(".debug_types.dwo", dwo_types_section_units()); } - DIDumpOptions LLDumpOpts = DumpOpts; - if (LLDumpOpts.Verbose) - LLDumpOpts.DisplayRawContents = true; - if (const auto *Off = shouldDump(Explicit, ".debug_loc", DIDT_ID_DebugLoc, DObj->getLocSection().Data)) { - getDebugLoc()->dump(OS, getRegisterInfo(), LLDumpOpts, *Off); + getDebugLoc()->dump(OS, getRegisterInfo(), DumpOpts, *Off); } if (const auto *Off = shouldDump(Explicit, ".debug_loclists", DIDT_ID_DebugLoclists, DObj->getLoclistsSection().Data)) { DWARFDataExtractor Data(*DObj, DObj->getLoclistsSection(), isLittleEndian(), 0); - dumpLoclistsSection(OS, LLDumpOpts, Data, getRegisterInfo(), *Off); + dumpLoclistsSection(OS, DumpOpts, Data, getRegisterInfo(), *Off); } if (const auto *Off = shouldDump(ExplicitDWO, ".debug_loc.dwo", DIDT_ID_DebugLoc, @@ -413,11 +409,10 @@ void DWARFContext::dump( uint64_t Offset = **Off; Loc.dumpLocationList(&Offset, OS, /*BaseAddr=*/None, getRegisterInfo(), nullptr, - LLDumpOpts, /*Indent=*/0); + DumpOpts, /*Indent=*/0); OS << "\n"; } else { - Loc.dumpRange(0, Data.getData().size(), OS, getRegisterInfo(), - LLDumpOpts); + Loc.dumpRange(0, Data.getData().size(), OS, getRegisterInfo(), DumpOpts); } } diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index 1af51a85d18..218bf381567 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -115,20 +115,14 @@ bool DWARFLocationTable::dumpLocationList(uint64_t *Offset, raw_ostream &OS, OS << format("0x%8.8" PRIx64 ": ", *Offset); Error E = visitLocationList(Offset, [&](const DWARFLocationEntry &E) { Expected<Optional<DWARFLocationExpression>> Loc = Interp.Interpret(E); - if (!Loc || DumpOpts.DisplayRawContents) + if (!Loc || DumpOpts.Verbose) dumpRawEntry(E, OS, Indent); if (Loc && *Loc) { OS << "\n"; OS.indent(Indent); - if (DumpOpts.DisplayRawContents) + if (DumpOpts.Verbose) OS << " => "; - - DIDumpOptions RangeDumpOpts(DumpOpts); - RangeDumpOpts.DisplayRawContents = false; - const DWARFObject *Obj = nullptr; - if (U) - Obj = &U->getContext().getDWARFObj(); - Loc.get()->Range->dump(OS, Data.getAddressSize(), RangeDumpOpts, Obj); + Loc.get()->Range->dump(OS, Data.getAddressSize(), DumpOpts); } if (!Loc) consumeError(Loc.takeError()); diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index a11865e048c..7fa72b1bb57 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -62,10 +62,16 @@ static void dumpRanges(const DWARFObject &Obj, raw_ostream &OS, if (!DumpOpts.ShowAddresses) return; + ArrayRef<SectionName> SectionNames; + if (DumpOpts.Verbose) + SectionNames = Obj.getSectionNames(); + for (const DWARFAddressRange &R : Ranges) { OS << '\n'; OS.indent(Indent); - R.dump(OS, AddressSize, DumpOpts, &Obj); + R.dump(OS, AddressSize); + + DWARFFormValue::dumpAddressSection(Obj, OS, DumpOpts, R.SectionIndex); } } @@ -85,6 +91,9 @@ static void dumpLocation(raw_ostream &OS, DWARFFormValue &FormValue, } if (FormValue.isFormClass(DWARFFormValue::FC_SectionOffset)) { + auto LLDumpOpts = DumpOpts; + LLDumpOpts.Verbose = false; + uint64_t Offset = *FormValue.getAsSectionOffset(); if (FormValue.getForm() == DW_FORM_loclistx) { @@ -95,7 +104,7 @@ static void dumpLocation(raw_ostream &OS, DWARFFormValue &FormValue, return; } U->getLocationTable().dumpLocationList(&Offset, OS, U->getBaseAddress(), - MRI, U, DumpOpts, Indent); + MRI, U, LLDumpOpts, Indent); return; } |

