Skip to content

Releases: Trepan-Debuggers/python3-trepan

Nathanman

13 Nov 15:51
Compare
Choose a tag to compare
  • 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

22 Jul 16:31
Compare
Choose a tag to compare
  • Add set/show asmfmt Improve disassembler formatting; allow all of the assembler formats that exits
  • Track xdis API changes.
  • The usual lint and bug fixes

BlackHat Asia 2024 Ides of March

18 Mar 02:43
Compare
Choose a tag to compare
  • Revise for newer xdis.
  • Go over disassembly (more work is needed)
  • Add set/show asmfmt, and set/show styles commands.
  • Go over terminal detection.
  • Tolerate GraalVM
  • Remove use of nosetest in master branch
  • Modernize code using black and isort; convert to fstring use.
  • Tokerate 3.11 and 3.12; git branches handle older Python versions

Elaine Camilla

27 May 13:34
Compare
Choose a tag to compare

Commands that are useful in remote envionments and docker:

  • Add "set tempdir" to set location of TEMPDIR (useful docker)
  • Add "set/show substitute"

Other changes:

  • Blacken, and isort, codespell, and lint many files
  • ignore ignored signal
  • specialize decompiler to decompyle for 3.7 and 3.8
  • fix incorrect tagging in install doc and update decompilation info
  • Squelch traceback on break in unparsable file

1.2.8

06 Nov 00:33
Compare
Choose a tag to compare
  • Convert to use newer xdis (which handles 3.10)
  • sphinx doc updates
  • Generalize subcmdmgr for use in trepan-xpy trepan-xpy has a new class of subcommands Vmstack.
    So we need to be able to allow it to set trepanxpy as a base directory to look for
    subcommands in.
  • Disassembly tweak: Show argval when there is one and argrepr == ''

1.2.7

21 Aug 16:48
Compare
Choose a tag to compare
  • autoeval now saferepr's its output
  • Use uncompyle6 on 3.7 & 3.8 if decompyle3 is not around
  • Tolerate having only decompile3 installed

1.2.6

17 Jul 20:11
Compare
Choose a tag to compare
  • We now use decompyle3 as our decompiler for Python 3.7 and 3.8 instead of uncompyle6
  • Set acceptable min/max values (2) on set substitute command.
  • Go over library pretty print routine (pp) to handle large objects better.
  • Remove silly pp message about how it can't print a simple array: who cares?
  • Go over README.rst to revise what's cool about this.
  • The usual stuff have using black to format, and add more annotation types

F+5

17 Jul 19:58
Compare
Choose a tag to compare
F+5

Small bug fixes. See #34 and #36

We now split off code internally to handle Python3 before 3.6 so we can start to modernize code and add type annotations.

Ides of RF

15 Mar 19:41
Compare
Choose a tag to compare

There is no 1.2.1 or 1.2.2 - this version number is to keep in sync with trepan2 which has about the
same features.

  • Add set tempdir and show tempdir. In remote debugging this is useful
  • set asmft error message tweak
  • Fix the return tuples for parse_break_cmd() (from bradelkin)
  • eval?: add "and" and "or" by stripping out the final and/or
  • Deal with no style set
  • use PyPI term-background package
  • Extend patsub's effect to breakpoint Hook the command processor file
    pattern substutition to python filecache's file pattern substitution
  • Add info locals --list
  • Tolerate inspect.formatargvalues() errors
  • Improve python source detection and invalid bytecode handling.
  • Get set patsub to substitute file paths e.g. "^/code" inside docker -> "/Users/rocky/project"

About set patsub: We need to do the substitution in the debugger, not in
pyficache where we just want the presentation of the filename to be
different. The actual location is the name pyficache sees and gets
lines from.

1.2.0

28 Jun 03:40
Compare
Choose a tag to compare

disasesmbly via xdis now supports "extended" assembly listing which is new. Use that by default.

Commands have been gone over to be DRYer and use a more modern style of imports.
Small bugs have been fixed in conjunction with going over the commands.

New/Changed commands:

  • set asmfmt will let you select between the different formats and
  • show asmfmt will show you what format is in effect
  • info lines shows more information about what lines can be breakpointed (have line number table offsets in code)
  • info offsets shows you what offsets can be breakpointed (start on a line-number table entry)
  • info line gives more information, i.e. offset info, for a given line.

Some changes were made to allow using from trepan-xpy. In particular we allow breakpoints by offset in addition to by line.

Examples of new/changed commands

$ trepan3k test/example/gcd.py 3 5
(/tmp/python3-trepan/test/example/gcd.py:2): <module>
-> 2 """Greatest Common Divisor
Evaluate unrecognized is on.
output set for terminal with escape sequences for a dark background
(trepan3k) info lines
Line - (fn, start offset) table for /tmp/python3-trepan/test/example/gcd.py
       2: <module> @0         19: check_args() @36     30: gcd() @0     40: <module> @28
      11: <module> @4         20: check_args() @68     31: gcd() @8     41: <module> @36
      13: <module> @12        21: check_args() @82     34: gcd() @18    43: <module> @42
      14: check_args() @0     22: check_args() @104    35: gcd() @26    44: <module> @60
      16: check_args() @14    23: check_args() @114    36: gcd() @30    45: <module> @84
      17: check_args() @22    24: check_args() @120    37: gcd() @50
      18: check_args() @34    26: <module> @20         38: gcd() @54

(trepan3k) info offset
Offset - line number table for /tmp/python3-trepan/test/example/gcd.py
    @   0:   2  @  12:  13  @  28:  40  @  42:  43  @  84:  45
    @   4:  11  @  20:  26  @  36:  41  @  60:  44

(trepan3k) info line
Line 2 of "gcd.py" starts at offset 0 of <module> and contains 2 instructions
(trepan3k) (trepan3k) disasm 1,20
Disassembly of <frame at 0x7f1c1715e040, file '/tmp/python3-trepan/test/example/gcd.py', line 2, code <module>>: to line 20
   2 -->     0 LOAD_CONST           ("Greatest Common Divisor\n\nSome characterstics of this program used for testing check_args() does\nnot have a 'return' statement.\n\ncheck_args() raises an uncaught exception when given the wrong number\nof parameters.\n\n")
             2 STORE_NAME           (__doc__)

  11         4 LOAD_CONST           (0)
             6 LOAD_CONST           (None)
             8 IMPORT_NAME          (sys)
            10 STORE_NAME           (sys)

  13        12 LOAD_CONST           (<code object check_args at 0x7f1c171cc870, file "/tmp/python3-trepan/test/example/gcd.py", line 13>)
            14 LOAD_CONST           ('check_args')
            16 MAKE_FUNCTION        ('check_args': 0 positional, 0 name and default)
            18 STORE_NAME           (check_args)

(trepan3k) set asmfmt extended-bytes
Assembly format style is extended-bytes
(trepan3k) disasm 1,20
Disassembly of <frame at 0x7f1c1715e040, file '/tmp/python3-trepan/test/example/gcd.py', line 2, code <module>>: to line 20
   2 -->     0 |64 00| LOAD_CONST           ("Greatest Common Divisor\n\nSome characterstics of this program used for testing check_args() does\nnot have a 'return' statement.\n\ncheck_args() raises an uncaught exception when given the wrong number\nof parameters.\n\n")
             2 |5a 00| STORE_NAME           (__doc__)

  11         4 |64 01| LOAD_CONST           (0)
             6 |64 02| LOAD_CONST           (None)
             8 |6c 01| IMPORT_NAME          (sys)
            10 |5a 01| STORE_NAME           (sys)

  13        12 |64 03| LOAD_CONST           (<code object check_args at 0x7f1c171cc870, file "/tmp/python3-trepan/test/example/gcd.py", line 13>)
            14 |64 04| LOAD_CONST           ('check_args')
            16 |84 00| MAKE_FUNCTION        ('check_args': 0 positional, 0 name and default)
            18 |5a 02| STORE_NAME           (check_args)

(trepan3k)