diff options
author | Skip Montanaro <skip.montanaro@gmail.com> | 2018-04-05 17:34:44 (GMT) |
---|---|---|
committer | Ned Deily <nad@python.org> | 2018-04-05 17:34:44 (GMT) |
commit | 7286dbd8b20bd0a26fabe1a07ff368082a9c5ed6 (patch) | |
tree | 711eae16b953f3b0867f7e47cb9ed0d9cedd381e /Misc/gdbinit | |
parent | 091e95e9004b794280ab35becec2c3e30dd5e96e (diff) | |
download | cpython-7286dbd8b20bd0a26fabe1a07ff368082a9c5ed6.zip cpython-7286dbd8b20bd0a26fabe1a07ff368082a9c5ed6.tar.gz cpython-7286dbd8b20bd0a26fabe1a07ff368082a9c5ed6.tar.bz2 |
bpo-15817: Expose command documentation to gdb help (GH-6384)
Original patch by Alexander Belopolsky. Patch by Skip Montanaro.
Diffstat (limited to 'Misc/gdbinit')
-rw-r--r-- | Misc/gdbinit | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/Misc/gdbinit b/Misc/gdbinit index 3b6fe50..9f21621 100644 --- a/Misc/gdbinit +++ b/Misc/gdbinit @@ -14,9 +14,11 @@ # with embedded macros that you may find superior to what is in here. # See Tools/gdb/libpython.py and http://bugs.python.org/issue8032. -# 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* +document pyo + Prints a representation of the object to stderr, along with the + number of reference counts it currently has and the hex address the + object is allocated at. The argument must be a PyObject* +end define pyo # side effect of calling _PyObject_Dump is to dump the object's # info - assigning just prevents gdb from printing the @@ -24,14 +26,18 @@ define pyo set $_unused_void = _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* +document pyg + Prints a representation of the object to stderr, along with the + number of reference counts it currently has and the hex address the + object is allocated at. The argument must be a PyGC_Head* +end define pyg print _PyGC_Dump($arg0) end -# print the local variables of the current frame +document pylocals + Print the local variables of the current frame. +end define pylocals set $_i = 0 while $_i < f->f_code->co_nlocals @@ -69,7 +75,9 @@ define lineno printf "%d", $__li end -# print the current frame - verbose +document pyframev + Print the current frame - verbose +end define pyframev pyframe pylocals @@ -126,7 +134,9 @@ end # the interpreter you may will have to change the functions you compare with # $pc. -# print the entire Python call stack +document pystack + Print the entire Python call stack +end define pystack while $pc < Py_Main || $pc > Py_GetArgcArgv if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx @@ -137,7 +147,9 @@ define pystack select-frame 0 end -# print the entire Python call stack - verbose mode +document pystackv + Print the entire Python call stack - verbose mode +end define pystackv while $pc < Py_Main || $pc > Py_GetArgcArgv if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx @@ -148,7 +160,9 @@ define pystackv select-frame 0 end -# generally useful macro to print a Unicode string +document pu + Generally useful macro to print a Unicode string +end def pu set $uni = $arg0 set $i = 0 |