... | ... | @@ -10,11 +10,37 @@ Assuming that you have a flatpak installed called `com.example.first_application |
|
|
flatpak run --devel --command=bash com.example.first_application
|
|
|
```
|
|
|
|
|
|
This starts a `bash` shell in the sandbox.
|
|
|
This starts a `bash` shell in the sandbox. You should see something like the following in the terminal:
|
|
|
|
|
|
``` bash
|
|
|
bash-4.4$
|
|
|
```
|
|
|
|
|
|
It is now possible to start debugging the application.
|
|
|
|
|
|
## Starting the Debugger
|
|
|
|
|
|
For low level code debuggers, like GDB, we can usually just run the debugger, set breakpoints and run the application.
|
|
|
For low level code debuggers, like GDB, we can usually just run the debugger, set breakpoints and run the application. For Python applications, it could be useful to use `pdb` instead. For an application script called `your-first-application` in the `/app/bin` directory, you can start debugging by running the `pdb` module as an option to the `python3` interpreter, passing the script as an argument:
|
|
|
|
|
|
``` bash
|
|
|
bash-4.4$ python3 -m pdb /app/bin/your-first-application
|
|
|
> /app/bin/your-first-application(8)<module>()
|
|
|
-> import sys
|
|
|
(Pdb) l
|
|
|
3
|
|
|
4 # Copyright (C) 2018 Purism SPC
|
|
|
5 # SPDX-License-Identifier: GPL-3.0+
|
|
|
6 # Author: David Boddie <david.boddie@puri.sm>
|
|
|
7
|
|
|
8 -> import sys
|
|
|
9 import gi
|
|
|
10 gi.require_version('Gtk', '3.0')
|
|
|
11 from gi.repository import GLib, Gtk
|
|
|
12
|
|
|
13
|
|
|
```
|
|
|
|
|
|
You can then use the usual commands to debug the application.
|
|
|
|
|
|
## References
|
|
|
|
... | ... | |