summaryrefslogtreecommitdiff
path: root/Cython/Debugger/libpython.py
diff options
context:
space:
mode:
authorMark Florisson <markflorisson88@gmail.com>2010-12-15 20:42:28 +0100
committerMark Florisson <markflorisson88@gmail.com>2010-12-15 20:42:28 +0100
commitdb664aebf65f1ad301050d904019fb33918d7fbd (patch)
tree5e1439516adef32236222aa59e6d719eaa57d5c3 /Cython/Debugger/libpython.py
parentaf9fbdbca325989c7835bd0fb9b18f7e8faf4798 (diff)
downloadcython-db664aebf65f1ad301050d904019fb33918d7fbd.tar.gz
Made libpython.py compatible with gdb 7.1
Diffstat (limited to 'Cython/Debugger/libpython.py')
-rw-r--r--Cython/Debugger/libpython.py32
1 files changed, 17 insertions, 15 deletions
diff --git a/Cython/Debugger/libpython.py b/Cython/Debugger/libpython.py
index 9c9167150..ab8df4064 100644
--- a/Cython/Debugger/libpython.py
+++ b/Cython/Debugger/libpython.py
@@ -2211,19 +2211,6 @@ class PyCont(ExecutionControlCommandBase):
invoke = ExecutionControlCommandBase.cont
-# Wrap py-step and py-next in gdb defines to make them repeatable.
-py_step = PyStep('-py-step', PythonInfo())
-py_next = PyNext('-py-next', PythonInfo())
-register_defines()
-py_finish = PyFinish('py-finish', PythonInfo())
-py_run = PyRun('py-run', PythonInfo())
-py_cont = PyCont('py-cont', PythonInfo())
-
-gdb.execute('set breakpoint pending on')
-
-Py_single_input = 256
-Py_file_input = 257
-Py_eval_input = 258
def _pointervalue(gdbval):
"""
@@ -2266,7 +2253,11 @@ def get_inferior_unicode_postfix():
return ''
class PythonCodeExecutor(object):
-
+
+ Py_single_input = 256
+ Py_file_input = 257
+ Py_eval_input = 258
+
def malloc(self, size):
chunk = (gdb.parse_and_eval("(void *) malloc((size_t) %d)" % size))
@@ -2439,7 +2430,7 @@ class PyExec(gdb.Command):
def readcode(self, expr):
if expr:
- return expr, Py_single_input
+ return expr, PythonCodeExecutor.Py_single_input
else:
lines = []
while True:
@@ -2469,7 +2460,18 @@ class PyExec(gdb.Command):
executor.evalcode(expr, input_type, global_dict, local_dict)
+
+gdb.execute('set breakpoint pending on')
+
if hasattr(gdb, 'GdbError'):
+ # Wrap py-step and py-next in gdb defines to make them repeatable.
+ py_step = PyStep('-py-step', PythonInfo())
+ py_next = PyNext('-py-next', PythonInfo())
+ register_defines()
+ py_finish = PyFinish('py-finish', PythonInfo())
+ py_run = PyRun('py-run', PythonInfo())
+ py_cont = PyCont('py-cont', PythonInfo())
+
py_exec = FixGdbCommand('py-exec', '-py-exec')
_py_exec = PyExec("-py-exec", gdb.COMMAND_DATA, gdb.COMPLETE_NONE)
else: