You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating an executable with debug information (-g), we need to run dsymutil afterwards to create the correct debuginformation on macOS.
Not running dsymutil resulted in a strange bug, which could have been very confusing for larger source files.
It happened while working on the LSan testcase.
The source did not contain //CHECK: lines yet. Compiled with -g and ran test. LSan detects memory leak, and reports it is on line 14.
I added //CHECK: lines, effectively changing the line of malloc (i.e. the line on which the leaked memory was allocated).
Reran the testcase. LSan still reported the old line!
Running dsymutil on the executable --> now LSan reports the correct line of malloc.
AFAICT, other compilers all run dsymutil after linking for -g invocations of the compiler (e.g. clang, nim, rustc).
Note it is nice to include an option to turn default running dsymutil off (see: rust-lang/rust#79361).
We invoke clang for linking, so I assume forwarding the -g would be enough? And I guess some -Xcc option could be used to prevent clang from running that extra tool, without introducing any extra Mac-specific cmdline options.
When creating an executable with debug information (
-g
), we need to rundsymutil
afterwards to create the correct debuginformation on macOS.Not running
dsymutil
resulted in a strange bug, which could have been very confusing for larger source files.It happened while working on the LSan testcase.
//CHECK:
lines yet. Compiled with-g
and ran test. LSan detects memory leak, and reports it is on line 14.//CHECK:
lines, effectively changing the line of malloc (i.e. the line on which the leaked memory was allocated).AFAICT, other compilers all run
dsymutil
after linking for-g
invocations of the compiler (e.g. clang, nim, rustc).Note it is nice to include an option to turn default running dsymutil off (see: rust-lang/rust#79361).
Reference: https://stackoverflow.com/a/32299029
The text was updated successfully, but these errors were encountered: