Next: Examining Program State Up: The Concert Debugger Users Previous: Tracing Program Execution

Interrupting Program Execution

There are two basic ways to interrupt execution in the Concert Debugger: breakpoints and interrupts. Both work very much as in sequential debuggers; to continue execution use the standard The GNU Debugger continue command.

Breakpoints

The Concert Debugger supports two kinds of breakpoints: precise and imprecise. Imprecise breakpoints are set from within the debugger, and cause the program to stop ``near'' where the breakpoint is set. Precise breakpoints must be specified within the source code, and will cause the program to stop exactly where the breakpoint is set.

Breakpoints are often used to view the values of local variables at a given point in the code. This can be problematic in Concert, because the program may overwrite variables that are no longer being used, even though they are technically still in scope. This makes placing breakpoints tricky.

Imprecise Breakpoints

The Concert Debugger allows you to set imprecise breakpoints at CA expressions; note that not every s-expression in CA is an expression. So, you cannot place breakpoints on ``forward,'' ``message,'' ``sequential'' or other language primitives. Message sends, on the other hand, can be breakpointed.

To set such a breakpoint at the debugger prompt, type ``concert break'' followed by the filename, a colon and the character offset in the file of the character before the beginning of the expression at which to set the breakpoint. Since this is fairly tiresome to actually use often, the usual Emacs-Gdb C-x Space method works from within Emacs. Using C-x Space, the cursor can be anywhere within the expression to stop at, and Emacs will find the exact character offset to give to the debugger.

The breakpoint will cause the program to stop execution whenever it runs across that expression in the code, and (when used within Emacs) to display where it stopped with a marker (the => familiar to Emacs-Gdb users) in the file where the program stopped. You may notice that the program advanced a little way beyond the breakpoint The current context will be set to the context in which the break occurred.

Precise Breakpoints

Some situations require the extra exactness of precise breakpoints. To insert a precise breakpoint, add the special form (break) in the source code precisely where you want the program to stop. This is painful to do because changing the CA code means that it must be recompiled; however, the program will stop exactly where you tell it to do so.

Break on exit

The Concert Debugger also provides the capability to break when the program terminates, which requires a special command because the user may not know what the program will do last. This special breakpoint can be used to track down any ``hanging'' contexts that remain when the program terminates. If a program exits without doing all the work expected, then this is a good place to start looking for bugs.


(cadb) concert break exit

Interrupting Execution

The Concert Debugger can interrupt the program and observe the state. This can be helpful in determining the causes of deadlocks. To interrupt the program at any point, just interrupt the The GNU Debugger buffer. This is done by pressing C-c C-c in Emacs.

The program may stop in the CA code or in the runtime system. If it stops in the CA code, the current context is set to the one in which the program stopped; if the program stops in the runtime code, there is no current context, and attempting to use it will give an error.



Next: Examining Program State Up: The Concert Debugger Users Previous: Tracing Program Execution


Julian Dolby
Concurrent Systems Architecture Group