| |||
| Home > RealView Debugger Predefined Macros > Alphabetical predefined macro reference > when | |||
Breaks when an expression evaluates to True.
int when (expression) intexpression;
where:
expressionAn expression that is evaluated to test if the result is nonzero.
This macro causes execution to break when expression is True.
The when macro evaluates its argument, ,
to determine if it is True (nonzero) or False (zero). This macro
is designed to be used with any breakpoint commands. When used with these commands,
program execution halts when the stated expression is True and continues
when the stated expression is False.expression
RealView Debugger creates a conditional breakpoint, and assigns the
when condition using the ,macro:{when( qualifier.expression)}
intOne of the following:
0Indicates that expression is True (nonzero).
1Indicates that expression is False (zero).
Set a breakpoint at the entry point of the routine strcpy.
Each time strcpy is encountered, the breakpoint is
hit, and the macro when is executed. The macro
causes the breakpoint to be activated (program execution stops)
when its argument, in this case the byte pointed to by *str,
is zero.
BREAKINSTRUCTION strcpy\@entry;when(*str == 0)
Chapter 2 RealView Debugger Commands for details of the breakpoint commands.