Fix type of DAP hitCondition

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.
This commit is contained in:
Tom Tromey
2023-05-24 14:24:13 -06:00
parent 596c507f5d
commit 32594d975a
2 changed files with 8 additions and 5 deletions

View File

@ -95,10 +95,13 @@ def _set_breakpoints_callback(kind, specs, creator):
# 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))