CelticsDoc.tioga
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) May 14, 1986 4:39:37 pm PDT
Jack Kent June 18, 1986 3:32:45 pm PDT
Mike Spreitzer October 20, 1986 6:47:33 pm PDT
Celtics
CEDAR 6.1 — FOR INTERNAL XEROX USE ONLY
Celtics & BreakTool
-- Two Cedar performance & debugging tools
Russ Atkinson
© Copyright 1985, 1986 Xerox Corporation. All rights reserved.
Abstract: BreakTool is an experimental package that supports various fancy breakpoint facilities. Celtics is a package that can be used to count how many times control passes through given points in the system.
Created by: Russ Atkinson
Maintained by: Russ Atkinson <Atkinson.pa>
Keywords: debugging, performance
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
Celtics
Celtics is a package that can be used to count how many times control passes through given points in the system. Although much more limited than either the Break Tool or the Spy, it is also more interactive and perturbs the system less. Counting breakpoints can be set on high-priority processes or even in code as sensitive as SafeStorage allocation.
Celtics has the following buttons:
Set  sets a counting breakpoint using the selection
Clear *  clears all breakpoints set by Celtics
Reset *  clears the counts of all breakpoints set by Celtics
AddSubTotal adds a subTotal node to the display
Each line in the display represents a separate breakpoint. Each line has two buttons, clear and reset, which are used to clear the associated breakpoint or to simply reset its count to 0. These buttons are followed by the count, which is updated every second. Following the count is the location of the breakpoint, consisting of:
code the address of the code for the breakpoint.
 (useful for distiguishing between different module instances)
pc the program counter for the breakpoint.
pos the source position for the breakpoint.
name the procedure name for the breakpoint.
BreakTool
BreakTool is an experimental package that supports various fancy breakpoint facilities. These include breakpoints that occur only if some condition is true, breakpoints that evaluate expressions at each occurence, and breakpoints that log results at every occurence. All of these capabilities are provided by special expressions that can be evaluated at each breakpoint. A list of these expressions follows:
&abort[...] - raises ERROR ABORTED. Ignores any arguments.
&break[...] - evaluates its arguments, then causes a pseudo-breakpoint to occur at the point where the break was set.
&do[...] - evaluates its arguments repeatedly until the iteration is terminated (i.e. by &result[]).
&empty[] - evaluates its arguments, then returns the same non-printing result as would result from a procedure invocation with no returns.
&evq[...] - evaluates its arguments, then returns a TV for the last of its arguments.
&msg[...] - prints the results of evaluating its arguments. However, for any arguments that result in ROPEs, the printing is performed without quotes.
&print[...] - prints the results of evaluating its arguments. For any arguments that result in ROPEs, the printing is performed with quotes.
&prog[...] - evaluates its arguments, then returns the results of the last evaluation.
&result[...] - evaluates its arguments, then forces the termination of the nearest enclosing evaluation of one of the above special expressions. &result[] is the recommended way to terminate the evaluation of &do[].
&stack[a,b,c] - returns contents of the procedure callstack. Parameter a (which must be an atom) indicates the amount of detail: Verbose ($V) will display the local variables and parameters for each call frame, as well as the procedure name that corresponds to the call frame. Default is terse ($T) - only name of procedure frame. Parameter b specifies where the backwards walk in the call frame should start. If b=$S (the default) then walk starts in the procedure of the breakpoint... if b=procedure name, then walks starts with procedure name (presumably deeper in the stack). Parameter c specifies where the walk should end. If c=$E (the default) then walk continues for the length of the stack. If c=procedure name then walk will stop earlier (presumably higher in the stack).
To set a breakpoint that evaluates an expession at each occurence of the breakpoint, perform the following steps:
1. enter the expression into the Expr: window in the BreakTool
2. using the mouse, select the point where you want the breakpoint placed
3. click the Set button in the BreakTool
The BreakTool has the following buttons:
Set sets an evaluation breakpoint using the current Expr and selection
Clear clears the selected breakpoint
Clear * clears all breakpoints set by the BreakTool
List * lists all breakpoints set by the BreakTool
Eval evaluates the current Expr and prints the results
EvalSel evaluates the current selection as an expression and prints the results
As an example of a conditional breakpoint, suppose that you have the following program:
Fribble: PROC [x: INT] RETURNS [INT] = {
RETURN [x+1]
};
If you want to have a breakpoint on the RETURN statement only when x = 0, then put the following expression in the Expr window:
IF x = 0 THEN &break[] ELSE NIL
Then at every execution of Fribble a breakpoint will occur when x = 0, and will not occur when x # 0. Note that the "ELSE NIL" part is required because one attaches expressions to breakpoints rather than statements.