From 8513cd4c0e577a8b2df17b9d0cda5e0b42273668 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 27 Jun 2018 20:45:11 +0000 Subject: [PATCH] [llvm-objdump] Add -x --all-headers options Reviewers: paulsemel, echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48622 llvm-svn: 335785 --- llvm/tools/llvm-objdump/llvm-objdump.cpp | 9 +++++++++ llvm/tools/llvm-objdump/llvm-objdump.h | 1 + 2 files changed, 10 insertions(+) diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 21d7a21..2edd65b 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -67,6 +67,12 @@ using namespace llvm; using namespace object; +cl::opt + llvm::AllHeaders("all-headers", + cl::desc("Display all available header information")); +static cl::alias AllHeadersShort("x", cl::desc("Alias for --all-headers"), + cl::aliasopt(AllHeaders)); + static cl::list InputFilenames(cl::Positional, cl::desc(""),cl::ZeroOrMore); @@ -2234,6 +2240,9 @@ int main(int argc, char **argv) { if (InputFilenames.size() == 0) InputFilenames.push_back("a.out"); + if (AllHeaders) + PrivateHeaders = Relocations = SectionHeaders = SymbolTable = true; + if (DisassembleAll || PrintSource || PrintLines) Disassemble = true; if (!Disassemble diff --git a/llvm/tools/llvm-objdump/llvm-objdump.h b/llvm/tools/llvm-objdump/llvm-objdump.h index a4df1d9..e8cc83e 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.h +++ b/llvm/tools/llvm-objdump/llvm-objdump.h @@ -32,6 +32,7 @@ extern cl::opt ArchName; extern cl::opt MCPU; extern cl::list MAttrs; extern cl::list FilterSections; +extern cl::opt AllHeaders; extern cl::opt Disassemble; extern cl::opt DisassembleAll; extern cl::opt NoShowRawInsn; -- 2.7.4