PyObject_Print in gdb

Chris Miles miles.chris at gmail.com
Tue May 15 18:39:19 EDT 2007


I'm still not sure about PyObject_Print, but I found a better
solution, using the Misc/gdbinit file from the Python source tree,
which defines a pyo macro.

Example:
(gdb) pyo some_object
object : []
type : list
refcount: 1
address : 0x4b5940
$3 = void

Cheers,
Chris


On May 15, 2:15 pm, Chris Miles <miles.ch... at gmail.com> wrote:
> 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 byhttp://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.




More information about the Python-list mailing list