GUD octave support

Nick Roberts nickrob at snap.net.nz
Sat Dec 8 03:16:12 CST 2007


 > Does it even have to be a command-line option?  Could it instead be a
 > function to call to set the display style for filenames in Octave's
 > debugging mode?

It could be a function call.  XEmacs has a mode for Python (another scripting
language) which uses something called Pdbtrack and looks something like this
(with a python script called fibo.py and a function called fib):

  M-x python-shell (note doesn't work with Emacs' run-python)

Then in the buffer this command creates:

  Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) 
  [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import pdb
  >>> import fibo
  >>> pdb.run ("fibo.fib(1000)")
  > <string>(1)<module>()
  (Pdb) b fibo.py:5
  Breakpoint 1 at /home/nickrob/python/fibo.py:5
  (Pdb) c
  > /home/nickrob/python/fibo.py(5)fib()
  -> while b < n:
  (Pdb) 

At which point the source appears in a buffer with the overlay arrow pointing
to the appropriate line.

This is more lightweight than GUD, and I think that the idea is that the user
interacts with Python in a shell buffer in the normal way (a bit like he would
with Octave after run-octave).  Then if he wants to start debugging a script he
can do this just by importing pdb and using pdb.run.

However, this would require more work in Emacs than just using GUD.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


More information about the Octave-maintainers mailing list