diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-09-16 17:28:00 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-09-16 17:28:00 +0000 |
commit | 597aa48d119c0b489efaa638ea5c66e1151aabd8 (patch) | |
tree | 1fe1184d89056735266adbe103b5a5f011ad703b /llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | |
parent | 099d7e452a68ca43de6231ff8b19f14b84ce61ca (diff) | |
download | bcm5719-llvm-597aa48d119c0b489efaa638ea5c66e1151aabd8.tar.gz bcm5719-llvm-597aa48d119c0b489efaa638ea5c66e1151aabd8.zip |
llvm-dwarfdump: support a --show-children option
This will print all children of a DIE when selectively printing only
one DIE at a given offset.
llvm-svn: 313464
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFContext.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index 02d37f21c38..373452a9278 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -223,6 +223,8 @@ void DWARFContext::dump( Optional<uint64_t> DumpOffset; uint64_t DumpType = DumpOpts.DumpType; bool DumpEH = DumpOpts.DumpEH; + unsigned RecDepth = + DumpOpts.ShowChildren ? std::numeric_limits<unsigned>::max() : 0; StringRef Extension = sys::path::extension(DObj->getFileName()); bool IsDWO = (Extension == ".dwo") || (Extension == ".dwp"); @@ -260,7 +262,7 @@ void DWARFContext::dump( if (shouldDump(IsExplicit, Name, DIDT_ID_DebugInfo, Section.Data)) { for (const auto &CU : CUs) if (DumpOffset) - CU->getDIEForOffset(DumpOffset.getValue()).dump(OS, 0); + CU->getDIEForOffset(DumpOffset.getValue()).dump(OS, RecDepth); else CU->dump(OS, DumpOpts); } @@ -277,7 +279,7 @@ void DWARFContext::dump( for (const auto &TUS : TUSections) for (const auto &TU : TUS) if (DumpOffset) - TU->getDIEForOffset(*DumpOffset).dump(OS, 0); + TU->getDIEForOffset(*DumpOffset).dump(OS, RecDepth); else TU->dump(OS, DumpOpts); }; |