I’ve been using Octave for a few weeks now, and I’m getting a lot done. However, it’s time for me to learn how to use the debugger. The script I’m debugging is hanging for an unknown reason, and I’d like to see where it stopped and check out the situation.
I’m using the GUI on Windows. I’m attempting to decipher the intsructions at https://octave.org/doc/v6.2.0/Debugging.html
debug_on_interrupt(1); at the top of my script. While the script is running, I hit Ctrl-C, and it takes me back to the
>> prompt. From there, I’ve tried a few of the commands from the documentation:
at top level
error: dblist: must be inside a user function to use dblist
ans = 0
stop if interrupt
error: dbtype: must be inside a user function to give no arguments to dbtype
Note: the script I’m debugging is a .m file with no functions in it. Is that the problem? Do I need to wrap my code inside a function in order to debug it?
Thanks in advance!