diff --git a/llvm/test/tools/dsymutil/ARM/extern-alias.test b/llvm/test/tools/dsymutil/ARM/extern-alias.test index cb459fbd66289..60f7708afe2a3 100644 --- a/llvm/test/tools/dsymutil/ARM/extern-alias.test +++ b/llvm/test/tools/dsymutil/ARM/extern-alias.test @@ -37,6 +37,6 @@ $ xcrun --sdk iphoneos clang private_extern.o main.o -target arm64-apple-ios14.0 RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/private_extern/private_extern.out -o %t.dSYM --verbose | FileCheck %s RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/extern/extern.out -o %t.dSYM --verbose | FileCheck %s -CHECK-NOT: could not find object file symbol for symbol _baz +CHECK-NOT: could not find symbol '_baz' CHECK: { sym: _baz, objAddr: 0x0, binAddr: 0x100007F58, size: 0x0 } CHECK: { sym: _foo, objAddr: 0x0, binAddr: 0x100007F58, size: 0x20 } diff --git a/llvm/test/tools/dsymutil/ARM/missing-symbol-warning.test b/llvm/test/tools/dsymutil/ARM/missing-symbol-warning.test new file mode 100644 index 0000000000000..1de805d321953 --- /dev/null +++ b/llvm/test/tools/dsymutil/ARM/missing-symbol-warning.test @@ -0,0 +1,3 @@ +RUN: dsymutil -oso-prepend-path %p/../Inputs --dump-debug-map %p/../Inputs/private/tmp/warning/test.out 2>&1 | FileCheck %s +# CHECK: could not find symbol '_foo' in object file '{{.*}}test.o' +# CHECK: { sym: _main, objAddr: 0x0, binAddr: 0x100003F84, size: 0x1C } diff --git a/llvm/test/tools/dsymutil/ARM/static-archive-collision.test b/llvm/test/tools/dsymutil/ARM/static-archive-collision.test index 7182f0917d897..55fd5e6b621e7 100644 --- a/llvm/test/tools/dsymutil/ARM/static-archive-collision.test +++ b/llvm/test/tools/dsymutil/ARM/static-archive-collision.test @@ -22,5 +22,5 @@ $ clang main.o foo.a -o main.out RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/collision/main.out --dump-debug-map 2>&1 | FileCheck %s CHECK: skipping debug map object with duplicate name and timestamp: {{.*}} /private/tmp/collision/foo.a(foo.o) -CHECK-NOT: could not find object file symbol for symbol _g -CHECK-NOT: could not find object file symbol for symbol _f +CHECK-NOT: could not find symbol '_g' +CHECK-NOT: could not find symbol '_f' diff --git a/llvm/test/tools/dsymutil/Inputs/private/tmp/warning/test.o b/llvm/test/tools/dsymutil/Inputs/private/tmp/warning/test.o new file mode 100644 index 0000000000000..53647992d70c9 Binary files /dev/null and b/llvm/test/tools/dsymutil/Inputs/private/tmp/warning/test.o differ diff --git a/llvm/test/tools/dsymutil/Inputs/private/tmp/warning/test.out b/llvm/test/tools/dsymutil/Inputs/private/tmp/warning/test.out new file mode 100755 index 0000000000000..bfd5c74f4a1dd Binary files /dev/null and b/llvm/test/tools/dsymutil/Inputs/private/tmp/warning/test.out differ diff --git a/llvm/test/tools/dsymutil/X86/alias.test b/llvm/test/tools/dsymutil/X86/alias.test index 2e56ba5719b15..6d385eebc07cd 100644 --- a/llvm/test/tools/dsymutil/X86/alias.test +++ b/llvm/test/tools/dsymutil/X86/alias.test @@ -1,6 +1,6 @@ # RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/alias \ # RUN: %p/../Inputs/alias/foobar -o - | llvm-dwarfdump - 2>&1 | FileCheck %s -# CHECK-NOT: could not find object file symbol for symbol +# CHECK-NOT: could not find symbol # CHECK: DW_AT_name ("foo.c") # CHECK: DW_AT_name ("bar.c") diff --git a/llvm/test/tools/dsymutil/X86/thinlto.test b/llvm/test/tools/dsymutil/X86/thinlto.test index ebd4068a5c127..650b8f408b635 100644 --- a/llvm/test/tools/dsymutil/X86/thinlto.test +++ b/llvm/test/tools/dsymutil/X86/thinlto.test @@ -20,5 +20,5 @@ $ xcrun clang++ -g -flto=thin -O2 foo.cpp bar.cpp -c $ xcrun clang++ -flto=thin foo.o bar.o -Xlinker -object_path_lto -Xlinker lto -shared -o foobar.dylib RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/thinlto/foobar.dylib -o %t.dSYM 2>&1 | FileCheck %s --allow-empty -CHECK-NOT: could not find object file symbol for symbol __ZZ9function2vE12magic_static -CHECK-NOT: could not find object file symbol for symbol __ZGVZ9function2vE12magic_static +CHECK-NOT: could not find symbol '__ZZ9function2vE12magic_static' +CHECK-NOT: could not find symbol 'symbol __ZGVZ9function2vE12magic_static' diff --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp b/llvm/tools/dsymutil/MachODebugMapParser.cpp index 9623b71714582..8d00273ae6668 100644 --- a/llvm/tools/dsymutil/MachODebugMapParser.cpp +++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp @@ -729,7 +729,8 @@ void MachODebugMapParser::handleStabSymbolTableEntry( } if (ObjectSymIt == CurrentObjectAddresses.end()) { - Warning("could not find object file symbol for symbol " + Twine(Name)); + Warning("could not find symbol '" + Twine(Name) + "' in object file '" + + CurrentDebugMapObject->getObjectFilename() + "'"); return; }