Skip to content
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

lldb: working with debug symbols #6

Open
ruslo opened this issue Aug 19, 2016 · 9 comments
Open

lldb: working with debug symbols #6

ruslo opened this issue Aug 19, 2016 · 9 comments

Comments

@ruslo
Copy link
Owner

ruslo commented Aug 19, 2016

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

@ruslo
Copy link
Owner Author

ruslo commented Aug 19, 2016

/Build

we need to avoid saving full paths while building debug version. -fdebug-prefix-map should help:

@ruslo
Copy link
Owner Author

ruslo commented Aug 19, 2016

/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.

@pretyman
Copy link

pretyman commented Aug 21, 2016

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

@pretyman
Copy link

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=.

@ruslo
Copy link
Owner Author

ruslo commented Aug 22, 2016

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? :)

@pretyman
Copy link

What have you tried to say? :)

Didn't imply anything, just gathering the relevant information in here. ;-)

@pretyman
Copy link

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

👍

@ruslo
Copy link
Owner Author

ruslo commented Aug 22, 2016

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.

@ruslo
Copy link
Owner Author

ruslo commented Aug 22, 2016

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/

@ruslo ruslo mentioned this issue Jan 31, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants