mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.1k stars 179 forks source link

"Wait for breakpoint" Triggered break points #1152

Open s1n7ax opened 5 months ago

s1n7ax commented 5 months ago

Problem Statement

VSCode added a new break point type called "Wait for Breakpoint" which basically only will be stopped if the debugger is stopped at selected break point first.

Steps:

When running, debugger will not stop at line 20 until line the debugger stops at the line 10 debug point.

for(i = 0; i < 10; i++) {
    if(i == 5) {
        console.log('first breakpoint')
    }

    console.log('second breakpoint')
    // ^^^ here we set the "Wait for Breakpoint" type breakpoint. Until the debugger stops at
    // `first breakpoint` debugger will not stop at the `second breakpoint`
}

Possible Solutions

No response

Considered Alternatives

No response

mfussenegger commented 4 months ago

Some kind of dependent breakpoint support is on the roadmap but I'm not sure yet how it should work like from a UI/interaction point of view.

Intellij has the feature as well, but the couple of times I could've used it I ended up manually setting the first breakpoint, wait until it is hit, and then set the other breakpoint. In part because the effort to set it up was similar and I'm not sure how it can be improved. A thought I had was to allow attaching arbitrary actions to a breakpoint - including macros. But that still doesn't make it much better than setting the second breakpoint manually after the first one was hit.