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 e35f197
Show file tree
Hide file tree
Showing 15 changed files with 914 additions and 44 deletions.
826 changes: 826 additions & 0 deletions ChangeLog-spell-corrected.diff

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
1.2.11 2024-077-22
1.3.0 2024-11-13
================

* Less overhead and faster execution of "continue" and "next" (when
possible) using improvements recently made to pytracer.
* Support prompt-toolkit as an input interface. This is now the default
on newer Pythons. Command completion is less featurefull than GNU readline
but that will get addressed over time.
* Add "load" command to support trepan3k plugins from a Python package
* Add thread name to "info frame"
* Add "reload" command to reload a debugger command.
This allows making changes to the debugger while debugging
* Improve disassembly output - better tagging and use of xdis extended format
* Modernize style with more type annotations and flynt-converted f-strings
* Support up to Python 3.13 (with some help from xdis)

1.2.11 2024-07-22
==================

Add `set/show asmfmt` Improve disassembler formatting; allow all of the assembler formats that exits
Add `set/show asmfmt` Improve disassembler formatting; allow all of the assembler formats that exists
Track xdis API changes.
The usual lint and bug fixes

Expand Down
52 changes: 36 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,24 @@ 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_ for more information.


Smart Eval
----------
Expand Down Expand Up @@ -232,7 +249,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 +331,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 +342,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
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#!/bin/bash
function finish {
cd $owd
cd $trepan3k_owd
}

# FIXME put some of the below in a common routine
owd=$(pwd)
trap finish EXIT
trepan3k_owd=$(pwd)
# trap finish EXIT

cd $(dirname ${BASH_SOURCE[0]})
if ! source ./pyenv-3.2-3.5-versions ; then
if ! source ./pyenv-3.3-3.5-versions ; then
exit $?
fi

. ./setup-python-3.2.sh
if ! source ./setup-python-3.3.sh ; then
exit $?
fi

cd ..
for version in $PYVERSIONS; do
Expand All @@ -24,4 +26,6 @@ for version in $PYVERSIONS; do
if ! make check; then
exit $?
fi
echo === $version ===
done
finish
7 changes: 4 additions & 3 deletions admin-tools/check-3.6-3.10-versions.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
function finish {
cd $owd
cd $trepan3k_owd
}

# FIXME put some of the below in a common routine
owd=$(pwd)
trap finish EXIT
trepan3k_owd=$(pwd)
# trap finish EXIT

cd $(dirname ${BASH_SOURCE[0]})
if ! source ./pyenv-3.6-3.10-versions ; then
Expand All @@ -24,4 +24,5 @@ for version in $PYVERSIONS; do
if ! make check; then
exit $?
fi
echo === $version ===
done
7 changes: 4 additions & 3 deletions admin-tools/check-newest-versions.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
function finish {
cd $owd
cd $trepan3k_owd
}

# FIXME put some of the below in a common routine
owd=$(pwd)
trap finish EXIT
trepan3k_owd=$(pwd)
# trap finish EXIT

cd $(dirname ${BASH_SOURCE[0]})
if ! source ./pyenv-newer-versions ; then
Expand All @@ -24,4 +24,5 @@ for version in $PYVERSIONS; do
if ! make check; then
exit $?
fi
echo === $version ===
done
2 changes: 1 addition & 1 deletion admin-tools/pyenv-3.3-3.5-versions
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
echo "This script should be *sourced* rather than run directly through bash"
exit 1
fi
export PYVERSIONS='3.2.6 3.5.10 3.3.7 3.4.10 pypy3.5-7.0.0'
export PYVERSIONS='3.5 3.3 3.4 pypy3.5-7.0.0'
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 e35f197

Please sign in to comment.