summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-09-13 18:22:59 +0000
committerAdrian Prantl <aprantl@apple.com>2017-09-13 18:22:59 +0000
commit3dcd122151ee58afc5f7f262c890bbfdbf47b08c (patch)
treee9bed3a2f0d8cf0b688c8f6a553cab03601181b5 /llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
parentfb1baef1c0f28a2ad9071843e2b620e2ee30aaf6 (diff)
downloadbcm5719-llvm-3dcd122151ee58afc5f7f262c890bbfdbf47b08c.tar.gz
bcm5719-llvm-3dcd122151ee58afc5f7f262c890bbfdbf47b08c.zip
llvm-dwarfdump: support dumping UUIDs of Mach-O binaries.
This is a feature supported by Darwin dwarfdump. UUIDs are used to associate executables with their .dSYM bundles. llvm-svn: 313165
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 39d207b8d58..8508982ab39 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -60,6 +60,9 @@ static uint64_t DumpType = DIDT_Null;
cat(SectionCategory));
#include "llvm/BinaryFormat/Dwarf.def"
#undef HANDLE_DWARF_SECTION
+static opt<bool> DumpUUID("uuid", desc("Show the UUID for each architecture"),
+ cat(DwarfDumpCategory));
+static alias DumpUUIDAlias("u", desc("Alias for -uuid"), aliasopt(DumpUUID));
static opt<bool>
SummarizeTypes("summarize-types",
@@ -94,10 +97,10 @@ static void DumpObjectFile(ObjectFile &Obj, Twine Filename) {
std::unique_ptr<DWARFContext> DICtx = DWARFContext::create(Obj);
logAllUnhandledErrors(DICtx->loadRegisterInfo(Obj), errs(),
Filename.str() + ": ");
-
- outs() << Filename.str() << ":\tfile format " << Obj.getFileFormatName()
- << "\n\n";
-
+ // The UUID dump already contains all the same information.
+ if (!(DumpType & DIDT_UUID) || DumpType == DIDT_All)
+ outs() << Filename << ":\tfile format " << Obj.getFileFormatName()
+ << "\n\n";
// Dump the complete DWARF structure.
DICtx->dump(outs(), GetDumpOpts());
@@ -225,6 +228,8 @@ int main(int argc, char **argv) {
DumpType |= DIDT_##ENUM_NAME;
#include "llvm/BinaryFormat/Dwarf.def"
#undef HANDLE_DWARF_SECTION
+ if (DumpUUID)
+ DumpType |= DIDT_UUID;
if (DumpAll)
DumpType = DIDT_All;
if (DumpType == DIDT_Null) {
OpenPOWER on IntegriCloud