annotate Misc/gdbinit @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +0000
parents 4acbbb3e65e2
children 97d7cd365dd5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16166
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
1 # -*- ksh -*-
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
2 #
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
3 # If you use the GNU debugger gdb to debug the Python C runtime, you
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
4 # might find some of the following commands useful. Copy this to your
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
5 # ~/.gdbinit file and it'll get loaded into gdb automatically when you
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
6 # start it up. Then, at the gdb prompt you can do things like:
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
7 #
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
8 # (gdb) pyo apyobjectptr
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
9 # <module 'foobar' (built-in)>
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
10 # refcounts: 1
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
11 # address : 84a7a2c
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
12 # $1 = void
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
13 # (gdb)
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
14
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
15 # Prints a representation of the object to stderr, along with the
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
16 # number of reference counts it current has and the hex address the
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
17 # object is allocated at. The argument must be a PyObject*
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
18 define pyo
16197
1bb7651683e7 PyObject_Dump() -> _PyObject_Dump()
Barry Warsaw <barry@python.org>
parents: 16166
diff changeset
19 print _PyObject_Dump($arg0)
16166
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
20 end
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
21
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
22 # Prints a representation of the object to stderr, along with the
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
23 # number of reference counts it current has and the hex address the
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
24 # object is allocated at. The argument must be a PyGC_Head*
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
25 define pyg
16197
1bb7651683e7 PyObject_Dump() -> _PyObject_Dump()
Barry Warsaw <barry@python.org>
parents: 16166
diff changeset
26 print _PyGC_Dump($arg0)
16166
10646d092a52 A few useful definitions if you're using gdb. Copy to ~/.gdbinit to
Barry Warsaw <barry@python.org>
parents:
diff changeset
27 end
30639
5ea0fd26bd36 A helper to dump info about the current frame,
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 16197
diff changeset
28
31860
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
29 # print the local variables of the current frame
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
30 define pylocals
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
31 set $_i = 0
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
32 while $_i < f->f_nlocals
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
33 if f->f_localsplus + $_i != 0
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
34 set $_names = co->co_varnames
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
35 set $_name = PyString_AsString(PyTuple_GetItem($_names, $_i))
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
36 printf "%s:\n", $_name
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
37 # side effect of calling _PyObject_Dump is to dump the object's
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
38 # info - assigning just prevents gdb from printing the
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
39 # NULL return value
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
40 set $_val = _PyObject_Dump(f->f_localsplus[$_i])
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
41 end
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
42 set $_i = $_i + 1
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
43 end
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
44 end
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
45
34370
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
46 # A rewrite of the Python interpreter's line number calculator in GDB's
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
47 # command language
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
48 define lineno
35520
9521e380380f break sets a breakpoint rather than stopping the loop.
Neal Norwitz <nnorwitz@gmail.com>
parents: 35335
diff changeset
49 set $__continue = 1
34370
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
50 set $__co = f->f_code
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
51 set $__lasti = f->f_lasti
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
52 set $__sz = ((PyStringObject *)$__co->co_lnotab)->ob_size/2
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
53 set $__p = (unsigned char *)((PyStringObject *)$__co->co_lnotab)->ob_sval
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
54 set $__li = $__co->co_firstlineno
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
55 set $__ad = 0
35520
9521e380380f break sets a breakpoint rather than stopping the loop.
Neal Norwitz <nnorwitz@gmail.com>
parents: 35335
diff changeset
56 while ($__sz-1 >= 0 && $__continue)
34370
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
57 set $__sz = $__sz - 1
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
58 set $__ad = $__ad + *$__p
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
59 set $__p = $__p + 1
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
60 if ($__ad > $__lasti)
35520
9521e380380f break sets a breakpoint rather than stopping the loop.
Neal Norwitz <nnorwitz@gmail.com>
parents: 35335
diff changeset
61 set $__continue = 0
34370
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
62 end
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
63 set $__li = $__li + *$__p
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
64 set $__p = $__p + 1
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
65 end
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
66 printf "%d", $__li
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
67 end
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
68
33997
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
69 # print the current frame - verbose
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
70 define pyframev
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
71 pyframe
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
72 pylocals
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
73 end
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
74
31860
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
75 define pyframe
33997
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
76 set $__fn = (char *)((PyStringObject *)co->co_filename)->ob_sval
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
77 set $__n = (char *)((PyStringObject *)co->co_name)->ob_sval
34370
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
78 printf "%s (", $__fn
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
79 lineno
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
80 printf "): %s\n", $__n
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
81 ### Uncomment these lines when using from within Emacs/XEmacs so it will
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
82 ### automatically track/display the current Python source line
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
83 # printf "%c%c%s:", 032, 032, $__fn
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
84 # lineno
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
85 # printf ":1\n"
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
86 end
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
87
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
88 ### Use these at your own risk. It appears that a bug in gdb causes it
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
89 ### to crash in certain circumstances.
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
90
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
91 #define up
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
92 # up-silently 1
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
93 # printframe
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
94 #end
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
95
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
96 #define down
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
97 # down-silently 1
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
98 # printframe
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
99 #end
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
100
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
101 define printframe
35335
9b2227a60dae Fix pystack command.
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents: 34370
diff changeset
102 if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
34370
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
103 pyframe
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
104 else
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
105 frame
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
106 end
31860
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
107 end
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
108
31861
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
109 # Here's a somewhat fragile way to print the entire Python stack from gdb.
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
110 # It's fragile because the tests for the value of $pc depend on the layout
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
111 # of specific functions in the C source code.
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
112
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
113 # Explanation of while and if tests: We want to pop up the stack until we
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
114 # land in Py_Main (this is probably an incorrect assumption in an embedded
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
115 # interpreter, but the test can be extended by an interested party). If
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
116 # Py_Main <= $pc <= Py_GetArgcArv is true, $pc is in Py_Main(), so the while
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
117 # tests succeeds as long as it's not true. In a similar fashion the if
34370
ce232072eae6 Add definitions for "up" and "down" commands that print/display the current
Skip Montanaro <skip@pobox.com>
parents: 33997
diff changeset
118 # statement tests to see if we are in PyEval_EvalFrame().
31861
d04d786ab458 It would help if I deleted the old pystack!
Skip Montanaro <skip@pobox.com>
parents: 31860
diff changeset
119
31860
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
120 # print the entire Python call stack
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
121 define pystack
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
122 while $pc < Py_Main || $pc > Py_GetArgcArgv
33024
8897e77cd79a eval_frame now has a PyAPI-style name
Michael W. Hudson <mwh@python.net>
parents: 31861
diff changeset
123 if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx
31860
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
124 pyframe
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
125 end
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
126 up-silently 1
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
127 end
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
128 select-frame 0
50128ff19965 include local variables when dumping Python stack trace
Skip Montanaro <skip@pobox.com>
parents: 31606
diff changeset
129 end
33997
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
130
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
131 # print the entire Python call stack - verbose mode
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
132 define pystackv
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
133 while $pc < Py_Main || $pc > Py_GetArgcArgv
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
134 if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
135 pyframev
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
136 end
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
137 up-silently 1
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
138 end
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
139 select-frame 0
e01a17bcdf28 split functionality into pystack and pystackv commands. The former will
Skip Montanaro <skip@pobox.com>
parents: 33024
diff changeset
140 end
52900
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
141
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
142 # generally useful macro to print a Unicode string
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
143 def pu
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
144 set $uni = $arg0
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
145 set $i = 0
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
146 while (*$uni && $i++<100)
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
147 if (*$uni < 0x80)
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
148 print *(char*)$uni++
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
149 else
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
150 print /x *(short*)$uni++
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
151 end
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
152 end
4acbbb3e65e2 Merged revisions 70866-70868,70870-70871,70893,70896,70902,70905,70907,70912,70915,70927,70933,70940,70944,70954,70963,70998,71056 via svnmerge from
Georg Brandl <georg@python.org>
parents: 35520
diff changeset
153 end