On Mar 21, 8:06 pm, Robert Bradshaw <rober...@gmail.com> wrote: > To use this Cython debugger one must start up Sage under gdb. > (Essentially, this is sage -gdb that knows about Python/Cython, which > is really nice.) I don't think one could just drop down into it from > pdb. (Adding Cython support for pdb would be another cool project, > though arguably more a Cython project than a Sage one.) But, if it > could be done, that'd be cool. > > - Robert >
pdb support would be nice, it should probably be optional at (C) compile time to avoid unnecessary checks at each point to see if a (local) trace function is installed. As for the Cython debugger, it can debug your Python and Cython (and C etc) code simultaneously, and it shows exceptions that are being propagated. Segfaults can be debugged in a post-mortem fashion, but for uncaught exceptions this is not implemented, and that would be trickier as you no longer have your C stack available, just a Python traceback. So Cython would really have to have more advanced code objects and frames with variables in there from the C stack for it to work for Cython code. In that case full pdb support wouldn't be too far out of reach, which really makes more sense for higher-level debugging. If all you want is post-mortem debugging for segfaults and exceptions in Sage, then you could set an excepthook from Sage for uncaught exceptions and run under (cy)gdb for segfaults. > > > > > > On Wed, Mar 21, 2012 at 12:42 PM, David Roe <r...@math.harvard.edu> wrote: > > Hi everyone, > > There is now a Cython debugger > > (http://docs.cython.org/src/userguide/debugging.html). It would be great if > > this functionality were tied into the python debugger, so that (after you > > compiled your program with some flags perhaps and start Sage under gdb) you > > could drop into the python debugger after a Python exception or segfault. > > You could then print variables, step through code.... > > > Would this make a good GSOC project? I don't think I know enough about > > Cython or gdb to mentor it; does anyone have the knowledge and time to be a > > mentor? > > David -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org