Skip to content

Commit 22c7b7d

Browse files
authored
Merge pull request swiftlang#7933 from apple/jdevlieghere/590001431b44
[dsymutil] Improve missing symbol warning message (llvm#75378)
2 parents 8f2c0c3 + 46218f6 commit 22c7b7d

File tree

8 files changed

+11
-7
lines changed

8 files changed

+11
-7
lines changed

llvm/test/tools/dsymutil/ARM/extern-alias.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ $ xcrun --sdk iphoneos clang private_extern.o main.o -target arm64-apple-ios14.0
3737

3838
RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/private_extern/private_extern.out -o %t.dSYM --verbose | FileCheck %s
3939
RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/extern/extern.out -o %t.dSYM --verbose | FileCheck %s
40-
CHECK-NOT: could not find object file symbol for symbol _baz
40+
CHECK-NOT: could not find symbol '_baz'
4141
CHECK: { sym: _baz, objAddr: 0x0, binAddr: 0x100007F58, size: 0x0 }
4242
CHECK: { sym: _foo, objAddr: 0x0, binAddr: 0x100007F58, size: 0x20 }
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RUN: dsymutil -oso-prepend-path %p/../Inputs --dump-debug-map %p/../Inputs/private/tmp/warning/test.out 2>&1 | FileCheck %s
2+
# CHECK: could not find symbol '_foo' in object file '{{.*}}test.o'
3+
# CHECK: { sym: _main, objAddr: 0x0, binAddr: 0x100003F84, size: 0x1C }

llvm/test/tools/dsymutil/ARM/static-archive-collision.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ $ clang main.o foo.a -o main.out
2222

2323
RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/collision/main.out --dump-debug-map 2>&1 | FileCheck %s
2424
CHECK: skipping debug map object with duplicate name and timestamp: {{.*}} /private/tmp/collision/foo.a(foo.o)
25-
CHECK-NOT: could not find object file symbol for symbol _g
26-
CHECK-NOT: could not find object file symbol for symbol _f
25+
CHECK-NOT: could not find symbol '_g'
26+
CHECK-NOT: could not find symbol '_f'
Binary file not shown.
Binary file not shown.

llvm/test/tools/dsymutil/X86/alias.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/alias \
22
# RUN: %p/../Inputs/alias/foobar -o - | llvm-dwarfdump - 2>&1 | FileCheck %s
3-
# CHECK-NOT: could not find object file symbol for symbol
3+
# CHECK-NOT: could not find symbol
44
# CHECK: DW_AT_name ("foo.c")
55
# CHECK: DW_AT_name ("bar.c")
66

llvm/test/tools/dsymutil/X86/thinlto.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ $ xcrun clang++ -g -flto=thin -O2 foo.cpp bar.cpp -c
2020
$ xcrun clang++ -flto=thin foo.o bar.o -Xlinker -object_path_lto -Xlinker lto -shared -o foobar.dylib
2121

2222
RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/thinlto/foobar.dylib -o %t.dSYM 2>&1 | FileCheck %s --allow-empty
23-
CHECK-NOT: could not find object file symbol for symbol __ZZ9function2vE12magic_static
24-
CHECK-NOT: could not find object file symbol for symbol __ZGVZ9function2vE12magic_static
23+
CHECK-NOT: could not find symbol '__ZZ9function2vE12magic_static'
24+
CHECK-NOT: could not find symbol 'symbol __ZGVZ9function2vE12magic_static'

llvm/tools/dsymutil/MachODebugMapParser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,8 @@ void MachODebugMapParser::handleStabSymbolTableEntry(
729729
}
730730

731731
if (ObjectSymIt == CurrentObjectAddresses.end()) {
732-
Warning("could not find object file symbol for symbol " + Twine(Name));
732+
Warning("could not find symbol '" + Twine(Name) + "' in object file '" +
733+
CurrentDebugMapObject->getObjectFilename() + "'");
733734
return;
734735
}
735736

0 commit comments

Comments
 (0)