Debugging flatpak-ed applications in gdb

Mathieu Bridon bochecha at daitauha.fr
Fri Jan 6 08:53:38 UTC 2017


Hi,

On Fri, 2017-01-06 at 09:46 +0100, Jan Horak wrote:
> Hi,
> is there any way how can we run flatpaked application in debugger
> like gdb or other? Thanks.

You can get a shell in the sandbox by running:

    $ flatpak run --command=bash org.gnome.Games

(replace "org.gnome.Games" by the ID of the app you're trying to debug)

But that just gives you a shell in the app sandbox, with its runtime.
That runtime most likely doesn't contain gdb, or the debugging
information.

Fortunately, you can use:

    $ flatpak run --devel --command=bash org.gnome.Games

This will use the Sdk as the runtime for the app. The fdo and gnome Sdk
both contain gdb, valgrind, and other debugging tools.

Just make sure you have the Sdk installed, and the corresponding
Sdk.Debug extension.

For example, for an app using the org.gnome.Platform runtime, you would
need to install org.gnome.Sdk and org.gnome.Sdk.Debug for the last
command above to work.

Hope that helps,


-- 
Mathieu



More information about the xdg-app mailing list