CGold
CGold copied to clipboard
lldb: working with debug symbols
Migrated from: https://github.com/ruslo/hunter/issues/359#issuecomment-240917420:
lldb [ for OSX mostly, I guess] would require a . lldbinit
file with contents along the lines of:
settings set target.source-map <old-build-directory>/Build <root-id>/Install
in its project directory [ Xcode needs the plugin https://github.com/alloy/lldb-is-it-not for this to work ]. Information from stackoverflow
/Build
we need to avoid saving full paths while building debug version. -fdebug-prefix-map
should help:
- http://stackoverflow.com/a/19290636/2288008
/Install
Should be something like <root-id>/Install/sources/<package>/
. It means on Debug build we should install sources too somewhere. Actually I think CMake has enough information about target to do it. I guess it's only possible solution if we want to leave the packages in original state.
Note: -fdebug-prefix-map
is not available with the clang that comes with Xcode 7.1.1
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
From: http://stackoverflow.com/questions/9607155/make-gcc-put-relative-filenames-in-debug-information
You can use the -fdebug-prefix-map flag to remap the debugging information paths. For example, to make the paths relative to the build location use: -fdebug-prefix-map=/full/build/path=.
Note: -fdebug-prefix-map is not available with the clang that comes with Xcode 7.1.1
What about higher versions?
Actually this may be important in the future. We need to use relative paths to implement reproducible build feature, i.e. when you build same package on different machines it should produce archive with same SHA1 value. Though for now it doesn't produce same SHA1 even for one local machine because of timestamps.
From: http://stackoverflow.com/questions/9607155/make-gcc-put-relative-filenames-in-debug-information You can use the -fdebug-prefix-map flag to remap the debugging information paths. For example, to make the paths relative to the build location use: -fdebug-prefix-map=/full/build/path=.
Yes, this is how it works. What have you tried to say? :)
What have you tried to say? :)
Didn't imply anything, just gathering the relevant information in here. ;-)
What about higher versions?
Seems to be available in clang that comes with Xcode 7.3.1:
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
👍
Didn't imply anything, just gathering the relevant information in here
Okay, no problems. Just want to be sure that I didn't miss anything.
By the way we can keep splitting issues and divide this one into general lldb usage and Xcode integration.
Also here is homepage: http://lldb.llvm.org/