A breakpoint may be set at any location in core. It consists
of a set of conditions; when those conditions are satisfied on that line,
execution will be halted. The following conditions may be specified:
- Events
Any combination of these can be chosen. Execution will halt when any one
of the events that you select happens. Refer to the Options section for a description of what can
cause each of these events. Note that all of the event conditions, except
for Execute, halt execution after the event occurs.
- Execute:
Halts execution when this location is about to be executed.
- Write:
Halts execution after this location has been written to.
- Inc/dec:
Halts execution after either field of this location has been incremented
or decremented.
- Compare:
Halts execution after this location has been used in a comparison
- Read:
Halts execution after this location has been read from.
- Test:
Halts execution whenever this location is changed in such a way that an
expression that you specify evaluates to true. The expression may involve
the A and B operands. Note that the test expression is checked only when
the contents of the location are modified.
- Frequency
Specifies how many times the event conditions need to occur before
execution halts. A frequency of 1 means execution halts after each event.
A frequency of 10 means that execution will halt every 10th
time the conditions are met. A frequency of 0 will never halt execution.
(This last feature allows breakpoints to be used as a tracking tool, for
instance to determine where instructions are being copied from/to.)
- Movability
Breakpoints can be either fixed or movable. A movable breakpoint is
copied along with the rest of the instruction by a MOV.I instruction;
fixed breakpoints are not.
Breakpoints can be set in source code using four compiler
directives:
- ;debug
[static | off] Enables the setting of breakpoints. The off keyword
disables breakpoints, so that no breakpoints are set until the next ;debug
directive. ;debug static causes all further breakpoints to be fixed,
rather than movable (the default).
- ;trace
[off] Sets breakpoints at all subsequent instructions, until a ;trace
off directive.
- ;condition
[EWICRT] [<condition>] [M | F] [<frequency>] Sets the
default set of conditions for all subsequent breakpoints. All parameters
are optional, and may appear in any order.
- Any
combination of the letters E, W, I, C, R, and/or T, in any order,
specifies what events will cause a halt. If none of these letters are
present, the default event is E (Execute).
- A
quoted string sets the expression to be tested if the Test event is
specified. Any valid Redcode expression may be used. The variables A (or
a) and B (or b) may be used to refer to the values of the A and B
operands, respectively. The default is B==0.
- M or
F specifies a movable or fixed breakpoint, respectively. The default is
M.
- Any
number present in the conditions sets the frequency. The default is 1.
- ;break
[EWICRT] [<condition>] [M | F] [<frequency>] Sets a
breakpoint on the next instruction, using the specified conditions. If no
conditions are specified, the conditions are those set by the prior
;condition directive (if no ;condition directives have been specified, the
default is E M 1).
- Example:
;break WT A<20 F 10
- This
breakpoint will halt execution if the instruction is written to, or if
the A operand is less than 20. It is not movable, and halts only every
10th time.
- The
same conditions may also be written this way: ;break fw a < 20 10t
Breakpoints can also be set at runtime, from any Core View window, by clicking on the location
number to the left of an instruction.
Each unique set of conditions defines a breakpoint type. There
are two predefined types: Type 1 halts on Execute, is fixed, and has frequency
1 (E F 1). Type 2 is the same, but movable (E M 1). These two types may be set
by a single mouse click in a Core View window. Any breakpoint defined at
compile time, or using the Edit Breakpoint
window, is given a custom type, greater than 2. The breakpoint type is shown in
the Breakpoints dialog box. All breakpoints that are identical (created using
the ;trace compile directive, or using the Fill Next option in the Edit
Breakpoint window, or copied from a movable breakpoint) share the same type.
The total number of different breakpoint types may not exceed 255.
Previous Next
Contents CoreWin
Home