(gdb) Condition breakpoints
- Define breakpoint with condition:
b[reak] <BREAK_LOC> if <CONDITION>
- Here
<CONDITION>
can use the variables and functions that are locally visible within the scope of the breaking line
- Here
- Specify condition to existing breakpoint:
condition <BREAKPOINT_NUM> (<CONDITION>)
- Note the presence of parentheses in place of the missing
if
- To unconditionally break on the breakpoint (i.e. remove condition):
condition <BREAKPOINT_NUM>
- Note the presence of parentheses in place of the missing
- Ignore a breakpoint for
N
times:ignore <BREAKPOINT_NUM> N
- If the breakpoint is conditioned, the condition is not checked until the ignore count
N
is used up
- If the breakpoint is conditioned, the condition is not checked until the ignore count
References:
Written on May 3, 2021