Skip to main content

trepan3k plugin to support Mathics3 debugging

Project description

Abstract

Here, we have a module extension for the trepan3k debugger that adds commands that largely filter out and interpret Python information into a more Mathics3-centric information.

Install

$ pip install -e .

Example

$ mathics3 --post-mortem  # goes into trepan3k post-mortem debugger on error.
In[1]:= (* Put something here that that triggers a bug in Mathics3 *)
Traceback (most recent call last):
  File "/tmp/Mathics3/mathics-core/mathics/core/expression.py", line 1907, in _is_neutral_symbol
    definition = definitions.get_definition(symbol_name, only_if_exists=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/src/external-vcs/github/Mathics3/mathics-core/mathics/core/definitions.py", line 506, in get_definition
    raise KeyError
KeyError
(Trepan3k:pm) load trepan3k_mathics3
loaded command: "mathics3"
loaded command: "mbacktrace"
loaded command: "mdown"
loaded command: "mup"
loaded command: "printelement"
(Trepan3k:pm) (Trepan3k:pm) help mbacktrace
mbacktrace [options] [count]

    Print backtrace of all stack frames, or innermost count frames.


    An arrow indicates the 'current frame'. The current frame determines
    the context used for many debugger commands such as expression
    evaluation or source-line listing.


    options are:


       -h | --help    - give this help
       -b | --builtin - show Mathics3 builtin methods
       -e | --expr    - show Mathics3 Expressions


    Examples:
    ---------


       mbacktrace      # Print a full stack trace
       mbacktrace 2    # Print only the top two entries





Aliases: mbt.

(Trepan3k:pm) mbacktrace -e
E:0 (3) Expression.restructure <class 'mathics.core.expression.Expression'>
         restructure(reparseUnterminatedGroupNode[{args}, bytes, FilterRules[{Sequence[]}, Options[reparseUnterminatedGro...),
     head=<Symbol: CodeParser`Private`reparseUnterminatedGroupNode>, elements=[<Expression: <SymbolConsta...)
     called from file '/tmp/Mathics3/mathics-core/mathics/core/expression.py' at line 1138
E:1 (4) Expression._flatten_sequence <class 'mathics.core.expression.Expression'>
         _flatten_sequence(reparseUnterminatedGroupNode[{args}, bytes, FilterRules[{Sequence[]}, Options[reparseUnterminatedGro...),
     sequence=<function Expression.flatten_pattern_sequence.<locals>.sequence at 0x77d671362ac0>, evaluat...)
     called from file '/tmp/Mathics3/mathics-core/mathics/core/expression.py' at line 418
E:2 (5) Expression.flatten_pattern_sequence <class 'mathics.core.expression.Expression'>
         flatten_pattern_sequence(reparseUnterminatedGroupNode[{args}, bytes, FilterRules[{Sequence[]}, Options[reparseUnterminatedGro...),
     evaluation=<mathics.core.evaluation.Evaluation object at 0x77d671c18f50>)
     called from file '/tmp/Mathics3/mathics-core/mathics/core/expression.py' at line 644

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trepan3k_mathics3-1.1.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trepan3k_mathics3-1.1.0-py2.py3-none-any.whl (25.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file trepan3k_mathics3-1.1.0.tar.gz.

File metadata

  • Download URL: trepan3k_mathics3-1.1.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trepan3k_mathics3-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9e190c334f0c518ec39486b2007e90a99fd52317dcf8d9ed8a9c4ea13ae266d8
MD5 8607496d0669b2cc3ff42473c59f4155
BLAKE2b-256 b8fbe67051915d9eb73c93293b9de67600ff09921212e083527bf46c62e6154b

See more details on using hashes here.

File details

Details for the file trepan3k_mathics3-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for trepan3k_mathics3-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b11c7b202407a681f6a45fa735c1839d68a54071bdbe53e0ca70fce20ecc87df
MD5 28823e05d4d615a03655c764f986bdee
BLAKE2b-256 88d6e0a6576756aaf3e9230371057289c3bb1c80da930ea31cd832f6e977515d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page