mirror of
https://github.com/python/cpython.git
synced 2024-11-25 19:03:49 +08:00
A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
pull it in automatically.
This commit is contained in:
parent
9bf16440f4
commit
39e44d7a9c
27
Misc/gdbinit
Normal file
27
Misc/gdbinit
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# -*- ksh -*-
|
||||||
|
#
|
||||||
|
# If you use the GNU debugger gdb to debug the Python C runtime, you
|
||||||
|
# might find some of the following commands useful. Copy this to your
|
||||||
|
# ~/.gdbinit file and it'll get loaded into gdb automatically when you
|
||||||
|
# start it up. Then, at the gdb prompt you can do things like:
|
||||||
|
#
|
||||||
|
# (gdb) pyo apyobjectptr
|
||||||
|
# <module 'foobar' (built-in)>
|
||||||
|
# refcounts: 1
|
||||||
|
# address : 84a7a2c
|
||||||
|
# $1 = void
|
||||||
|
# (gdb)
|
||||||
|
|
||||||
|
# Prints a representation of the object to stderr, along with the
|
||||||
|
# number of reference counts it current has and the hex address the
|
||||||
|
# object is allocated at. The argument must be a PyObject*
|
||||||
|
define pyo
|
||||||
|
print PyObject_Dump($arg0)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Prints a representation of the object to stderr, along with the
|
||||||
|
# number of reference counts it current has and the hex address the
|
||||||
|
# object is allocated at. The argument must be a PyGC_Head*
|
||||||
|
define pyg
|
||||||
|
print PyGC_Dump($arg0)
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user