14
14
# with embedded macros that you may find superior to what is in here.
15
15
# See Tools/gdb/libpython.py and http://bugs.python.org/issue8032.
16
16
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
20
22
define pyo
21
23
# side effect of calling _PyObject_Dump is to dump the object's
22
24
# info - assigning just prevents gdb from printing the
23
25
# NULL return value
24
26
set $_unused_void = _PyObject_Dump($arg0)
25
27
end
26
28
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
30
34
define pyg
31
35
print _PyGC_Dump($arg0)
32
36
end
33
37
34
- # print the local variables of the current frame
38
+ document pylocals
39
+ Print the local variables of the current frame.
40
+ end
35
41
define pylocals
36
42
set $_i = 0
37
43
while $_i < f->f_code->co_nlocals
@@ -69,7 +75,9 @@ define lineno
69
75
printf "%d", $__li
70
76
end
71
77
72
- # print the current frame - verbose
78
+ document pyframev
79
+ Print the current frame - verbose
80
+ end
73
81
define pyframev
74
82
pyframe
75
83
pylocals
126
134
# the interpreter you may will have to change the functions you compare with
127
135
# $pc.
128
136
129
- # print the entire Python call stack
137
+ document pystack
138
+ Print the entire Python call stack
139
+ end
130
140
define pystack
131
141
while $pc < Py_Main || $pc > Py_GetArgcArgv
132
142
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
@@ -137,7 +147,9 @@ define pystack
137
147
select-frame 0
138
148
end
139
149
140
- # print the entire Python call stack - verbose mode
150
+ document pystackv
151
+ Print the entire Python call stack - verbose mode
152
+ end
141
153
define pystackv
142
154
while $pc < Py_Main || $pc > Py_GetArgcArgv
143
155
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
@@ -148,7 +160,9 @@ define pystackv
148
160
select-frame 0
149
161
end
150
162
151
- # generally useful macro to print a Unicode string
163
+ document pu
164
+ Generally useful macro to print a Unicode string
165
+ end
152
166
def pu
153
167
set $uni = $arg0
154
168
set $i = 0
0 commit comments