-
Notifications
You must be signed in to change notification settings - Fork 60
Debugger won't find object files on Xcode 16.3- #404
Copy link
Copy link
Closed
Description
After upgrading Xcode to 16.3, I've noticed that the debugger doesn't have any source information.
dsymutil told me that N_OSO is pointing to an object file inside a sandbox that doesn't exist at runtime.
(Tested with apple_support@1.12.1)
$ dsymutil -s bazel-out/darwin_arm64-dbg/bin/exp/a | grep N_OSO
[ 3] 00000034 66 (N_OSO ) 00 0001 0000000068175874 '/private/var/tmp/_bazel_kon/145573fc157b84d695dc97cdf5deb424/sandbox/darwin-sandbox/1390/execroot/_main/bazel-out/darwin_arm64-dbg/bin/exp/_objs/a/a.o'
After some digging, it looks like Xcode 16.3 changed how it handles -oso_prefix linker flag.
Before 16.3, -oso_prefix was stripped after resolving symlinks.
As of 16.3, it's now stripped before resolving symlinks.
You can confirm this by the following repro:
$ /usr/bin/xcrun clang -g -fdebug-prefix-map=${PWD}=. -o a.o -c a.cc
$ ln -s ${PWD}/a.o sub
$ /usr/bin/xcrun clang -Wl,-oso_prefix,${PWD}/ -o a sub/a.o
$ dsymutil -s a | grep N_OSO
Xcode 16.2 prints:
[ 3] 00000024 66 (N_OSO ) 00 0001 000000006817626b 'a.o'
Xcode 16.3 and 16.4 beta prints:
[ 3] 00000024 66 (N_OSO ) 00 0001 0000000068176c8f 'sub/a.o'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels