From a830fbd62c05193982c72a375251b2202986152f Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 21 Sep 2009 15:36:45 +0200 Subject: [PATCH] Document new gdb macros --- docs/reference/glib/running.sgml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/reference/glib/running.sgml b/docs/reference/glib/running.sgml index bb17dc7..e6c3f30 100644 --- a/docs/reference/glib/running.sgml +++ b/docs/reference/glib/running.sgml @@ -268,6 +268,40 @@ is 20. +Gdb debugging macros + + +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. + + + +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. + + + +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. + + + +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 + +gforeach i in some_list_variable: print *(GtkWidget *)l + +Which would print the contents of each widget in a list of widgets. + + + + + Memory statistics -- 2.7.4