OLD | NEW |
| 1 # Linux Debugging GTK |
| 2 |
1 ## Making warnings fatal | 3 ## Making warnings fatal |
2 | 4 |
3 See [Running GLib Applications](http://developer.gnome.org/glib/stable/glib-runn
ing.html) for notes on how to make GTK warnings fatal. | 5 See |
| 6 [Running GLib Applications](http://developer.gnome.org/glib/stable/glib-running.
html) |
| 7 for notes on how to make GTK warnings fatal. |
4 | 8 |
5 ## Using GTK Debug packages | 9 ## Using GTK Debug packages |
6 | 10 |
7 ``` | 11 sudo apt-get install libgtk2.0-0-dbg |
8 sudo apt-get install libgtk2.0-0-dbg | 12 |
9 ``` | 13 Make sure that you're building a binary that matches your architecture (e.g. |
10 Make sure that you're building a binary that matches your architecture (e.g. 64-
bit on a 64-bit machine), and there you go. | 14 64-bit on a 64-bit machine), and there you go. |
11 | 15 |
12 ### Source | 16 ### Source |
13 You'll likely want to get the source for gtk too so that you can step through it
. You can tell gdb that you've downloaded the source to your system's GTK by do
ing: | |
14 | 17 |
15 ``` | 18 You'll likely want to get the source for gtk too so that you can step through |
| 19 it. You can tell gdb that you've downloaded the source to your system's GTK by |
| 20 doing: |
| 21 |
| 22 ```shell |
16 $ cd /my/dir | 23 $ cd /my/dir |
17 $ apt-get source libgtk2.0-0 | 24 $ apt-get source libgtk2.0-0 |
18 $ gdb ... | 25 $ gdb ... |
19 (gdb) set substitute-path /build/buildd /my/dir | 26 (gdb) set substitute-path /build/buildd /my/dir |
20 ``` | 27 ``` |
21 | 28 |
22 NOTE: I tried debugging pango in a similar manner, but for some reason gdb didn'
t pick up the symbols from the symbols from the -dbg package. I ended up buildin
g from source and setting my LD\_LIBRARY\_PATH. | 29 NOTE: I tried debugging pango in a similar manner, but for some reason gdb |
| 30 didn't pick up the symbols from the symbols from the `-dbg` package. I ended up |
| 31 building from source and setting my `LD_LIBRARY_PATH`. |
23 | 32 |
24 See LinuxBuildingDebugGtk for more on how to build your own debug version of GTK
. | 33 See [linux_building_debug_gtk.md](linux_building_debug_gtk.md) for more on how |
| 34 to build your own debug version of GTK. |
25 | 35 |
26 ## Parasite | 36 ## Parasite |
27 http://chipx86.github.com/gtkparasite/ is great. Go check out the site for more
about it. | 37 |
| 38 http://chipx86.github.com/gtkparasite/ is great. Go check out the site for more |
| 39 about it. |
28 | 40 |
29 Install it with | 41 Install it with |
30 ``` | 42 |
31 sudo apt-get install gtkparasite | 43 sudo apt-get install gtkparasite |
32 ``` | |
33 | 44 |
34 And then run Chrome with | 45 And then run Chrome with |
35 ``` | 46 |
36 GTK_MODULES=gtkparasite ./out/Debug/chrome | 47 GTK_MODULES=gtkparasite ./out/Debug/chrome |
37 ``` | |
38 | 48 |
39 ### ghardy | 49 ### ghardy |
40 If you're within the Google network on ghardy, which is too old to include gtkpa
rasite, you can do: | |
41 ``` | |
42 scp bunny.sfo:/usr/lib/gtk-2.0/modules/libgtkparasite.so /tmp | |
43 sudo cp /tmp/libgtkparasite.so /usr/lib/gtk-2.0/modules/libgtkparasite.so | |
44 ``` | |
45 | 50 |
46 ## GDK\_DEBUG | 51 If you're within the Google network on ghardy, which is too old to include |
| 52 gtkparasite, you can do: |
47 | 53 |
48 ``` | 54 scp bunny.sfo:/usr/lib/gtk-2.0/modules/libgtkparasite.so /tmp |
49 14:43 < xan> mrobinson: there's a way to run GTK+ without grabs fwiw, useful for
gdb sessions | 55 sudo cp /tmp/libgtkparasite.so /usr/lib/gtk-2.0/modules/libgtkparasite.so |
50 14:44 < xan> GDK_DEBUG=nograbs | 56 |
51 ``` | 57 ## `GDK_DEBUG` |
| 58 |
| 59 Use `GDK_DEBUG=nograbs` to run GTK+ without grabs. This is useful for gdb |
| 60 sessions. |
OLD | NEW |