diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-09-20 17:44:00 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-09-20 17:44:00 +0000 |
commit | d3f9f2138d953025cf46720138ee41dd567e5b4d (patch) | |
tree | 57f159b25464655b5e4eddef36f9f725ec6f5d9b /llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | |
parent | 8b250344e9bbf2d61c329cef7d5ee90b7a9cd44f (diff) | |
download | bcm5719-llvm-d3f9f2138d953025cf46720138ee41dd567e5b4d.tar.gz bcm5719-llvm-d3f9f2138d953025cf46720138ee41dd567e5b4d.zip |
llvm-dwarfdump: implement --recurse-depth=<N>
This patch implements the Darwin dwarfdump option --recurse-depth=<N>,
which limits the recursion depth when selectively printing DIEs at an
offset.
Differential Revision: https://reviews.llvm.org/D38064
llvm-svn: 313778
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r-- | llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp index 61d77aa76f4..aba59d0d5b9 100644 --- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp +++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp @@ -144,6 +144,13 @@ static opt<bool> cat(DwarfDumpCategory)); static alias ShowParentsAlias("p", desc("Alias for -show-parents"), aliasopt(ShowParents)); +static opt<unsigned> RecurseDepth( + "recurse-depth", + desc("Only recurse to a depth of N when displaying debug info entries."), + cat(DwarfDumpCategory), init(-1U), value_desc("N")); +static alias RecurseDepthAlias("r", desc("Alias for -recurse-depth"), + aliasopt(RecurseDepth)); + static opt<bool> SummarizeTypes("summarize-types", desc("Abbreviate the description of type unit entries"), @@ -172,10 +179,14 @@ static void error(StringRef Filename, std::error_code EC) { static DIDumpOptions getDumpOpts() { DIDumpOptions DumpOpts; DumpOpts.DumpType = DumpType; + DumpOpts.RecurseDepth = RecurseDepth; DumpOpts.ShowChildren = ShowChildren; DumpOpts.ShowParents = ShowParents; DumpOpts.SummarizeTypes = SummarizeTypes; DumpOpts.Verbose = Verbose; + // In -verify mode, print DIEs without children in error messages. + if (Verify) + return DumpOpts.noImplicitRecursion(); return DumpOpts; } |