[gimp] devel-docs: add some debugging tricks for Flatpak.



commit b5af88a563f53c47a03d9b6ce3600d69df27b434
Author: Jehan <jehan girinstud io>
Date:   Thu Jul 30 16:55:17 2020 +0200

    devel-docs: add some debugging tricks for Flatpak.
    
    The `info line` in particular was given by Ell and will make trace
    handling a lot easier as it means we may not have to ask for traces with
    debug symbols or gdb with Flatpak. We can indeed get these infos back
    ourselves since we are guaranted to use the exact same binaries.
    
    This together with the change in verbose version output I did 2 weeks
    ago (commit bc5f6371e9), allowing us to check the exact Flatpak hash
    commit used by a reporter, Flatpak debugging should be a lot easier with
    just the simpler stack trace format.

 devel-docs/debugging-tips.txt | 49 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
---
diff --git a/devel-docs/debugging-tips.txt b/devel-docs/debugging-tips.txt
index ae36a9b804..80c8c74780 100644
--- a/devel-docs/debugging-tips.txt
+++ b/devel-docs/debugging-tips.txt
@@ -118,6 +118,55 @@ flatpak update --commit=<hash-of-build> org.gimp.GIMP
 
 Then just run your older GIMP!
 
+## Debugging on flatpak
+
+If you want to inspect the sandbox environment, you can do so by
+specifying a custom shell instead of the GIMP binary with the following
+command:
+
+```
+flatpak run --command=bash org.gimp.GIMP
+```
+
+This will run the exact same environment as the flatpak, which should
+also be identical on all machines.
+
+Alternatively you can run the GIMP Flatpak using the GNOME SDK as
+runtime (instead of the .Platform) with the `--devel` option. In
+particular, it gives you access to a few additional debug tools, such as
+`gdb`. Therefore running GIMP with --devel will give better stacktrace,
+or you can run explicitly GIMP inside GDB.
+
+Additionally to install debug symbols in the sandbox, run:
+
+```
+flatpak install flathub org.gimp.GIMP.Debug
+flatpak install flathub org.gnome.Sdk.Debug
+```
+
+Finally even with reporter trace without debug symbols (yet debug
+symbols installed on your side), if you make sure you use exactly the
+same flatpak commit as the reporter (see `Testing older GIMP versions`
+section), you are ensured to use the same binaries. Hence you can trace
+back the code line from an offset.
+
+For instance, say that your trace has this output:
+
+```
+gimp-2.10(file_open_image+0x4e8)[0x5637e0574738]
+```
+
+Here is how you can find the proper code line in the Flatpak (provided
+you use the right flatpak commit):
+
+```
+$ flatpak install flathub org.gimp.GIMP.Debug org.gnome.Sdk.Debug
+$ flatpak run --devel --command=bash org.gimp.GIMP
+(flatpak) $ gdb /app/bin/gimp-2.10
+(gdb) info line *(file_open_image+0x4e8)
+Line 216 of "file-open.c" starts at address 0x4d5738 <file_open_image+1256> and ends at 0x4d5747 
<file_open_image+1271>.
+```
+
 ## Debugging icons ##
 
 See file `devel-docs/icons.txt` to learn more about our icons, and in


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]