[llvm] r326994 - [dsymutil] Embed toolchain in dSYM bundle
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 8 02:39:12 PST 2018
Author: jdevlieghere
Date: Thu Mar 8 02:39:12 2018
New Revision: 326994
URL: http://llvm.org/viewvc/llvm-project?rev=326994&view=rev
Log:
[dsymutil] Embed toolchain in dSYM bundle
Allow us to embed the (Xcode) toolchain in the dSYM bundle's property
list.
Differential revision: https://reviews.llvm.org/D44151
Modified:
llvm/trunk/docs/CommandGuide/dsymutil.rst
llvm/trunk/test/tools/dsymutil/X86/darwin-bundle.test
llvm/trunk/test/tools/dsymutil/cmdline.test
llvm/trunk/tools/dsymutil/dsymutil.cpp
Modified: llvm/trunk/docs/CommandGuide/dsymutil.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/dsymutil.rst?rev=326994&r1=326993&r2=326994&view=diff
==============================================================================
--- llvm/trunk/docs/CommandGuide/dsymutil.rst (original)
+++ llvm/trunk/docs/CommandGuide/dsymutil.rst Thu Mar 8 02:39:12 2018
@@ -74,6 +74,10 @@ OPTIONS
Dumps the symbol table found in *executable* or object file(s) and exits.
+.. option:: --toolchain
+
+ Embed the toolchain in the dSYM bundle's property list.
+
.. option:: -u, --update
Update an existing dSYM file to contain the latest accelerator tables and
Modified: llvm/trunk/test/tools/dsymutil/X86/darwin-bundle.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/X86/darwin-bundle.test?rev=326994&r1=326993&r2=326994&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/X86/darwin-bundle.test (original)
+++ llvm/trunk/test/tools/dsymutil/X86/darwin-bundle.test Thu Mar 8 02:39:12 2018
@@ -8,6 +8,9 @@ RUN: cat %p/../Inputs/Info.plist > %t/In
RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 -o %t/dsymdest/basic.macho.x86_64.dSYM
RUN: FileCheck %s --input-file %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist
+RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t/basic.macho.x86_64 -toolchain "toolchain" -o %t/dsymdest/basic.macho.x86_64.dSYM
+RUN: FileCheck %s --input-file %t/dsymdest/basic.macho.x86_64.dSYM/Contents/Info.plist --check-prefix=CHECK --check-prefix=TOOLCHAIN
+
CHECK: <?xml version="1.0" encoding="UTF-8"?>
CHECK-NEXT: <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
CHECK-NEXT: <plist version="1.0">
@@ -26,5 +29,7 @@ CHECK-NEXT: <key>CFBundl
CHECK-NEXT: <string>2.0</string>
CHECK-NEXT: <key>CFBundleVersion</key>
CHECK-NEXT: <string>2</string>
-CHECK-NEXT: </dict>
+TOOLCHAIN: <key>Toolchain</key>
+TOOLCHAIN-NEXT: <string>toolchain</string>
+CHECK: </dict>
CHECK-NEXT: </plist>
Modified: llvm/trunk/test/tools/dsymutil/cmdline.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/dsymutil/cmdline.test?rev=326994&r1=326993&r2=326994&view=diff
==============================================================================
--- llvm/trunk/test/tools/dsymutil/cmdline.test (original)
+++ llvm/trunk/test/tools/dsymutil/cmdline.test Thu Mar 8 02:39:12 2018
@@ -14,6 +14,7 @@ HELP: -num-threads=<n>
HELP: -o=<filename>
HELP: -oso-prepend-path=<path>
HELP: -symtab
+HELP: -toolchain
HELP: -update
HELP: -verbose
HELP: -verify
Modified: llvm/trunk/tools/dsymutil/dsymutil.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/dsymutil.cpp?rev=326994&r1=326993&r2=326994&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/dsymutil.cpp (original)
+++ llvm/trunk/tools/dsymutil/dsymutil.cpp Thu Mar 8 02:39:12 2018
@@ -142,6 +142,10 @@ static opt<bool> InputIsYAMLDebugMap(
static opt<bool> Verify("verify", desc("Verify the linked DWARF debug info."),
cat(DsymCategory));
+static opt<std::string>
+ Toolchain("toolchain", desc("Embed toolchain information in dSYM bundle."),
+ cat(DsymCategory));
+
static bool createPlistFile(llvm::StringRef Bin, llvm::StringRef BundleRoot) {
if (NoOutput)
return true;
@@ -189,8 +193,13 @@ static bool createPlistFile(llvm::String
<< "\t\t<string>" << BI.ShortVersionStr << "</string>\n";
PL << "\t\t<key>CFBundleVersion</key>\n"
- << "\t\t<string>" << BI.VersionStr << "</string>\n"
- << "\t</dict>\n"
+ << "\t\t<string>" << BI.VersionStr << "</string>\n";
+
+ if (!Toolchain.empty())
+ PL << "\t\t<key>Toolchain</key>\n"
+ << "\t\t<string>" << Toolchain << "</string>\n";
+
+ PL << "\t</dict>\n"
<< "</plist>\n";
PL.close();
More information about the llvm-commits
mailing list