DAP specifies a breakpoint's hitCondition as a string, meaning it is
an expression to be evaluated. However, gdb implemented this as if it
were an integer instead. This patch fixes this oversight.
# FIXME handle exceptions here
bp = creator(**spec)
- if condition is not None:
- bp.condition = condition
- if hit_condition is not None:
- bp.ignore_count = hit_condition
+ bp.condition = condition
+ if hit_condition is None:
+ bp.ignore_count = 0
+ else:
+ bp.ignore_count = int(
+ gdb.parse_and_eval(hit_condition, global_context=True)
+ )
breakpoint_map[kind][keyspec] = bp
result.append(breakpoint_descriptor(bp))
[format {o source [o path [%s]] \
breakpoints [a [o line [i %d] \
condition [s "i == 3"] \
- hitCondition [i 3]]]} \
+ hitCondition [s 3]]]} \
[list s $srcfile] $line]]
set fn_bpno [dap_get_breakpoint_number $obj]