You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
4.8 KiB

Merged revisions 70912,70944,70968,71033,71041,71208,71263,71286,71395-71396,71405-71406,71485,71492,71494 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r70912 | georg.brandl | 2009-03-31 17:35:46 -0500 (Tue, 31 Mar 2009) | 1 line #5617: add a handy function to print a unicode string to gdbinit. ........ r70944 | georg.brandl | 2009-03-31 23:32:39 -0500 (Tue, 31 Mar 2009) | 1 line #5631: add upload to list of possible commands, which is presented in --help-commands. ........ r70968 | michael.foord | 2009-04-01 13:25:38 -0500 (Wed, 01 Apr 2009) | 1 line Adding Wing project file ........ r71033 | brett.cannon | 2009-04-01 22:34:53 -0500 (Wed, 01 Apr 2009) | 3 lines Fix two issues introduced by issue #71031 by changing the signature of PyImport_AppendInittab() to take a const char *. ........ r71041 | jesse.noller | 2009-04-02 00:17:26 -0500 (Thu, 02 Apr 2009) | 1 line Add custom initializer argument to multiprocess.Manager*, courtesy of lekma ........ r71208 | michael.foord | 2009-04-04 20:15:01 -0500 (Sat, 04 Apr 2009) | 4 lines Change the way unittest.TestSuite use their tests to always access them through iteration. Non behavior changing, this allows you to create custom subclasses that override __iter__. Issue #5693 ........ r71263 | michael.foord | 2009-04-05 14:19:28 -0500 (Sun, 05 Apr 2009) | 4 lines Adding assertIs and assertIsNot methods to unittest.TestCase Issue #2578 ........ r71286 | tarek.ziade | 2009-04-05 17:04:38 -0500 (Sun, 05 Apr 2009) | 1 line added a simplest test to distutils.spawn._nt_quote_args ........ r71395 | benjamin.peterson | 2009-04-08 08:27:29 -0500 (Wed, 08 Apr 2009) | 1 line these must be installed to correctly run tests ........ r71396 | benjamin.peterson | 2009-04-08 08:29:41 -0500 (Wed, 08 Apr 2009) | 1 line fix syntax ........ r71405 | andrew.kuchling | 2009-04-09 06:22:47 -0500 (Thu, 09 Apr 2009) | 1 line Add items ........ r71406 | andrew.kuchling | 2009-04-09 06:23:36 -0500 (Thu, 09 Apr 2009) | 1 line Typo fixes ........ r71485 | andrew.kuchling | 2009-04-11 11:12:23 -0500 (Sat, 11 Apr 2009) | 1 line Add various items ........ r71492 | georg.brandl | 2009-04-11 13:19:27 -0500 (Sat, 11 Apr 2009) | 1 line Take credit for a patch of mine. ........ r71494 | benjamin.peterson | 2009-04-11 14:31:00 -0500 (Sat, 11 Apr 2009) | 1 line ignore py3_test_grammar when compiling the library ........
17 years ago
Merged revisions 70912,70944,70968,71033,71041,71208,71263,71286,71395-71396,71405-71406,71485,71492,71494 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r70912 | georg.brandl | 2009-03-31 17:35:46 -0500 (Tue, 31 Mar 2009) | 1 line #5617: add a handy function to print a unicode string to gdbinit. ........ r70944 | georg.brandl | 2009-03-31 23:32:39 -0500 (Tue, 31 Mar 2009) | 1 line #5631: add upload to list of possible commands, which is presented in --help-commands. ........ r70968 | michael.foord | 2009-04-01 13:25:38 -0500 (Wed, 01 Apr 2009) | 1 line Adding Wing project file ........ r71033 | brett.cannon | 2009-04-01 22:34:53 -0500 (Wed, 01 Apr 2009) | 3 lines Fix two issues introduced by issue #71031 by changing the signature of PyImport_AppendInittab() to take a const char *. ........ r71041 | jesse.noller | 2009-04-02 00:17:26 -0500 (Thu, 02 Apr 2009) | 1 line Add custom initializer argument to multiprocess.Manager*, courtesy of lekma ........ r71208 | michael.foord | 2009-04-04 20:15:01 -0500 (Sat, 04 Apr 2009) | 4 lines Change the way unittest.TestSuite use their tests to always access them through iteration. Non behavior changing, this allows you to create custom subclasses that override __iter__. Issue #5693 ........ r71263 | michael.foord | 2009-04-05 14:19:28 -0500 (Sun, 05 Apr 2009) | 4 lines Adding assertIs and assertIsNot methods to unittest.TestCase Issue #2578 ........ r71286 | tarek.ziade | 2009-04-05 17:04:38 -0500 (Sun, 05 Apr 2009) | 1 line added a simplest test to distutils.spawn._nt_quote_args ........ r71395 | benjamin.peterson | 2009-04-08 08:27:29 -0500 (Wed, 08 Apr 2009) | 1 line these must be installed to correctly run tests ........ r71396 | benjamin.peterson | 2009-04-08 08:29:41 -0500 (Wed, 08 Apr 2009) | 1 line fix syntax ........ r71405 | andrew.kuchling | 2009-04-09 06:22:47 -0500 (Thu, 09 Apr 2009) | 1 line Add items ........ r71406 | andrew.kuchling | 2009-04-09 06:23:36 -0500 (Thu, 09 Apr 2009) | 1 line Typo fixes ........ r71485 | andrew.kuchling | 2009-04-11 11:12:23 -0500 (Sat, 11 Apr 2009) | 1 line Add various items ........ r71492 | georg.brandl | 2009-04-11 13:19:27 -0500 (Sat, 11 Apr 2009) | 1 line Take credit for a patch of mine. ........ r71494 | benjamin.peterson | 2009-04-11 14:31:00 -0500 (Sat, 11 Apr 2009) | 1 line ignore py3_test_grammar when compiling the library ........
17 years ago
Merged revisions 70912,70944,70968,71033,71041,71208,71263,71286,71395-71396,71405-71406,71485,71492,71494 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r70912 | georg.brandl | 2009-03-31 17:35:46 -0500 (Tue, 31 Mar 2009) | 1 line #5617: add a handy function to print a unicode string to gdbinit. ........ r70944 | georg.brandl | 2009-03-31 23:32:39 -0500 (Tue, 31 Mar 2009) | 1 line #5631: add upload to list of possible commands, which is presented in --help-commands. ........ r70968 | michael.foord | 2009-04-01 13:25:38 -0500 (Wed, 01 Apr 2009) | 1 line Adding Wing project file ........ r71033 | brett.cannon | 2009-04-01 22:34:53 -0500 (Wed, 01 Apr 2009) | 3 lines Fix two issues introduced by issue #71031 by changing the signature of PyImport_AppendInittab() to take a const char *. ........ r71041 | jesse.noller | 2009-04-02 00:17:26 -0500 (Thu, 02 Apr 2009) | 1 line Add custom initializer argument to multiprocess.Manager*, courtesy of lekma ........ r71208 | michael.foord | 2009-04-04 20:15:01 -0500 (Sat, 04 Apr 2009) | 4 lines Change the way unittest.TestSuite use their tests to always access them through iteration. Non behavior changing, this allows you to create custom subclasses that override __iter__. Issue #5693 ........ r71263 | michael.foord | 2009-04-05 14:19:28 -0500 (Sun, 05 Apr 2009) | 4 lines Adding assertIs and assertIsNot methods to unittest.TestCase Issue #2578 ........ r71286 | tarek.ziade | 2009-04-05 17:04:38 -0500 (Sun, 05 Apr 2009) | 1 line added a simplest test to distutils.spawn._nt_quote_args ........ r71395 | benjamin.peterson | 2009-04-08 08:27:29 -0500 (Wed, 08 Apr 2009) | 1 line these must be installed to correctly run tests ........ r71396 | benjamin.peterson | 2009-04-08 08:29:41 -0500 (Wed, 08 Apr 2009) | 1 line fix syntax ........ r71405 | andrew.kuchling | 2009-04-09 06:22:47 -0500 (Thu, 09 Apr 2009) | 1 line Add items ........ r71406 | andrew.kuchling | 2009-04-09 06:23:36 -0500 (Thu, 09 Apr 2009) | 1 line Typo fixes ........ r71485 | andrew.kuchling | 2009-04-11 11:12:23 -0500 (Sat, 11 Apr 2009) | 1 line Add various items ........ r71492 | georg.brandl | 2009-04-11 13:19:27 -0500 (Sat, 11 Apr 2009) | 1 line Take credit for a patch of mine. ........ r71494 | benjamin.peterson | 2009-04-11 14:31:00 -0500 (Sat, 11 Apr 2009) | 1 line ignore py3_test_grammar when compiling the library ........
17 years ago
Merged revisions 70912,70944,70968,71033,71041,71208,71263,71286,71395-71396,71405-71406,71485,71492,71494 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r70912 | georg.brandl | 2009-03-31 17:35:46 -0500 (Tue, 31 Mar 2009) | 1 line #5617: add a handy function to print a unicode string to gdbinit. ........ r70944 | georg.brandl | 2009-03-31 23:32:39 -0500 (Tue, 31 Mar 2009) | 1 line #5631: add upload to list of possible commands, which is presented in --help-commands. ........ r70968 | michael.foord | 2009-04-01 13:25:38 -0500 (Wed, 01 Apr 2009) | 1 line Adding Wing project file ........ r71033 | brett.cannon | 2009-04-01 22:34:53 -0500 (Wed, 01 Apr 2009) | 3 lines Fix two issues introduced by issue #71031 by changing the signature of PyImport_AppendInittab() to take a const char *. ........ r71041 | jesse.noller | 2009-04-02 00:17:26 -0500 (Thu, 02 Apr 2009) | 1 line Add custom initializer argument to multiprocess.Manager*, courtesy of lekma ........ r71208 | michael.foord | 2009-04-04 20:15:01 -0500 (Sat, 04 Apr 2009) | 4 lines Change the way unittest.TestSuite use their tests to always access them through iteration. Non behavior changing, this allows you to create custom subclasses that override __iter__. Issue #5693 ........ r71263 | michael.foord | 2009-04-05 14:19:28 -0500 (Sun, 05 Apr 2009) | 4 lines Adding assertIs and assertIsNot methods to unittest.TestCase Issue #2578 ........ r71286 | tarek.ziade | 2009-04-05 17:04:38 -0500 (Sun, 05 Apr 2009) | 1 line added a simplest test to distutils.spawn._nt_quote_args ........ r71395 | benjamin.peterson | 2009-04-08 08:27:29 -0500 (Wed, 08 Apr 2009) | 1 line these must be installed to correctly run tests ........ r71396 | benjamin.peterson | 2009-04-08 08:29:41 -0500 (Wed, 08 Apr 2009) | 1 line fix syntax ........ r71405 | andrew.kuchling | 2009-04-09 06:22:47 -0500 (Thu, 09 Apr 2009) | 1 line Add items ........ r71406 | andrew.kuchling | 2009-04-09 06:23:36 -0500 (Thu, 09 Apr 2009) | 1 line Typo fixes ........ r71485 | andrew.kuchling | 2009-04-11 11:12:23 -0500 (Sat, 11 Apr 2009) | 1 line Add various items ........ r71492 | georg.brandl | 2009-04-11 13:19:27 -0500 (Sat, 11 Apr 2009) | 1 line Take credit for a patch of mine. ........ r71494 | benjamin.peterson | 2009-04-11 14:31:00 -0500 (Sat, 11 Apr 2009) | 1 line ignore py3_test_grammar when compiling the library ........
17 years ago
  1. # If you use the GNU debugger gdb to debug the Python C runtime, you
  2. # might find some of the following commands useful. Copy this to your
  3. # ~/.gdbinit file and it'll get loaded into gdb automatically when you
  4. # start it up. Then, at the gdb prompt you can do things like:
  5. #
  6. # (gdb) pyo apyobjectptr
  7. # <module 'foobar' (built-in)>
  8. # refcounts: 1
  9. # address : 84a7a2c
  10. # $1 = void
  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.
  16. document pyo
  17. Prints a representation of the object to stderr, along with the
  18. number of reference counts it currently has and the hex address the
  19. object is allocated at. The argument must be a PyObject*
  20. end
  21. define pyo
  22. # side effect of calling _PyObject_Dump is to dump the object's
  23. # info - assigning just prevents gdb from printing the
  24. # NULL return value
  25. set $_unused_void = _PyObject_Dump($arg0)
  26. end
  27. document pyg
  28. Prints a representation of the object to stderr, along with the
  29. number of reference counts it currently has and the hex address the
  30. object is allocated at. The argument must be a PyGC_Head*
  31. end
  32. define pyg
  33. print _PyGC_Dump($arg0)
  34. end
  35. document pylocals
  36. Print the local variables of the current frame.
  37. end
  38. define pylocals
  39. set $_i = 0
  40. while $_i < f->f_code->co_nlocals
  41. if f->f_localsplus + $_i != 0
  42. set $_names = f->f_code->co_varnames
  43. set $_name = PyUnicode_AsUTF8(PyTuple_GetItem($_names, $_i))
  44. printf "%s:\n", $_name
  45. pyo f->f_localsplus[$_i]
  46. end
  47. set $_i = $_i + 1
  48. end
  49. end
  50. # A rewrite of the Python interpreter's line number calculator in GDB's
  51. # command language
  52. define lineno
  53. set $__continue = 1
  54. set $__co = f->f_code
  55. set $__lasti = f->f_lasti
  56. set $__sz = ((PyVarObject *)$__co->co_lnotab)->ob_size/2
  57. set $__p = (unsigned char *)((PyBytesObject *)$__co->co_lnotab)->ob_sval
  58. set $__li = $__co->co_firstlineno
  59. set $__ad = 0
  60. while ($__sz-1 >= 0 && $__continue)
  61. set $__sz = $__sz - 1
  62. set $__ad = $__ad + *$__p
  63. set $__p = $__p + 1
  64. if ($__ad > $__lasti)
  65. set $__continue = 0
  66. else
  67. set $__li = $__li + *$__p
  68. set $__p = $__p + 1
  69. end
  70. end
  71. printf "%d", $__li
  72. end
  73. document pyframev
  74. Print the current frame - verbose
  75. end
  76. define pyframev
  77. pyframe
  78. pylocals
  79. end
  80. define pyframe
  81. set $__fn = PyUnicode_AsUTF8(f->f_code->co_filename)
  82. set $__n = PyUnicode_AsUTF8(f->f_code->co_name)
  83. printf "%s (", $__fn
  84. lineno
  85. printf "): %s\n", $__n
  86. ### Uncomment these lines when using from within Emacs/XEmacs so it will
  87. ### automatically track/display the current Python source line
  88. # printf "%c%c%s:", 032, 032, $__fn
  89. # lineno
  90. # printf ":1\n"
  91. end
  92. ### Use these at your own risk. It appears that a bug in gdb causes it
  93. ### to crash in certain circumstances.
  94. #define up
  95. # up-silently 1
  96. # printframe
  97. #end
  98. #define down
  99. # down-silently 1
  100. # printframe
  101. #end
  102. define printframe
  103. if $pc > PyEval_EvalFrameEx && $pc < _PyEval_EvalFrameDefault
  104. pyframe
  105. else
  106. frame
  107. end
  108. end
  109. # Here's a somewhat fragile way to print the entire Python stack from gdb.
  110. # It's fragile because the tests for the value of $pc depend on the layout
  111. # of specific functions in the C source code.
  112. # Explanation of while and if tests: We want to pop up the stack until we
  113. # land in Py_Main (this is probably an incorrect assumption in an embedded
  114. # interpreter, but the test can be extended by an interested party). If
  115. # Py_Main <= $pc <= Py_GetArgcArv is true, $pc is in Py_Main(), so the while
  116. # tests succeeds as long as it's not true. In a similar fashion the if
  117. # statement tests to see if we are in PyEval_EvalFrameEx().
  118. # Note: The name of the main interpreter function and the function which
  119. # follow it has changed over time. This version of pystack works with this
  120. # version of Python. If you try using it with older or newer versions of
  121. # the interpreter you may will have to change the functions you compare with
  122. # $pc.
  123. document pystack
  124. Print the entire Python call stack
  125. end
  126. define pystack
  127. while $pc < Py_Main || $pc > Py_GetArgcArgv
  128. if $pc > PyEval_EvalFrameEx && $pc < _PyEval_EvalFrameDefault
  129. pyframe
  130. end
  131. up-silently 1
  132. end
  133. select-frame 0
  134. end
  135. document pystackv
  136. Print the entire Python call stack - verbose mode
  137. end
  138. define pystackv
  139. while $pc < Py_Main || $pc > Py_GetArgcArgv
  140. if $pc > PyEval_EvalFrameEx && $pc < _PyEval_EvalFrameDefault
  141. pyframev
  142. end
  143. up-silently 1
  144. end
  145. select-frame 0
  146. end
  147. document pu
  148. Generally useful macro to print a Unicode string
  149. end
  150. def pu
  151. set $uni = $arg0
  152. set $i = 0
  153. while (*$uni && $i++<100)
  154. if (*$uni < 0x80)
  155. print *(char*)$uni++
  156. else
  157. print /x *(short*)$uni++
  158. end
  159. end
  160. end