0
Files
src/docs/linux_debugging_gtk.md
Tom Anderson 287339e073 Remove GTK2 code
GTK2 code was historically kept around to keep the electron build working.  But
as of Nov 26, 2017, electron now uses GTK3 [1], so it should now be safe to
remove all of the old GTK2-only code.

[1] https://github.com/electron/electron/issues/2927#issuecomment-347092515

BUG=876558
R=sky

Change-Id: I78402053ae508ccd8fc7ac73697a861bb1ebacf6
Reviewed-on: https://chromium-review.googlesource.com/1183858
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585265}
2018-08-22 21:52:02 +00:00

1.3 KiB

Linux Debugging GTK

Making warnings fatal

See Running GLib Applications for notes on how to make GTK warnings fatal.

Using GTK Debug packages

sudo apt-get install libgtk-3-0-dbg

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.

Source

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 doing:

$ cd /my/dir
$ apt-get source libgtk-3-0
$ gdb ...
(gdb) set substitute-path /build/buildd /my/dir

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 building from source and setting my LD_LIBRARY_PATH.

See linux_building_debug_gtk.md for more on how to build your own debug version of GTK.

Parasite

http://chipx86.github.com/gtkparasite/ is great. Go check out the site for more about it.

Install it with

sudo apt-get install gtkparasite

And then run Chrome with

GTK_MODULES=gtkparasite ./out/Debug/chrome

GDK_DEBUG

Use GDK_DEBUG=nograbs to run GTK+ without grabs. This is useful for gdb sessions.