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

Use the path of the original file to find the debuglink destination #38

Merged
merged 1 commit into from
Mar 25, 2023

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Mar 25, 2023

As defined in https://www-zeuthen.desy.de/unix/unixguide/infohtml/gdb/Separate-Debug-Files.html:

For the “debug link” method, gdb looks up the named file in the directory of the executable file, then in a subdirectory of that directory named .debug, and finally under the global debug directory, in a subdirectory whose name is identical to the leading directories of the executable's absolute file name.

The paths were hardcoded by using the directories provided in the examples, which might not work, especially if the app is not installed via a package.

I'm not 100% sure of the assumptions I made to get the original file location as a Path.

Note that in the three cases it uses an absolute path but it might be enough to use a relative path for the two first locations.

Fixes #37 for me.

Copy link
Owner

@mstange mstange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you for fixing this!

@mstange
Copy link
Owner

mstange commented Mar 25, 2023

I'm not 100% sure of the assumptions I made to get the original file location as a Path.

Note that in the three cases it uses an absolute path but it might be enough to use a relative path for the two first locations.

I think what you have is fine.

@mstange mstange merged commit 2a73d11 into mstange:main Mar 25, 2023
@zecakeh zecakeh deleted the debuglink-path branch March 25, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong symbols for Rust binary
2 participants