By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,095 Members | 1,586 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,095 IT Pros & Developers. It's quick & easy.

PyObject_Print in gdb

P: n/a
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/debug...dules-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

May 15 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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...@gmail.comwrote:
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.
May 15 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.