llvm.org GIT mirror llvm / e88f2f3
[dsymutil] Add (unimplemented) --flat option dsymutil should by default generate dSYM bundles which are filesystem hierarchies containing the debug info and an additional Info.plist. Currently llvm-dsymutil emits raw binaries containing the debug info. This is what we call the 'flat mode'. Add a -f/-flat option that is supposed to enable that flat mode, but don't wire it for now, only pass it to the tests that will need it to stay functional once we do bundle generation by default. This basically makes this commit NFC and removes the noise from the actual commit that adds support for bundle generation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244269 91177308-0d34-0410-b5e6-96231b3b80d8 Frederic Riss 5 years ago
13 changed file(s) with 31 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
0 # REQUIRES: object-emission
1 # RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - 2>&1 | FileCheck %s
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - 2>&1 | FileCheck %s
22
33 ---
44 triple: 'armv7-apple-darwin'
0 REQUIRES: shell
11 RUN: cat %p/../Inputs/basic.macho.x86_64 > %t1
2 RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t1
2 RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %t1
33 RUN: llvm-dwarfdump %t1.dwarf | FileCheck %s
4 RUN: llvm-dsymutil -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
4 RUN: llvm-dsymutil -f -o %t2 -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64
55 RUN: llvm-dwarfdump %t2 | FileCheck %s
6 RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
7 RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
8 RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dsymutil -y -o - - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
9 RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dsymutil -o - -y - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
6 RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
7 RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
8 RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 | llvm-dsymutil -f -y -o - - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=BASIC
9 RUN: llvm-dsymutil -dump-debug-map -oso-prepend-path=%p/.. %p/../Inputs/basic-archive.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump - | FileCheck %s --check-prefix=CHECK --check-prefix=ARCHIVE
1010
1111 CHECK: file format Mach-O 64-bit x86-64
1212
0 REQUIRES: shell
1 RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
1 RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto-dw4.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
22
33 CHECK: file format Mach-O 64-bit x86-64
44
0 REQUIRES: shell
1 RUN: llvm-dsymutil -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
2 RUN: llvm-dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | llvm-dsymutil -o - -y - | llvm-dwarfdump - | FileCheck %s
1 RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
2 RUN: llvm-dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump - | FileCheck %s
33
44 CHECK: file format Mach-O 64-bit x86-64
55
0 # REQUIRES: object-emission
1 # RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
22
33 ---
44 triple: 'i386-apple-darwin'
0 # REQUIRES: object-emission
1 # RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
22
33 ---
44 triple: 'x86_64-apple-darwin'
0 # REQUIRES: object-emission
1 # RUN: llvm-dsymutil -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
1 # RUN: llvm-dsymutil -f -oso-prepend-path=%p/../Inputs -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
22
33 ---
44 triple: 'x86_64h-apple-darwin'
11 # RUN: rm -rf %t
22 # RUN: mkdir -p %t
33 # RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o
4 # RUN: llvm-dsymutil -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
4 # RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
55
66 # This test is meant to verify that identical CIEs will get reused
77 # in the same file but also inbetween files. For this to happen, we
22 # RUN: mkdir -p %t
33 # RUN: llc -filetype=obj %p/../Inputs/frame-dw2.ll -o %t/frame-dw2.o
44 # RUN: llc -filetype=obj %p/../Inputs/frame-dw4.ll -o %t/frame-dw4.o
5 # RUN: llvm-dsymutil -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
5 # RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=frames - | FileCheck %s
66
77 # Check the handling of multiple different CIEs. To have CIEs that
88 # appear to be different, use a dwarf2 version of the file along with
22 RUN: cat %p/../Inputs/basic-archive.macho.x86_64 > %t2
33 RUN: cat %p/../Inputs/basic-lto.macho.x86_64 > %t3
44 RUN: cat %p/../Inputs/basic-lto-dw4.macho.x86_64 > %t4
5 RUN: llvm-dsymutil -oso-prepend-path=%p/.. %t1 %t2 %t3 %t4
5 RUN: llvm-dsymutil -f -oso-prepend-path=%p/.. %t1 %t2 %t3 %t4
66 RUN: llvm-dwarfdump %t1.dwarf \
77 RUN: | FileCheck %S/basic-linking-x86.test --check-prefix=CHECK --check-prefix=BASIC
88 RUN: llvm-dwarfdump %t2.dwarf \
77 # RUN: llc -filetype=obj %p/../Inputs/odr5.ll -o %t/odr5.o
88 # RUN: llc -filetype=obj %p/../Inputs/odr6.ll -o %t/odr6.o
99 # RUN: llc -filetype=obj %p/../Inputs/odr7.ll -o %t/odr7.o
10 # RUN: llvm-dsymutil -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=ODR -check-prefix=CHECK %s
11 # RUN: llvm-dsymutil -oso-prepend-path=%t -y %s -no-odr -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=NOODR -check-prefix=CHECK %s
10 # RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=ODR -check-prefix=CHECK %s
11 # RUN: llvm-dsymutil -f -oso-prepend-path=%t -y %s -no-odr -o - | llvm-dwarfdump -debug-dump=info - | FileCheck -check-prefix=NOODR -check-prefix=CHECK %s
1212
1313 # Totally made up debug map to test ODR uniquing
1414
None RUN: llvm-dsymutil -verbose -no-output %p/Inputs/fat-test.dylib -oso-prepend-path %p | FileCheck %s
0 RUN: llvm-dsymutil -f -verbose -no-output %p/Inputs/fat-test.dylib -oso-prepend-path %p | FileCheck %s
11
22 This test doesn't produce any filesytstem output, we just look at the verbose
33 log output.
4646 desc("Specify a directory to prepend to the paths of object files."),
4747 value_desc("path"), cat(DsymCategory));
4848
49 static opt FlatOut("flat",
50 desc("Produce a flat dSYM file (not a bundle)."),
51 init(false), cat(DsymCategory));
52 static alias FlatOutA("f", desc("Alias for --flat"), aliasopt(FlatOut));
53
4954 static opt Verbose("verbose", desc("Verbosity level"), init(false),
5055 cat(DsymCategory));
5156
155160 llvm::InitializeAllTargets();
156161 llvm::InitializeAllAsmPrinters();
157162
158 if (InputFiles.size() > 1 && !OutputFileOpt.empty()) {
159 llvm::errs() << "error: cannot use -o with multiple inputs\n";
163 if (!FlatOut && OutputFileOpt == "-") {
164 llvm::errs() << "error: cannot emit to standard output without --flat\n";
165 return 1;
166 }
167
168 if (InputFiles.size() > 1 && FlatOut && !OutputFileOpt.empty()) {
169 llvm::errs() << "error: cannot use -o with multiple inputs in flat mode\n";
160170 return 1;
161171 }
162172