Skip to content

Commit

Permalink
Go over jump, skip and eval, and python doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Dec 10, 2024
1 parent 7f298cf commit 55d4717
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 14 deletions.
3 changes: 2 additions & 1 deletion docs/commands/data/eval.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ given, the following translations occur:

::

assert = <expr> => <expr>
assert <expr> => <expr>
{if|elif} <expr> : => <expr>
while <expr> : => <expr>
return <expr> => <expr>
Expand All @@ -37,5 +37,6 @@ Eval Examples

.. seealso::

:ref:`python <pyton>`,
:ref:`set autoeval <set_autoeval>`, :ref:`pr <pr>`,
:ref:`pp <pp>` and :ref:`examine <examine>`.
14 changes: 11 additions & 3 deletions docs/commands/running/jump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ Jump

**jump** *lineno*

Set the next line that will be executed. The line must be within the
stopped or bottom-most execution frame.
Set the next line that will be executed.

There are a number of limitations on what line can be set.

You can't jump:
- into the body of a for loop
- into an ``except`` block from outside
- outside or inside of a code block you are stopped


.. seealso::

:ref:`step <step>` :ref:`skip <skip>`, :ref:`next <next>`, :ref:`continue <continue>`, and :ref:`finish <finish>` provide other ways to progress
:ref:`skip <skip>`,
:ref:`next <next>`, :ref:`step <step>` :ref:`continue <continue>`, and :ref:`finish <finish>` provide other ways to progress
6 changes: 3 additions & 3 deletions docs/commands/running/skip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Skip

**skip** [*count*]

Set the next line that will be executed. The line must be within the
stopped or bottom-most execution frame.
Skip over (don't run) the next line that will be executed.

.. seealso::

:ref:`step <step>` :ref:`jump <jump>`, :ref:`continue <continue>`, and :ref:`finish <finish>` provide other ways to progress execution.
:ref:`next <next>` :ref:`step <step>` :ref:`jump <jump>`, :ref:`continue <continue>`, and
:ref:`finish <finish>` provide other ways to progress execution.
2 changes: 2 additions & 0 deletions docs/commands/support/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ To issue a debugger command use function *dbgr()*. For example:

.. seealso::

:ref:`eval <eval>`,
:ref:`set autoeval <set_autoeval>`,
:ref:`ipython <ipython>`, and :ref:`bpython <bpython>`.
6 changes: 3 additions & 3 deletions trepan/processor/command/eval.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013, 2015, 2017, 2020, 2023 Rocky Bernstein
# Copyright (C) 2012-2013, 2015, 2017, 2020, 2023-2024 Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -29,7 +29,7 @@ class EvalCommand(DebuggerCommand):
about to be run. If the command ends `?` (via an alias) and no string is
given, the following translations occur:
assert = <expr> => <expr>
assert <expr> => <expr>
{if|elif} <expr> : => <expr>
while <expr> : => <expr>
return <expr> => <expr>
Expand All @@ -53,7 +53,7 @@ class EvalCommand(DebuggerCommand):
See also:
---------
`deval`, `set autoeval`, `pr`, `pp` and `examine`."""
`python`, `deval`, `set autoeval`, `pr`, `pp` and `examine`."""

aliases = ("eval?", "?")
short_help = "Print value of expression EXP"
Expand Down
17 changes: 15 additions & 2 deletions trepan/processor/command/jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,21 @@
class JumpCommand(DebuggerCommand):
"""**jump** *lineno*
Set the next line that will be executed. The line must be within the
stopped or bottom-most execution frame."""
Set the next line that will be executed.
There are a number of limitations on what line can be set.
You can't jump:
- into the body of a for loop
- into an 'except' block from outside
- outside or inside of a code block you are stopped
See also:
---------
`skip`, `next`, `step`, `jump`, `continue`, `return` and
`finish` for other ways to progress execution.
"""

aliases = ("j",)
category = "running"
Expand Down
3 changes: 1 addition & 2 deletions trepan/processor/command/skip.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
class SkipCommand(DebuggerCommand):
"""**skip** [*count*]
Set the next line that will be executed. The line must be within the
stopped or bottom-most execution frame.
Skip over (don't run) the next line that will be executed.
See also:
---------
Expand Down

0 comments on commit 55d4717

Please sign in to comment.