Add command-line flags for DWARF dumping.

Flags for dumping specific DWARF sections added in lib/DebugInfo and
llvm-dwarfdump.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173480 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Bendersky
2013-01-25 20:26:43 +00:00
parent 3b6a5eefe0
commit 939a4e8b69
5 changed files with 131 additions and 65 deletions

View File

@@ -52,6 +52,23 @@ static cl::opt<bool>
PrintInlining("inlining", cl::init(false),
cl::desc("Print all inlined frames for a given address"));
static cl::opt<DIDumpType>
DumpType("debug-dump", cl::init(DIDT_All),
cl::desc("Dump of debug sections:"),
cl::values(
clEnumValN(DIDT_All, "all", "Dump all debug sections"),
clEnumValN(DIDT_Abbrev, "abbrev", ".debug_abbrev"),
clEnumValN(DIDT_AbbrevDwo, "abbrev.dwo", ".debug_abbrev.dwo"),
clEnumValN(DIDT_Aranges, "aranges", ".debug_aranges"),
clEnumValN(DIDT_Info, "info", ".debug_info"),
clEnumValN(DIDT_InfoDwo, "info.dwo", ".debug_info.dwo"),
clEnumValN(DIDT_Line, "line", ".debug_line"),
clEnumValN(DIDT_Ranges, "ranges", ".debug_ranges"),
clEnumValN(DIDT_Str, "str", ".debug_str"),
clEnumValN(DIDT_StrDwo, "str.dwo", ".debug_str.dwo"),
clEnumValN(DIDT_StrOffsetsDwo, "str_offsets.dwo", ".debug_str_offsets.dwo"),
clEnumValEnd));
static void PrintDILineInfo(DILineInfo dli) {
if (PrintFunctions)
outs() << (dli.getFunctionName() ? dli.getFunctionName() : "<unknown>")
@@ -75,7 +92,7 @@ static void DumpInput(const StringRef &Filename) {
outs() << Filename
<< ":\tfile format " << Obj->getFileFormatName() << "\n\n";
// Dump the complete DWARF structure.
DICtx->dump(outs());
DICtx->dump(outs(), DumpType);
} else {
// Print line info for the specified address.
int SpecFlags = DILineInfoSpecifier::FileLineInfo |