From 71ae53780d3f50a7124de7dd95fa5f2067daf09f Mon Sep 17 00:00:00 2001 From: rocky Date: Tue, 12 Nov 2024 20:31:59 -0500 Subject: [PATCH] Get ready for release 1.3.0 --- README.rst | 53 +++++++++++++------ admin-tools/setup-master.sh | 3 +- admin-tools/setup-python-3.0.sh | 3 +- docs/commands/set/asmfmt.rst | 4 +- docs/commands/set/events.rst | 4 +- docs/commands/show/asmfmt.rst | 4 +- docs/commands/stack/frame.rst | 2 +- trepan/processor/command/info_subcmd/frame.py | 8 ++- trepan/version.py | 2 +- 9 files changed, 53 insertions(+), 30 deletions(-) diff --git a/README.rst b/README.rst index 5189691e..4bae4965 100644 --- a/README.rst +++ b/README.rst @@ -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 @@ -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. @@ -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 @@ -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 +`_ for more information. + Smart Eval ---------- @@ -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 `_), 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. @@ -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/ @@ -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 diff --git a/admin-tools/setup-master.sh b/admin-tools/setup-master.sh index 5d77f1de..f424bad0 100755 --- a/admin-tools/setup-master.sh +++ b/admin-tools/setup-master.sh @@ -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 && \ diff --git a/admin-tools/setup-python-3.0.sh b/admin-tools/setup-python-3.0.sh index c60beea9..0a3e0562 100755 --- a/admin-tools/setup-python-3.0.sh +++ b/admin-tools/setup-python-3.0.sh @@ -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 && \ diff --git a/docs/commands/set/asmfmt.rst b/docs/commands/set/asmfmt.rst index fb88979d..1367b7b1 100644 --- a/docs/commands/set/asmfmt.rst +++ b/docs/commands/set/asmfmt.rst @@ -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 diff --git a/docs/commands/set/events.rst b/docs/commands/set/events.rst index a4473f3d..38e4362f 100644 --- a/docs/commands/set/events.rst +++ b/docs/commands/set/events.rst @@ -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: +++++++++++++++++++++ :: diff --git a/docs/commands/show/asmfmt.rst b/docs/commands/show/asmfmt.rst index ea06b08c..905fedd3 100644 --- a/docs/commands/show/asmfmt.rst +++ b/docs/commands/show/asmfmt.rst @@ -8,8 +8,8 @@ Show Asmfmt Show the disassembly format style used in the ``disassemble`` command. -Example: -++++++++ +Show asmfmt Example: +++++++++++++++++++++ :: show asmfmt diff --git a/docs/commands/stack/frame.rst b/docs/commands/stack/frame.rst index 8216d16e..4d6cefb7 100644 --- a/docs/commands/stack/frame.rst +++ b/docs/commands/stack/frame.rst @@ -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. diff --git a/trepan/processor/command/info_subcmd/frame.py b/trepan/processor/command/info_subcmd/frame.py index b119adca..2155f504 100644 --- a/trepan/processor/command/info_subcmd/frame.py +++ b/trepan/processor/command/info_subcmd/frame.py @@ -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 @@ -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" ) @@ -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}") @@ -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"), diff --git a/trepan/version.py b/trepan/version.py index 4bc33fcf..1f683a40 100644 --- a/trepan/version.py +++ b/trepan/version.py @@ -5,4 +5,4 @@ # debugger version number. # fmt: off -__version__="1.3.0.dev" # noqa +__version__="1.3.0" # noqa