PyObject_Print in gdb

Chris Miles miles.chris at gmail.com
Tue May 15 09:15:54 EDT 2007


I've been using gdb to debug some Python extension modules lately,
which has been very handy, but cannot get PyObject_Print() to work
from within gdb, as recommended by http://wingware.com/doc/howtos/debugging-extension-modules-on-linux

It recommends using "p PyObject_Print (obj, stderr, 0)" but stderr
(and stdout) symbols are never available for me.

(gdb) p args
$2 = (PyObject *) 0x405030
(gdb) p PyObject_Print (args, stderr, 0)
No symbol "stderr" in current context.
(gdb) p PyObject_Print (args, stdout, 0)
No symbol "stdout" in current context.

Any tips on how to reference the stdout/stderr file pointers within
gdb?

Cheers,
Chris




More information about the Python-list mailing list