DebugAdapter.jl icon indicating copy to clipboard operation
DebugAdapter.jl copied to clipboard

Unable to remove breakpoints at runtime

Open stefkuypers opened this issue 1 year ago • 2 comments

When debugging code in VS Code I can no longer remove breakpoints at runtime. The red dot next to the line disappears and the breakpoint is no longer in the list of breakpoints but the debugger still stops at the line where the breakpoint was.

I'm running VS Code 1.96.1 with Julia 1.11.2 and VS Code Julia extension 1.129.1 on Mac OS 15.1.1 on a Macbook Pro M3.

stefkuypers avatar Dec 21 '24 09:12 stefkuypers

I can't replicate this right now. Are you removing these breakpoints while the debugger is paused, or just while the program is actually running?

davidanthoff avatar Dec 21 '24 23:12 davidanthoff

Hi,I remove them while the debugger is paused. On 22 Dec 2024, at 00:47, David Anthoff @.***> wrote: I can't replicate this right now. Are you removing these breakpoints while the debugger is paused, or just while the program is actually running?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

stefkuypers avatar Dec 22 '24 06:12 stefkuypers

I have been trying to figure out what is going wrong here, but I'm a bit baffled. The inability to change breakpoints during runtime (this bug, https://github.com/julia-vscode/julia-vscode/issues/3726, and https://github.com/julia-vscode/julia-vscode/issues/3663) and the fact that the list of compiled functions/modules is simpy ignored (https://github.com/julia-vscode/julia-vscode/issues/3671) do not permit me to upgrade beyond 1.83.2 despite the many improvements and fixes in the new versions. Since now a newly-found bug in in 1.83.2 (appears to work in the current versions) also prevents me from using the old version, my interest in resolving this has again sparked. So I enabled debug logging and saved the very simple test file

function a()
    println("test1")
    println("test2")
    println("test3")
    return
end

called test.jl. Consider the following calling code.

include("test.jl")
using Logging; Logging.global_logger(Logging.ConsoleLogger(Base.CoreLogging.Debug, show_limited=false))
@run a()

Calling sequence is:

  1. Place breakpoint at line 2 (first print)
  2. @run
  3. Debugger stops in the correct line
  4. Place breakpoint at line 4 (last print)
  5. Continue
  6. v1.83.2: Debugger stops in the line / newer versions: Debug session finishes
  7. v1.83.2 only: Continue, debug session finishes
  8. Clear all breakpoints
  9. @run
  10. Both versions: Debugger stops at line 2 and at line 4, although there are no breakpoints

While there are some differences when I do a side-by-side diff of the debug output, it appears that the relevant signals arrive in the DebugAdapter as they should. This holds true both for the compiled functions as well as the breakpoints. And the set_break_points_request function is pretty simple and hardly changed between the two versions, apart from a harmless renaming. So maybe the issue is in JuliaInterpreter itself? But then, when I use Debugger.jl, I can set a breakpoint while the debug session is running and it is respected...

Attached are the two log outputs in the hope that they are helpful: log-1-83-2.txt vs log-1-138-1.txt.

projekter avatar May 04 '25 14:05 projekter