Skip to content

Don't strip pathname from debug symbol files

Sam Thursfield requested to merge sam/debug-symbols-location into master

This fixes an issue I noticed when building a Flatpak app with BuildStream: debug symbols weren't being found because BuildStream was putting them in the wrong place.

The way this should work is described at freedesktop-sdk/freedesktop-sdk#157 (closed).

From the commit message:

When GDB looks for debug symbols it looks for the full path of the file inside the configured debug-file-directory. For example, if the debug-file-directory is set to a default of /usr/lib/debug, and you are debugging /usr/bin/python3, GDB will look for its debug symbols at this location: /usr/lib/debug/usr/bin/python3.

BuildStream has been putting all debug files inside /usr/lib/debug under their $(basename), so in the above example GDB would fail to find any debug symbols for /usr/bin/python3 because they would be in the incorrect locatoin of /usr/lib/debug/python3.

I should also note that debugging a Flatpak app still doesn't work seamlessly because, while the Freedesktop 1.6 runtime puts a symlink from /usr/lib/debug/app to /app/lib/debug; that should really be a link to /app/lib/debug/app. Unless I'm missing something. But the problem can be worked around by running set debug-file-directory /app/lib/debug:/usr/lib/debug in your GDB session.

Edited by Sam Thursfield

Merge request reports