Movatterモバイル変換


[0]ホーム

URL:


Google Git
Sign in
chromium /chromium /src /main /. /docs /linux /debugging_gtk.md
blob: 2c2c0d4793b27741e3e21df764fbd550693e5aae [file] [log] [blame] [view]
andybonsad92aa32015-08-31 02:27:44[diff] [blame]1# Linux Debugging GTK
2
andybons3322f762015-08-24 21:37:09[diff] [blame]3## Making warnings fatal
4
andybonsad92aa32015-08-31 02:27:44[diff] [blame]5See
6[RunningGLibApplications](http://developer.gnome.org/glib/stable/glib-running.html)
7for notes on how to make GTK warnings fatal.
andybons3322f762015-08-24 21:37:09[diff] [blame]8
9## Using GTK Debug packages
10
Tom Anderson287339e2018-08-22 21:52:02[diff] [blame]11 sudo apt-get install libgtk-3-0-dbg
andybonsad92aa32015-08-31 02:27:44[diff] [blame]12
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:09[diff] [blame]15
16### Source
andybons3322f762015-08-24 21:37:09[diff] [blame]17
andybonsad92aa32015-08-31 02:27:44[diff] [blame]18You'll likely want toget the sourcefor gtk too so that you can step through
19it.You can tell gdb that you've downloaded the source to your system's GTKby
20doing:
21
22```shell
andybons3322f762015-08-24 21:37:09[diff] [blame]23$ cd /my/dir
Tom Anderson287339e2018-08-22 21:52:02[diff] [blame]24$ apt-get source libgtk-3-0
andybons3322f762015-08-24 21:37:09[diff] [blame]25$ gdb ...
26(gdb) set substitute-path /build/buildd /my/dir
27```
28
andybonsad92aa32015-08-31 02:27:44[diff] [blame]29NOTE: I tried debugging pangoin a similar manner, butfor 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:09[diff] [blame]32
Tom Andersonabdbd6a2020-01-09 16:59:27[diff] [blame]33See [building_debug_gtk.md](building_debug_gtk.md) for more on how
andybonsad92aa32015-08-31 02:27:44[diff] [blame]34to build your own debug version of GTK.
andybons3322f762015-08-24 21:37:09[diff] [blame]35
36## Parasite
andybonsad92aa32015-08-31 02:27:44[diff] [blame]37
38http://chipx86.github.com/gtkparasite/ is great. Go check out the site for more
39about it.
andybons3322f762015-08-24 21:37:09[diff] [blame]40
41Install it with
andybonsad92aa32015-08-31 02:27:44[diff] [blame]42
43 sudo apt-get install gtkparasite
andybons3322f762015-08-24 21:37:09[diff] [blame]44
45And then run Chrome with
andybonsad92aa32015-08-31 02:27:44[diff] [blame]46
47 GTK_MODULES=gtkparasite ./out/Debug/chrome
andybons3322f762015-08-24 21:37:09[diff] [blame]48
nodira6074d4c2015-09-01 04:26:45[diff] [blame]49## GDK_DEBUG
andybonsad92aa32015-08-31 02:27:44[diff] [blame]50
51Use `GDK_DEBUG=nograbs` to run GTK+ without grabs. This is useful for gdb
52sessions.

[8]ページ先頭

©2009-2025 Movatter.jp