GNOME Bugzilla – Bug 787809
Locate source files in debug sessions
Last modified: 2017-09-22 05:07:49 UTC
Debugging programs with debug info avaliable for dependencies, Builder cannot resolve correctly the path of source files
gdb plugin is using the 'file' property from mi protocol to locate sources, doing a translate to resolve the path, but mi protocol provides a 'fullname' property with an absolute path for sources Is not clear when 'fullname' is not avaliable but seems safe to use 'fullname' property and 'file' if 'fullname' is not avaliable.
Created attachment 359951 [details] [review] Use fullname to locate files I have tested from host debugging sessions and flatpak debuggings sessions, and the patch seems to work
Review of attachment 359951 [details] [review]: As mentioned on IRC, this is insufficient due to the path being non-existent outside of a given runtime (such as flatpak). It needs to translate the file using ide_runtime_translate_file().
runner = dzl_signal_group_get_target (self->runner_signals); if (runner != NULL) runtime = ide_runner_get_runtime (runner); Didn't know how to retrieve the runtime, but in my wip I has almost there This is another step to contribute. You need to do things yourself and see the final result and compare with yours is the best way to learn. Let's go for other fixes!
For host runtime this is fixed. For flatpak, I'm debugging a flatpak app created with meson template debugger returns me /run/build-runtime/gtk3/gtk/gtkapplication.c as fullname source entering into the flatpak environment flatpak-builder --run ~/.cache/gnome-builder/flatpak/staging/hello-world/flatpak\:org.gnome.Sdk-x86_64-master org.gnome.HelloWorld.flatpak.json /bin/bash I can only find /usr/lib/debug/source/gtk3/gtk/gtkapplication.c and there's no /run/build-runtime directory
Created attachment 360239 [details] [review] translate /run/build-runtime paths Fix the translation of /run/build-runtime paths It navigates to many points in sources that do not match real source, like gtk_application_get_type which I guess is code autogenerated by gtk. I don't think we can fix that
LGTM, pushed with a quick style fix.