summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorIgor Laevsky <igmyrj@gmail.com>2016-01-26 15:09:42 +0000
committerIgor Laevsky <igmyrj@gmail.com>2016-01-26 15:09:42 +0000
commit03a670c0ec1d38de8c206de1426340041f10f8ff (patch)
treefc60c68ea379b07051aacebe7544d0371d8c043c /llvm/tools/llvm-objdump/llvm-objdump.cpp
parentfb619e96864d6bc3359445a2c1b716d508bbfe38 (diff)
downloadbcm5719-llvm-03a670c0ec1d38de8c206de1426340041f10f8ff.tar.gz
bcm5719-llvm-03a670c0ec1d38de8c206de1426340041f10f8ff.zip
Re-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame."
Originally this change was causing failures on windows buildbots. But those problems were fixed in r258806. llvm-svn: 258811
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index d5ae5de4b5a..83ad0e11180 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -22,6 +22,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Triple.h"
#include "llvm/CodeGen/FaultMaps.h"
+#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDisassembler.h"
@@ -181,6 +182,11 @@ cl::opt<bool>
cl::opt<bool> PrintFaultMaps("fault-map-section",
cl::desc("Display contents of faultmap section"));
+cl::opt<DIDumpType> llvm::DwarfDumpType(
+ "dwarf", cl::init(DIDT_Null), cl::desc("Dump of dwarf debug sections:"),
+ cl::values(clEnumValN(DIDT_Frames, "frames", ".debug_frame"),
+ clEnumValEnd));
+
static StringRef ToolName;
namespace {
@@ -1561,6 +1567,11 @@ static void DumpObject(const ObjectFile *o) {
printRawClangAST(o);
if (PrintFaultMaps)
printFaultMaps(o);
+ if (DwarfDumpType != DIDT_Null) {
+ std::unique_ptr<DIContext> DICtx(new DWARFContextInMemory(*o));
+ // Dump the complete DWARF structure.
+ DICtx->dump(outs(), DwarfDumpType, true /* DumpEH */);
+ }
}
/// @brief Dump each object file in \a a;
@@ -1654,7 +1665,8 @@ int main(int argc, char **argv) {
&& !(DylibId && MachOOpt)
&& !(ObjcMetaData && MachOOpt)
&& !(FilterSections.size() != 0 && MachOOpt)
- && !PrintFaultMaps) {
+ && !PrintFaultMaps
+ && DwarfDumpType == DIDT_Null) {
cl::PrintHelpMessage();
return 2;
}
OpenPOWER on IntegriCloud