Debugging Python extensions with gdb

Andrew Wilkinson ajw140NO at SPAM.york.ac.uk
Fri Jul 9 14:51:03 EDT 2004


Hi,

Below is a back trace from a gdb session. If you look at you'll see that
there are some function calls where gdb can't find the name of the
function. I'm pretty sure that those functions are in my extension. I've
got everything compiled with debugging info turned on, so I'm pretty sure
it is related to the "Unable to find dynamic linker breakpoint function"
message. Does anyone know how to get rid of this message? I tried googling,
but nothing useful turned up.

Thanks in advance for any help,
Regards,
Andrew Wilkinson

andrew at andrew tests $ gdb --args python cg.py
GNU gdb 6.1.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

(gdb) run
Starting program: /usr/bin/python cg.py
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
about to init Devil
No error

Program received signal SIGSEGV, Segmentation fault.
0x4006ea73 in PyObject_GetAttrString () from /usr/lib/libpython2.3.so.1.0
(gdb) bt
#0  0x4006ea73 in PyObject_GetAttrString ()
from /usr/lib/libpython2.3.so.1.0
#1  0x404dc1ed in ?? ()
#2  0x00000000 in ?? ()
#3  0x404eb6cd in ?? ()
#4  0xbfffef5c in ?? ()
#5  0x400f2fbc in __JCR_LIST__ () from /usr/lib/libpython2.3.so.1.0
#6  0x4006a928 in lookdict_string () from /usr/lib/libpython2.3.so.1.0
#7  0x404c7aba in ?? ()
#8  0xbffff07c in ?? ()
#9  0xbffff0ac in ?? ()
#10 0x00000007 in ?? ()
#11 0xbffff07c in ?? ()
#12 0x40061579 in function_call () from /usr/lib/libpython2.3.so.1.0
#13 0x4006cd58 in PyCFunction_Call () from /usr/lib/libpython2.3.so.1.0
#14 0x40094bc3 in call_function () from /usr/lib/libpython2.3.so.1.0
#15 0x40092f8d in eval_frame () from /usr/lib/libpython2.3.so.1.0
#16 0x40093d5f in PyEval_EvalCodeEx () from /usr/lib/libpython2.3.so.1.0
#17 0x40091277 in PyEval_EvalCode () from /usr/lib/libpython2.3.so.1.0
#18 0x400aaf8f in run_node () from /usr/lib/libpython2.3.so.1.0
#19 0x400aa2fe in PyRun_SimpleFileExFlags ()
from /usr/lib/libpython2.3.so.1.0
#20 0x400a9df4 in PyRun_AnyFileExFlags () from /usr/lib/libpython2.3.so.1.0
#21 0x400af3b5 in Py_Main () from /usr/lib/libpython2.3.so.1.0
#22 0x0804867e in main ()

-- 
Tis better to be silent and thought a fool, than to open
your mouth and remove all doubt -- Abraham Lincoln




More information about the Python-list mailing list