Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dap: invalidate breakpoints #1440

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading