Skip to content

Commit

Permalink
Merge pull request #1440 from profelis/master
Browse files Browse the repository at this point in the history
dap: invalidate breakpoints
  • Loading branch information
borisbat authored Dec 20, 2024
2 parents 64d3b28 + 4040a27 commit 6f83ad1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions daslib/debug.das
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6f83ad1

Please sign in to comment.