diff options
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r-- | llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp index 07a940b5005..9abc92b7b83 100644 --- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp +++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp @@ -155,17 +155,13 @@ static list<std::string> "attribute) matches the exact text in <name>."), value_desc("name"), cat(DwarfDumpCategory)); static alias NameAlias("n", desc("Alias for -name"), aliasopt(Name)); -static opt<uint64_t> - Lookup("lookup", - desc("Lookup <address> in the debug information and print out any" - "available file, function, block and line table details."), - value_desc("address"), cat(DwarfDumpCategory)); static opt<std::string> OutputFilename("out-file", cl::init(""), - cl::desc("Redirect output to <filename>"), - cl::value_desc("filename"), cat(DwarfDumpCategory)); + cl::desc("Redirect output to the specified file"), + cl::value_desc("filename")); static alias OutputFilenameAlias("o", desc("Alias for -out-file"), - aliasopt(OutputFilename)); + aliasopt(OutputFilename), + cat(DwarfDumpCategory)); static opt<bool> ShowChildren("show-children", desc("Show a debug info entry's children when selectively " @@ -281,44 +277,17 @@ static void filterByName(const StringSet<> &Names, Die.dump(OS, 0, getDumpOpts()); } } - -} - -/// Handle the --lookup option and dump the DIEs and line info for the given -/// address. -static bool lookup(DWARFContext &DICtx, uint64_t Address, raw_ostream &OS) { - auto DIEsForAddr = DICtx.getDIEsForAddress(Lookup); - - if (!DIEsForAddr) - return false; - - DIDumpOptions DumpOpts = getDumpOpts(); - DumpOpts.RecurseDepth = 0; - DIEsForAddr.CompileUnit->dump(OS, DumpOpts); - if (DIEsForAddr.FunctionDIE) { - DIEsForAddr.FunctionDIE.dump(OS, 2, DumpOpts); - if (DIEsForAddr.BlockDIE) - DIEsForAddr.BlockDIE.dump(OS, 4, DumpOpts); - } - - if (DILineInfo LineInfo = DICtx.getLineInfoForAddress(Lookup)) - LineInfo.dump(OS); - - return true; } static bool dumpObjectFile(ObjectFile &Obj, DWARFContext &DICtx, Twine Filename, raw_ostream &OS) { logAllUnhandledErrors(DICtx.loadRegisterInfo(Obj), errs(), Filename.str() + ": "); + // The UUID dump already contains all the same information. if (!(DumpType & DIDT_UUID) || DumpType == DIDT_All) OS << Filename << ":\tfile format " << Obj.getFileFormatName() << '\n'; - // Handle the --lookup option. - if (Lookup) - return lookup(DICtx, Lookup, OS); - // Handle the --name option. if (!Name.empty()) { StringSet<> Names; |