Skip to content

[dsymutil] Improve missing symbol warning message (#75378) #7933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/test/tools/dsymutil/ARM/extern-alias.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
3 changes: 3 additions & 0 deletions llvm/test/tools/dsymutil/ARM/missing-symbol-warning.test
Original file line number Diff line number Diff line change
@@ -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 }
4 changes: 2 additions & 2 deletions llvm/test/tools/dsymutil/ARM/static-archive-collision.test
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion llvm/test/tools/dsymutil/X86/alias.test
Original file line number Diff line number Diff line change
@@ -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")

Expand Down
4 changes: 2 additions & 2 deletions llvm/test/tools/dsymutil/X86/thinlto.test
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 2 additions & 1 deletion llvm/tools/dsymutil/MachODebugMapParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down