1RUN: dsymutil -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic.macho.x86_64 | FileCheck %s 2RUN: dsymutil -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic-lto.macho.x86_64 | FileCheck %s --check-prefix=CHECK-LTO 3RUN: dsymutil -verbose -dump-debug-map -oso-prepend-path=%p %p/Inputs/basic-archive.macho.x86_64 2>&1 | FileCheck %s --check-prefix=CHECK-ARCHIVE 4RUN: dsymutil -dump-debug-map %p/Inputs/basic.macho.x86_64 2>&1 | FileCheck %s --check-prefix=NOT-FOUND 5RUN: not dsymutil -dump-debug-map %p/Inputs/inexistant 2>&1 | FileCheck %s --check-prefix=NO-EXECUTABLE 6 7 8Check that We can parse the debug map of the basic executable. 9 10CHECK-NOT: error 11CHECK: --- 12CHECK: triple: 'x86_64-apple-darwin' 13CHECK: binary-path:{{.*}}/Inputs/basic.macho.x86_64 14CHECK: filename:{{.*}}/Inputs/basic1.macho.x86_64.o 15CHECK-DAG: sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000EA0, size: 0x00000024 16CHECK: filename{{.*}}/Inputs/basic2.macho.x86_64.o 17CHECK-DAG: sym: _baz, objAddr: 0x0000000000000310, binAddr: 0x0000000100001000, size: 0x00000000 18CHECK-DAG: sym: _foo, objAddr: 0x0000000000000020, binAddr: 0x0000000100000ED0, size: 0x00000050 19CHECK-DAG: sym: _inc, objAddr: 0x0000000000000070, binAddr: 0x0000000100000F20, size: 0x00000017 20CHECK-DAG: sym: _private_int, objAddr: 0x0000000000000560, binAddr: 0x0000000100001008, size: 0x00000000 21CHECK: filename{{.*}}/Inputs/basic3.macho.x86_64.o 22CHECK-DAG: sym: _bar, objAddr: 0x0000000000000020, binAddr: 0x0000000100000F40, size: 0x00000050 23CHECK-DAG: sym: _inc, objAddr: 0x0000000000000070, binAddr: 0x0000000100000F90, size: 0x00000019 24CHECK-DAG: sym: _val, binAddr: 0x0000000100001004, size: 0x00000000 25CHECK: ... 26 27 28Check that we can parse the debug-map of the basic-lto executable 29 30CHECK-LTO-NOT: error 31CHECK-LTO: --- 32CHECK-LTO: triple: 'x86_64-apple-darwin' 33CHECK-LTO: binary-path:{{.*}}/Inputs/basic-lto.macho.x86_64 34CHECK-LTO: /Inputs/basic-lto.macho.x86_64.o 35CHECK-LTO-DAG: sym: _bar, objAddr: 0x0000000000000050, binAddr: 0x0000000100000F90, size: 0x00000024 36CHECK-LTO-DAG: sym: _baz, objAddr: 0x0000000000000658, binAddr: 0x0000000100001000, size: 0x00000000 37CHECK-LTO-DAG: sym: _foo, objAddr: 0x0000000000000010, binAddr: 0x0000000100000F50, size: 0x00000040 38CHECK-LTO-DAG: sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000F40, size: 0x00000010 39CHECK-LTO-DAG: sym: _private_int, objAddr: 0x00000000000008E8, binAddr: 0x0000000100001008, size: 0x00000000 40CHECK-LTO-DAG: sym: _val, objAddr: 0x00000000000008EC, binAddr: 0x0000000100001004, size: 0x00000000 41CHECK-LTO: ... 42 43Check thet we correctly handle debug maps with archive members (including only 44opening the archive once if mulitple of its members are used). 45 46CHECK-ARCHIVE: trying to open {{.*}}basic-archive.macho.x86_64' 47CHECK-ARCHIVE-NEXT: loaded object. 48CHECK-ARCHIVE-NEXT: trying to open {{.*}}/Inputs/basic1.macho.x86_64.o' 49CHECK-ARCHIVE-NEXT: loaded object. 50CHECK-ARCHIVE-NEXT: trying to open {{.*}}/libbasic.a(basic2.macho.x86_64.o)' 51CHECK-ARCHIVE-NEXT: loaded archive {{.*}}/libbasic.a' 52CHECK-ARCHIVE-NEXT: found member in archive. 53CHECK-ARCHIVE-NEXT: trying to open {{.*}}/libbasic.a(basic3.macho.x86_64.o)' 54CHECK-ARCHIVE-NEXT: found member in archive. 55CHECK-ARCHIVE: --- 56CHECK-ARCHIVE: triple: 'x86_64-apple-darwin' 57CHECK-ARCHIVE: binary-path:{{.*}}/Inputs/basic-archive.macho.x86_64 58CHECK-ARCHIVE: /Inputs/basic1.macho.x86_64.o 59CHECK-ARCHIVE-DAG: sym: _main, objAddr: 0x0000000000000000, binAddr: 0x0000000100000EA0, size: 0x00000024 60CHECK-ARCHIVE: /Inputs/./libbasic.a(basic2.macho.x86_64.o) 61CHECK-ARCHIVE-DAG: sym: _baz, objAddr: 0x0000000000000310, binAddr: 0x0000000100001000, size: 0x00000000 62CHECK-ARCHIVE-DAG: sym: _foo, objAddr: 0x0000000000000020, binAddr: 0x0000000100000ED0, size: 0x00000050 63CHECK-ARCHIVE-DAG: sym: _inc, objAddr: 0x0000000000000070, binAddr: 0x0000000100000F20, size: 0x00000017 64CHECK-ARCHIVE-DAG: sym: _private_int, objAddr: 0x0000000000000560, binAddr: 0x0000000100001004, size: 0x00000000 65CHECK-ARCHIVE: /Inputs/./libbasic.a(basic3.macho.x86_64.o) 66CHECK-ARCHIVE-DAG: sym: _bar, objAddr: 0x0000000000000020, binAddr: 0x0000000100000F40, size: 0x00000050 67CHECK-ARCHIVE-DAG: sym: _inc, objAddr: 0x0000000000000070, binAddr: 0x0000000100000F90, size: 0x00000019 68CHECK-ARCHIVE-DAG: sym: _val, binAddr: 0x0000000100001008, size: 0x00000000 69CHECK-ARCHIVE: ... 70 71Check that we warn about missing object files (this presumes that the files aren't 72present in the machine's /Inputs/ folder, which should be a pretty safe bet). 73 74warning: (x86_64) /Inputs/basic1.macho.x86_64.o unable to open object file: 75NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic1.macho.x86_64.o unable to open object file: {{[Nn]o}} such file 76NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic2.macho.x86_64.o unable to open object file: {{[Nn]o}} such file 77NOT-FOUND: warning: (x86_64) {{.*}}/Inputs/basic3.macho.x86_64.o unable to open object file: {{[Nn]o}} such file 78NOT-FOUND: --- 79NOT-FOUND-NEXT: triple: 'x86_64-apple-darwin' 80NOT-FOUND-NEXT: binary-path:{{.*}}/Inputs/basic.macho.x86_64 81NOT-FOUND-NEXT: ... 82 83Check that we correctly error out on invalid executable. 84 85NO-EXECUTABLE: cannot parse{{.*}}/inexistant': {{[Nn]o}} such file 86NO-EXECUTABLE-NOT: --- 87