Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Misc/gdbinit

    r2 r391  
    1 # -*- ksh -*-
    2 #
    31# If you use the GNU debugger gdb to debug the Python C runtime, you
    42# might find some of the following commands useful.  Copy this to your
     
    1210#    $1 = void
    1311#    (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.
    1416
    1517# Prints a representation of the object to stderr, along with the
     
    1719# object is allocated at.  The argument must be a PyObject*
    1820define 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)
    2025end
    2126
     
    2429# object is allocated at.  The argument must be a PyGC_Head*
    2530define pyg
    26 print _PyGC_Dump($arg0)
     31    print _PyGC_Dump($arg0)
    2732end
    2833
     
    3540            set $_name = PyString_AsString(PyTuple_GetItem($_names, $_i))
    3641            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]
    4143        end
    4244        set $_i = $_i + 1
     
    6062      if ($__ad > $__lasti)
    6163        set $__continue = 0
     64      else
     65        set $__li = $__li + *$__p
     66        set $__p = $__p + 1
    6267      end
    63       set $__li = $__li + *$__p
    64       set $__p = $__p + 1
    6568    end
    6669    printf "%d", $__li
     
    116119# Py_Main <= $pc <= Py_GetArgcArv is true, $pc is in Py_Main(), so the while
    117120# 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.
    119128
    120129# print the entire Python call stack
    121130define pystack
    122131    while $pc < Py_Main || $pc > Py_GetArgcArgv
    123         if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx
     132        if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
    124133            pyframe
    125134        end
     
    132141define pystackv
    133142    while $pc < Py_Main || $pc > Py_GetArgcArgv
    134         if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx
     143        if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
    135144            pyframev
    136145        end
Note: See TracChangeset for help on using the changeset viewer.