Commit 6a7cea25 authored by Mark Florisson's avatar Mark Florisson

Added 'cy up' and 'cy down' commands.

parent e29bdf17
...@@ -431,13 +431,15 @@ class CyCy(CythonCommand): ...@@ -431,13 +431,15 @@ class CyCy(CythonCommand):
cy break cy break
cy step cy step
cy next cy next
cy run
cy cont
cy up
cy down
cy print cy print
cy list cy list
cy locals cy locals
cy globals cy globals
cy backtrace cy backtrace
cy up
cy down
""" """
name = 'cy' name = 'cy'
...@@ -454,6 +456,8 @@ class CyCy(CythonCommand): ...@@ -454,6 +456,8 @@ class CyCy(CythonCommand):
next = CyNext.register(), next = CyNext.register(),
run = CyRun.register(), run = CyRun.register(),
cont = CyCont.register(), cont = CyCont.register(),
up = CyUp.register(),
down = CyDown.register(),
list = CyList.register(), list = CyList.register(),
print_ = CyPrint.register(), print_ = CyPrint.register(),
locals = CyLocals.register(), locals = CyLocals.register(),
...@@ -714,25 +718,46 @@ class CyRun(CythonCodeStepper): ...@@ -714,25 +718,46 @@ class CyRun(CythonCodeStepper):
""" """
name = 'cy run' name = 'cy run'
_command = 'run'
def invoke(self, *args): def invoke(self, *args):
self.result = gdb.execute('run', to_string=True) self.result = gdb.execute(self._command, to_string=True)
self.end_stepping() self.end_stepping()
class CyCont(CythonCodeStepper): class CyCont(CyRun):
""" """
Continue a Cython program. This is like the 'run' command, except that it Continue a Cython program. This is like the 'run' command, except that it
displays Cython or Python source lines as well. displays Cython or Python source lines as well.
""" """
name = 'cy cont' name = 'cy cont'
_command = 'cont'
class CyUp(CythonCodeStepper):
"""
Go up a Cython, Python or relevant C frame.
"""
name = 'cy up'
_command = 'up'
def invoke(self, *args): def invoke(self, *args):
self.result = gdb.execute('cont', to_string=True) self.result = gdb.execute(self._command, to_string=True)
while not self.is_relevant_function(gdb.selected_frame()):
self.result = gdb.execute(self._command, to_string=True)
self.end_stepping() self.end_stepping()
class CyDown(CyUp):
"""
Go down a Cython, Python or relevant C frame.
"""
name = 'cy down'
_command = 'down'
class CyList(CythonCommand): class CyList(CythonCommand):
""" """
List Cython source code. To disable to customize colouring see the cy_* List Cython source code. To disable to customize colouring see the cy_*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment