Skip to main content

Can I set a breakpoint with a logical condition? - Knowledgebase / PRACTICE - Lauterbach Support

Can I set a breakpoint with a logical condition?

The command Break.Set has an option /VarCONDition, which allows you to specify a condition under which the CPU stays stopped once it hits the corresponding breakpoint. (In the dialog for setting breakpoints you'll find also the field "Condition" for that, when you click on "advanced".)

Example: set a breakpoint on function MyFunc with the condition that the variable x==10 and y==11

Break.Set MyFunc /VarCONDition (x==10 && y==11)

As a result, the CPU is stopped every time the function MyFunc is executed, but gets immediately restarted when condition "x==11 && y==11" is not met.

You can also specify a condition in the PRACTICE language by using the Break.Set option /CONDition instead of /VarCONDition. This corresponds to unchecking the HLL checkbox in front of the CONDition field in the Break.Set window.
Example: the same condition in the first example can be implemented using:

Break.Set MyFunc /CONDition (Var.Value(x)==10. && Var.Value(y)==11.)

Note: the default radix mode in PRACTICE is hexadecimal, this is why a dot has to be added after the values 10 and 11 to indicate that these are decimal values. Otherwise, the values 0x10 and 0x11 are used per default.

Helpful Unhelpful