Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GLib
Commits
a830fbd6
Commit
a830fbd6
authored
Sep 21, 2009
by
Alexander Larsson
Browse files
Document new gdb macros
parent
42320706
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/reference/glib/running.sgml
View file @
a830fbd6
...
...
@@ -267,6 +267,40 @@ is 20.
</para>
</refsect2>
<refsect2>
<title>Gdb debugging macros</title>
<para>
glib ships with a set of python macros for the gdb debugger. These includes pretty
printers for lists, hashtables and gobject types. It also has a backtrace filter
that makes backtraces with signal emissions easier to read.
</para>
<para>
To use this you need a recent enough gdb that supports python scripting. Gdb 7.0
should be recent enough, but branches of the "archer" gdb tree as used in Fedora 11
and Fedora 12 should work too. You then need to install glib in the same prefix as
gdb so that the python gdb autoloaded files get installed in the right place for
gdb to pick up.
</para>
<para>
General pretty printing should just happen without having to do anything special.
To get the signal emission filtered backtrace you must use the "new-backtrace" command
instead of the standard one.
</para>
<para>
There is also a new command called gforeach that can be used to apply a command
on each item in a list. E.g. you can do
<programlisting>
gforeach i in some_list_variable: print *(GtkWidget *)l
</programlisting>
Which would print the contents of each widget in a list of widgets.
</para>
</refsect2>
<refsect2>
<title>Memory statistics</title>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment