Skip to content

Commit

Permalink
Get ready for release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Nov 13, 2024
1 parent 604a852 commit 71ae537
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 30 deletions.
53 changes: 37 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ reliable operations.
A command-line interface (CLI) is provided as well as remote access
interface over TCP/IP.

See the entry_exit_ for the various ways you can enter the debugger.
See the entry-exit_ for the various ways you can enter the debugger.

This code supports versions of Python back to version 3.0 using
different *git* branches. See trepan2_ for the same code modified to
Expand Down Expand Up @@ -62,7 +62,7 @@ instructions. I am slowly working on that though.

We use information in Python's code object line number table in byte
to understand which lines are breakpointable, and in which module or
function the line appears in. Use info_line_ to see this
function the line appears in. Use info-line_ to see this
information. Most if not all other debuggers do go to such lengths,
and as a result, it is possible to request stopping on a line number
that can never occur without complaint.
Expand Down Expand Up @@ -90,19 +90,19 @@ or ``exec``'d code.*

But if you happen to know where the source code is located, you can
associate a file source code with the current name listed in the
bytecode. See the set_substitute_ command for details here.
bytecode. See the set-substitute_ command for details here.

Source-code Syntax Colorization
-------------------------------

Terminal source code is colorized via pygments_. And with that, you
can set the pygments color style, e.g. "colorful", "paraiso-dark". See
set_style_ . Furthermore, we make use of terminal bold and emphasized
text in debugger output and help text. Of course, you can also turn
this off. You can use your own
pygments_style_, provided you have a terminal that supports 256
colors. If your terminal supports the basic ANSI color sequences only,
we support that too in both dark and light themes.
set-style_ . Furthermore, we make use of terminal bold
and emphasized text in debugger output and help text. Of course, you
can also turn this off. You can use your own pygments_style_, provided
you have a terminal that supports 256 colors. If your terminal
supports the basic ANSI color sequences only, we support that too in
both dark and light themes.


Command Completion
Expand All @@ -121,7 +121,25 @@ Terminal Handling
-----------------

We can adjust debugger output depending on the line width of your
terminal. If it changes, or you want to adjust it, see set_width_.
terminal. If it changes, or you want to adjust it, see set-width_.

Signal Handling
-----------------

Following *gdb*, we provide its rich set of signal handling. From the *gdb* documentation:

GDB has the ability to detect any occurrence of a signal in your program. You can tell GDB in advance what to do for each kind of signal.

Better Support for Thread Debugging
------------------------------------

When you are stopped inside a thread, the thread name is shown to make
this fact more clear and you can see and switch between frames in
different threads. See frame_ for more information.

And following *gdb*, you can list the threads too. See `info threads
<info-threads>`_ for more information.


Smart Eval
----------
Expand Down Expand Up @@ -232,7 +250,7 @@ We do more in the way of looking at the byte codes to give better information. T
``MAKE_FUNCTION`` or ``BUILD_CLASS``.)

Even without "deparsing" mentioned above, the ability to disassemble
where the PC is currently located (see `info pc <info_pc>`_), by line
where the PC is currently located (see info-pc_), by line
number range or byte-offset range lets you tell exactly where you are
and code is getting run.

Expand Down Expand Up @@ -314,7 +332,7 @@ See Also
.. _trepanning: https://rubygems.org/gems/trepanning
.. _debuggers: https://metacpan.org/pod/Devel::Trepan
.. _this: https://bashdb.sourceforge.net/pydb/features.html
.. _entry_exit: https://python3-trepan.readthedocs.io/en/latest/entry-exit.html
.. _entry-exit: https://python3-trepan.readthedocs.io/en/latest/entry-exit.html
.. _trepanxpy: https://pypi.python.org/pypi/trepanxpy
.. |downloads| image:: https://img.shields.io/pypi/dd/trepan3k.svg
:target: https://pypi.python.org/pypi/trepan3k/
Expand All @@ -325,10 +343,13 @@ See Also
:target: https://pypi.python.org/pypi/trepan3k
:alt: License
.. _deparse: https://python3-trepan.readthedocs.io/en/latest/commands/data/deparse.html
.. _info_line: https://python3-trepan.readthedocs.io/en/latest/commands/info/line.html
.. _set_style: https://python3-trepan.readthedocs.org/en/latest/commands/set/style.html
.. _set_substitute: https://python3-trepan.readthedocs.org/en/latest/commands/set/substitute.html
.. _set_width: https://python3-trepan.readthedocs.org/en/latest/commands/set/width.html
.. _info-line: https://python3-trepan.readthedocs.io/en/latest/commands/info/line.html
.. _info-pc: https://python3-trepan.readthedocs.io/en/latest/commands/info/pc.html
.. _info-threads: https://python3-trepan.readthedocs.io/en/latest/commands/info/threads.html
.. _frame: https://python3-trepan.readthedocs.io/en/latest/commands/stack/frame.html
.. _set-style: https://python3-trepan.readthedocs.org/en/latest/commands/set/style.html
.. _set-substitute: https://python3-trepan.readthedocs.org/en/latest/commands/set/substitute.html
.. _set-width: https://python3-trepan.readthedocs.org/en/latest/commands/set/width.html
.. _eval: https://python3-trepan.readthedocs.org/en/latest/commands/data/eval.html
.. _step: https://python3-trepan.readthedocs.org/en/latest/commands/running/step.html
.. _subst: https://python3-trepan.readthedocs.io/en/latest/commands/set/substitute.html
Expand Down
3 changes: 1 addition & 2 deletions admin-tools/setup-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ mydir=$(dirname $bs)
trepan3k_owd=$(pwd)
cd $mydir
. ./checkout_common.sh
fulldir=$(readlink -f $mydir)
(cd $fulldir/.. && \
(cd $mydir/.. && \
setup_version python-uncompyle6 master && \
setup_version python-xdis master && \
setup_version python-filecache master && \
Expand Down
3 changes: 1 addition & 2 deletions admin-tools/setup-python-3.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ trepan3k_owd=$(pwd)
mydir=$(dirname $bs)
cd $mydir
. ./checkout_common.sh
fulldir=$(readlink -f $mydir)
(cd $fulldir/.. && \
(cd $mydir/.. && \
setup_version python-uncompyle6 python-3.0 \
setup_version python-filecache python-3.0 && \
setup_version shell-term-background python-3.0 && \
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/set/asmfmt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Set the style of format to use in disassembly:
``bytes`` format along with *extended* format


Examples:
+++++++++
Frame Examples:
+++++++++++++++

::
set asmfmt extended # this is the default
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/set/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Sets the events that the debugger will stop on. Event names are:
Changing trace event filters works independently of turning on or off
tracing-event printing.

Examples:
+++++++++
Set Events Examples:
++++++++++++++++++++

::

Expand Down
4 changes: 2 additions & 2 deletions docs/commands/show/asmfmt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Show Asmfmt

Show the disassembly format style used in the ``disassemble`` command.

Example:
++++++++
Show asmfmt Example:
++++++++++++++++++++

::
show asmfmt
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/stack/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Frame (absolute frame positioning)
----------------------------------

**frame** [*thread-Name*|*thread-number*] [*frame-number*]
**frame** [ *thread-name* | *thread-number* ] [ *frame-number* ]

Change the current frame to frame *frame-number* if specified, or the
current frame, 0, if no frame number specified.
Expand Down
8 changes: 6 additions & 2 deletions trepan/processor/command/info_subcmd/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
from pyficache import getline, highlight_string

from trepan.lib.complete import complete_token
from trepan.lib.format import Function, format_token

from trepan.lib.stack import format_function_name
from trepan.lib.thred import current_thread_name
from trepan.processor import frame as Mframe
from trepan.processor.print import format_code, format_frame

Expand Down Expand Up @@ -111,7 +114,7 @@ def run(self, args):
frame_num = proc.curindex

mess = (
"Frame %d" % Mframe.frame_num(proc, frame_num)
f"Frame {Mframe.frame_num(proc, frame_num)}"
if frame_num is not None and proc.stack is not None
else "Frame Info"
)
Expand All @@ -124,6 +127,8 @@ def run(self, args):
formatted_func_signature = highlight_string(func_args, style=style).strip()
self.msg(f" function args: {formatted_func_signature}")

formatted_thread_name = format_token(Function, current_thread_name(), style=style)
self.msg(f" thread: {formatted_thread_name}")
# signature = highlight_string(inspect.signature(frame))
# self.msg(f" signature : {signature}")

Expand All @@ -145,7 +150,6 @@ def run(self, args):
self.msg(f" code: {format_code(code, style)}")
self.msg(f" previous frame: {format_frame(frame.f_back, style)}")
self.msg(f" tracing function: {frame.f_trace}")

if is_verbose:
for name, field in [
("Globals", "f_globals"),
Expand Down
2 changes: 1 addition & 1 deletion trepan/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# debugger version number.

# fmt: off
__version__="1.3.0.dev" # noqa
__version__="1.3.0" # noqa

0 comments on commit 71ae537

Please sign in to comment.