1414# with embedded macros that you may find superior to what is in here.
1515# See Tools/gdb/libpython.py and http://bugs.python.org/issue8032.
1616
17- # Prints a representation of the object to stderr, along with the
18- # number of reference counts it current has and the hex address the
19- # object is allocated at. The argument must be a PyObject*
17+ document pyo
18+ Prints a representation of the object to stderr, along with the
19+ number of reference counts it currently has and the hex address the
20+ object is allocated at. The argument must be a PyObject*
21+ end
2022define pyo
2123 # side effect of calling _PyObject_Dump is to dump the object's
2224 # info - assigning just prevents gdb from printing the
2325 # NULL return value
2426 set $_unused_void = _PyObject_Dump($arg0)
2527end
2628
27- # Prints a representation of the object to stderr, along with the
28- # number of reference counts it current has and the hex address the
29- # object is allocated at. The argument must be a PyGC_Head*
29+ document pyg
30+ Prints a representation of the object to stderr, along with the
31+ number of reference counts it currently has and the hex address the
32+ object is allocated at. The argument must be a PyGC_Head*
33+ end
3034define pyg
3135 print _PyGC_Dump($arg0)
3236end
3337
34- # print the local variables of the current frame
38+ document pylocals
39+ Print the local variables of the current frame.
40+ end
3541define pylocals
3642 set $_i = 0
3743 while $_i < f->f_code->co_nlocals
@@ -69,7 +75,9 @@ define lineno
6975 printf "%d", $__li
7076end
7177
72- # print the current frame - verbose
78+ document pyframev
79+ Print the current frame - verbose
80+ end
7381define pyframev
7482 pyframe
7583 pylocals
126134# the interpreter you may will have to change the functions you compare with
127135# $pc.
128136
129- # print the entire Python call stack
137+ document pystack
138+ Print the entire Python call stack
139+ end
130140define pystack
131141 while $pc < Py_Main || $pc > Py_GetArgcArgv
132142 if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
@@ -137,7 +147,9 @@ define pystack
137147 select-frame 0
138148end
139149
140- # print the entire Python call stack - verbose mode
150+ document pystackv
151+ Print the entire Python call stack - verbose mode
152+ end
141153define pystackv
142154 while $pc < Py_Main || $pc > Py_GetArgcArgv
143155 if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
@@ -148,7 +160,9 @@ define pystackv
148160 select-frame 0
149161end
150162
151- # generally useful macro to print a Unicode string
163+ document pu
164+ Generally useful macro to print a Unicode string
165+ end
152166def pu
153167 set $uni = $arg0
154168 set $i = 0
0 commit comments