Xfce Wiki

Sub domains
 

This is an old revision of the document!


Advanced Building and Debugging Information for Xfce components

While the basic build steps are explained here, this page provides some information about build specifics you probably will need on special occasions.

Debugging with gdb

For debian based systems, if you need to debug into dependencies, enable automatic download of debug symbols before calling GDB:

export DEBUGINFOD_URLS="https://debuginfod.debian.net"

First make sure the application you want to debug is not running. After that, you can start it like this:

gdb --args build/myapp/myapp-binary

E.g. for thunar:

gdb --args build/thunar/thunar

Usually it is a good idea to automate the quitting and to bail out on the first warning:

build/thunar/thunar -q; gdb --args build/thunar/thunar --g-fatal-warnings

On a freeze, get a backtrace of all threads via

thread apply all bt

Build with scan-build

scan-build does some static code analysis for a project. It can be used like this:

# using --reconfigure won't work ... you need to remove the build folder!
rm -rf build

# setup and build the project ... the concrete version of scan-build to use can differ
CC=clang scan-build-19 --use-cc=clang meson setup build
CC=clang scan-build-19 --use-cc=clang meson compile -C build

The reports are in HTML and can be viewed with a browser

Build with documentation

meson setup --reconfigure -Dgtk-doc=true build
meson compile -C build

Documentation can be found below build/docs

Use introspection / GtkInspector

GtkInspector is a very nice tool to debug visual things during runtime. First you need to build the project with introspection support:

meson setup --reconfigure -Dintrospection=true build
meson compile -C build

Then you can start GtkInspector for the application by pressing [CTRL][SHIFT][D] during runtime