blob: 2c2c0d4793b27741e3e21df764fbd550693e5aae [file] [log] [blame] [view]
andybonsad92aa32015-08-31 02:27:441# Linux Debugging GTK
2
andybons3322f762015-08-24 21:37:093## Making warnings fatal
4
andybonsad92aa32015-08-31 02:27:445See
6[Running GLib Applications](http://developer.gnome.org/glib/stable/glib-running.html)
7for notes on how to make GTK warnings fatal.
andybons3322f762015-08-24 21:37:098
9## Using GTK Debug packages
10
Tom Anderson287339e2018-08-22 21:52:0211 sudo apt-get install libgtk-3-0-dbg
andybonsad92aa32015-08-31 02:27:4412
13Make sure that you're building a binary that matches your architecture (e.g.
1464-bit on a 64-bit machine), and there you go.
andybons3322f762015-08-24 21:37:0915
16### Source
andybons3322f762015-08-24 21:37:0917
andybonsad92aa32015-08-31 02:27:4418You'll likely want to get the source for gtk too so that you can step through
19it. You can tell gdb that you've downloaded the source to your system's GTK by
20doing:
21
22```shell
andybons3322f762015-08-24 21:37:0923$ cd /my/dir
Tom Anderson287339e2018-08-22 21:52:0224$ apt-get source libgtk-3-0
andybons3322f762015-08-24 21:37:0925$ gdb ...
26(gdb) set substitute-path /build/buildd /my/dir
27```
28
andybonsad92aa32015-08-31 02:27:4429NOTE: I tried debugging pango in a similar manner, but for some reason gdb
30didn't pick up the symbols from the symbols from the `-dbg` package. I ended up
31building from source and setting my `LD_LIBRARY_PATH`.
andybons3322f762015-08-24 21:37:0932
Tom Andersonabdbd6a2020-01-09 16:59:2733See [building_debug_gtk.md](building_debug_gtk.md) for more on how
andybonsad92aa32015-08-31 02:27:4434to build your own debug version of GTK.
andybons3322f762015-08-24 21:37:0935
36## Parasite
andybonsad92aa32015-08-31 02:27:4437
38http://chipx86.github.com/gtkparasite/ is great. Go check out the site for more
39about it.
andybons3322f762015-08-24 21:37:0940
41Install it with
andybonsad92aa32015-08-31 02:27:4442
43 sudo apt-get install gtkparasite
andybons3322f762015-08-24 21:37:0944
45And then run Chrome with
andybonsad92aa32015-08-31 02:27:4446
47 GTK_MODULES=gtkparasite ./out/Debug/chrome
andybons3322f762015-08-24 21:37:0948
nodira6074d4c2015-09-01 04:26:4549## GDK_DEBUG
andybonsad92aa32015-08-31 02:27:4450
51Use `GDK_DEBUG=nograbs` to run GTK+ without grabs. This is useful for gdb
52sessions.