From 4040a2722e0898d3ebdc08066151994b8f3c9a27 Mon Sep 17 00:00:00 2001 From: Dima Granetchi Date: Fri, 20 Dec 2024 19:01:39 +0200 Subject: [PATCH] dap: invalidate breakpoints also ignore dead contexts --- daslib/debug.das | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/daslib/debug.das b/daslib/debug.das index 9b925d6b5..0206a52d1 100644 --- a/daslib/debug.das +++ b/daslib/debug.das @@ -784,13 +784,13 @@ class private DAgent: DapiDebugAgent if withInstruments for c in contexts - if !c.ctx.category.debug_context && !ctx.ctx.category.debugger_tick + if !c.ctx.category.debug_context && !ctx.ctx.category.debugger_tick && !ctx.ctx.category.dead *c.ctx |> set_single_step(true) def reqResume(var exclude: DAContext) if withInstruments for ctx in contexts - if ctx.id != exclude.id && !ctx.ctx.category.debug_context + if ctx.id != exclude.id && !ctx.ctx.category.debug_context && !ctx.ctx.category.dead *ctx.ctx |> set_single_step(false) def onBreakpointsChanged(ini: SetBreakpointsArguments): SetBreakpointsResponse @@ -821,7 +821,7 @@ class private DAgent: DapiDebugAgent resBr.message = "{path}: instrumentation wasn't initined" for ctx in contexts - if ctx.ctx.category.debug_context || ctx.ctx.category.debugger_tick + if ctx.ctx.category.debug_context || ctx.ctx.category.debugger_tick || ctx.ctx.category.dead continue *ctx.ctx |> clear_instruments() *ctx.ctx |> instrument_node(true) <| $(ati) @@ -1091,9 +1091,7 @@ class private DAgent: DapiDebugAgent for fileBr, brs in keys(breakpoints), values(breakpoints) let baseName = fileBr |> base_name() for br in brs - let wasVerified = br.prevState == DABreakpointState Instrumented - let isVerified = br.state == DABreakpointState Instrumented - if wasVerified != isVerified + if br.prevState != br.state server->sendEvent("breakpoint", JV([[BreakpointEvent reason="changed", breakpoint=[[Breakpoint @@ -1798,7 +1796,6 @@ def wait_for_debugger() : bool sleep(10u) return true -[unused_argument(ctx)] def private start_debug_agent(var ctx: Context) g```dAgent = new DAgent() g```dAgent->initAgent(ctx) @@ -1841,12 +1838,12 @@ def private auto_start_debug() def private use_instruments() // or stepping debugger let args <- get_command_line_arguments() - return args |> find_index("--das-stepping-debugger") < 0 + return args |> has_value("--das-stepping-debugger") def private wait_debugger(): bool let args <- get_command_line_arguments() - return args |> find_index("--das-wait-debugger") >= 0 + return args |> has_value("--das-wait-debugger") def private loads_itself(): bool