Debug

Ben Rubinstein benr_mc at cogapp.com
Thu Apr 11 13:35:28 EDT 2002


on 11/4/02 1:47 PM, Robert Presender at rpresender at mail.earthlink.net wrote:

> Would appreciate help in how to use the debugger including what commands are
> used in scripts to initiate the debugger.

The debugger is not at present one of Rev's strongest points, but it is
usable.

The first thing to note is that you have to explicitly open the debugger
window before executing a handler - there's no way to break into the
debugger 'cold'.  Another way of looking at this is that you have to be in
'Script Debug Mode' (that's actually what the menu item that opens the
Debugger window, from the Development menu, is called).  (Perhaps it would
be good if Rev allowed you to select this mode without having the window
open, so that when you hit a breakpoint, if you're in the mode, then the
debugger window opens.)  There has been an issue that if the Debugger window
is open, and you edit a script, the Debugger window doesn't necessarily
update to show the new version of the script - I'm not sure if this has been
fixed, but watch out for it.  If in doubt, close and re-open the Debugger
window again.

Given this, there are two ways to set breakpoints: you can use the command
'breakpoint' in code; or you can set a temporary breakpoint by clicking on a
statement in the Debugger window (it turns red).

While debugging, it's worth noting that the buttons 'step into' and 'step
over' don't work quite as they do in most debuggers.  Or rather, the do as
far as it goes; but if you use 'step over' to step past the last statement
in a handler 'bar', you do not, as you might expect, step on to the next
statement in the handler 'foo'  which called 'bar'; instead, you will (pace
other breakpoints) next regain control when 'bar' is called again.  Use
'step into' to step out of 'bar' and back to 'foo'.  There is sadly no 'step
out of'.

One more gotcha; you can't abort when in debug mode.

> Can't find any documentation in Rev other than in Transcript., which at this
> point doesn't help me.

An essay in the Development Guide on Debugging has been requested, and I'm
sure it's on the list - all I can say about the documentation is that
there's a lot of it, what there is of a very high quality, and it's
improving rapidly.  But there's still a lot needed.

 
  Ben Rubinstein               |  Email: benr_mc at cogapp.com
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com        |  Fax  : +44 (0)1273-728866





More information about the use-livecode mailing list