Now that Chris is back from holiday, I'll mention this: I've
merged his function debugger code.
It's very nice. If you want to debug your user-defined function
foo, you construct a script that calls it (well, this is one way
of doing it). Within that script you say
debug foo
Then you run the script using gretlcli. [Comment on the GUI
appears below.]
The "debug" command should come after foo is defined but before
it's called. Then when a call to foo is reached, you get an
interactive prompt at which you can:
- type "n" or "next" to execute the next gretl command in foo
- type another gretl command (most likely a "print" to see
what's happening with some variable)
- type "c" or "continue" to allow foo to continue unimpeded
It would be nice to enable this behaviour within the GUI console
but that's not trivial. The code in gui2/console.c would have to
be re-written quite substantially to allow it to work. I've made
one false start on this myself (since erased from CVS) and I need
to think about it more carefully before trying again.
Allin.