3.2.45. when

Breaks when an expression evaluates to True.

Syntax

int when (expression)
int expression;

where:

expression

An expression that is evaluated to test if the result is nonzero.

Description

This macro causes execution to break when expression is True. The when macro evaluates its argument, expression, 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.

Note

RealView Debugger creates a conditional breakpoint, and assigns the when condition using the ,macro:{when(expression)} qualifier.

Return value

int

One of the following:

0

Indicates that expression is True (nonzero).

1

Indicates that expression is False (zero).

Rules

Any C expression resulting in a value can be used as the argument, expression.

Example

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)

See also

Copyright © 2002-2009 ARM Limited. All rights reserved.ARM DUI 0175K
Non-Confidential