Changeset 391 for python/trunk/Misc/gdbinit
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Misc/gdbinit
r2 r391 1 # -*- ksh -*-2 #3 1 # If you use the GNU debugger gdb to debug the Python C runtime, you 4 2 # might find some of the following commands useful. Copy this to your … … 12 10 # $1 = void 13 11 # (gdb) 12 # 13 # NOTE: If you have gdb 7 or later, it supports debugging of Python directly 14 # with embedded macros that you may find superior to what is in here. 15 # See Tools/gdb/libpython.py and http://bugs.python.org/issue8032. 14 16 15 17 # Prints a representation of the object to stderr, along with the … … 17 19 # object is allocated at. The argument must be a PyObject* 18 20 define pyo 19 print _PyObject_Dump($arg0) 21 # side effect of calling _PyObject_Dump is to dump the object's 22 # info - assigning just prevents gdb from printing the 23 # NULL return value 24 set $_unused_void = _PyObject_Dump($arg0) 20 25 end 21 26 … … 24 29 # object is allocated at. The argument must be a PyGC_Head* 25 30 define pyg 26 print _PyGC_Dump($arg0)31 print _PyGC_Dump($arg0) 27 32 end 28 33 … … 35 40 set $_name = PyString_AsString(PyTuple_GetItem($_names, $_i)) 36 41 printf "%s:\n", $_name 37 # side effect of calling _PyObject_Dump is to dump the object's 38 # info - assigning just prevents gdb from printing the 39 # NULL return value 40 set $_val = _PyObject_Dump(f->f_localsplus[$_i]) 42 pyo f->f_localsplus[$_i] 41 43 end 42 44 set $_i = $_i + 1 … … 60 62 if ($__ad > $__lasti) 61 63 set $__continue = 0 64 else 65 set $__li = $__li + *$__p 66 set $__p = $__p + 1 62 67 end 63 set $__li = $__li + *$__p64 set $__p = $__p + 165 68 end 66 69 printf "%d", $__li … … 116 119 # Py_Main <= $pc <= Py_GetArgcArv is true, $pc is in Py_Main(), so the while 117 120 # tests succeeds as long as it's not true. In a similar fashion the if 118 # statement tests to see if we are in PyEval_EvalFrame(). 121 # statement tests to see if we are in PyEval_EvalFrameEx(). 122 123 # Note: The name of the main interpreter function and the function which 124 # follow it has changed over time. This version of pystack works with this 125 # version of Python. If you try using it with older or newer versions of 126 # the interpreter you may will have to change the functions you compare with 127 # $pc. 119 128 120 129 # print the entire Python call stack 121 130 define pystack 122 131 while $pc < Py_Main || $pc > Py_GetArgcArgv 123 if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx132 if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx 124 133 pyframe 125 134 end … … 132 141 define pystackv 133 142 while $pc < Py_Main || $pc > Py_GetArgcArgv 134 if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx143 if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx 135 144 pyframev 136 145 end
Note:
See TracChangeset
for help on using the changeset viewer.