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

hierarchical debugging



    Date: Thu, 28 Sep 89 12:10:01 PDT
    From: todd@ptolemy.arc.nasa.gov (Todd Stock)

    After using Quintus Prolog for 4 years I got in the habit of tracing
    a program in levels, that is I could skip along at the top level seeing
    ONLY calls and "return values".  Then, when I found wierd behavior, I
    could back up, call the function again but this time recursively tracing
    one level deeper.  In this way you can significantly minimize the junk
    you see traced and essentially go right to the problem.
[...]   
    So now I'm working on the Symbolics (and liking it BTW) but I can't seem
    to pull off this simple debugging strategy even though I've seen it done 
    in simpler lisps. 
[...] 

Here are a couple of debugging commands you might try.  In order to get into
the debugger, you can set a breakpoint in a function (use the Set Breakpoint
command), place (BREAK) in your source and recompile, monitor a variable (use
the Monitor Variable command or click Meta-Control-Shift-Left [yes, it's
Baroque] on the output of DESCRIBE of a structure or instance), or, of course,
your program can blow up.

c-X C -- Set Break On Call flag.  The next time a funcall/apply is executed,
  the debugger will be entered first.  Also, when that called function is
  about to return or throw, your machine will enter the debugger again.  c-m-V
  lets you look at the returned/thrown values.

c-X m-C -- Equivalent to c-X C followed by <Resume>.

c-X m-c-C -- Equivalent to c-X C followed by c-m-R (retry current frame).

c-X E -- Set Break on Exit flag.  When the current frame's function is going
  to return (or the current frame be unwound via THROW), enter the debugger
  first.  With a numeric argument this will set the flag for the current frame
  and all the ones below it.

c-X c-C and c-X c-E clear the respective flags, by the way.  c-X c-E also
takes a numeric argument.

The debugger command c-Help will give you quite a lot of help, more than I
could absorb the first few times I read it (and it's gotten considerably
longer since then!).