Changes

From Gramps

Debugging Gramps

685 bytes added, 19:05, 1 February 2013
m
Use gdb C debugger
With GObject introspection, much more can go wrong on a lower level, causing C errors. For these gdb can be used. You should install some debug libraries like libglib2.0-0-dbg, python-gobject-dbg, ... .
Then, you start in a terminal gdb in the directory where grampsGramps.py is stored with
gdb python
You just type now:
run grampsGramps.py
and then navigate gramps to the segmentation fault. After that, you see something like
which will print the backtrace. You are now ready to use your C knowledge to fix the bug!
 
=== Trace GObject/GTK warnings ===
GTK has several possible warning levels, which might pop up on the terminal, without visible problems in Gramps. To trace these, do the following in the :
 
gdb python
 
and at the gdb prompt indicate to stop on log output:
 
b g_log if log level < 32
r Gramps.py
 
Now Gramps will stop on serious messages, and you can use
 
bt
 
to get a backtrace of the C stack showing where the message originated and what called the function, etc.
 
=== Learn More ===
 
To learn more about debugging python and C debugging with gdb, see [http://grapsus.net/blog/post/Low-level-Python-debugging-with-GDB] and [http://www.sourceware.org/gdb/onlinedocs/gdb.html].
[[Category:Developers/Reference]]
[[Category:Developers/Tutorials]]
[[Category:Developers/General]]

Navigation menu