1 | initial version |
Here's one way to use Emacs' Grand Unified Debugger (GUD) with the Sage library:
sage
is in the PATH
.cd SAGE_ROOT
cp local/lib/python/pdb.py .
pdb.py
to #!/usr/bin/env sage
emacs
and type M-x pdb + <ENTER>
Run pdb (like this): ./pdb.py foo.py
to debug foo.py
.Caveats:
foo.py
should contain a statement like from sage.all import *
, in order to use Sage library code.foo.py
should not require the Sage preparser. You'll need to use R = PolynomialRing(QQ, 'a,b,c')
, for example, instead of R.<a,b,c> = QQ[]
.I hope there's a better way! But with this approach, stepping into R = PolynomialRing(QQ, 'a,b,c')
will make Emacs jump to the appropriate line of polynomial_ring_constructor.py
.