octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUD octave support


From: Nick Roberts
Subject: Re: GUD octave support
Date: Sat, 8 Dec 2007 22:16:12 +1300

 > 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]