-
Notifications
You must be signed in to change notification settings - Fork 87
debug: fallback to mark breakpoints verified on stopped/breakpoint events #1989
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
base: main
Are you sure you want to change the base?
debug: fallback to mark breakpoints verified on stopped/breakpoint events #1989
Conversation
award999
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amanthatdoescares thanks so much for the PR 🙏 I have some initial comments here to get you started. @matthewbastien is more familiar with the debugging codebase so let's have him take a look to.
Also the open todo for updating changelog in the PR template, you just need to do something like 85d5132, but this being a bug fix, you'd put it under the ### Fixed section for the latest release.
Co-authored-by: award999 <[email protected]>
matthewbastien
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this! I just have some minor comments to make the code easier to read.
| } | ||
|
|
||
| // Force a UI refresh so the breakpoint shows as installed. | ||
| vscode.debug.removeBreakpoints([bp]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Will this also trigger when the breakpoint is already resolved? It's probably not a huge issue, but I think we should be only doing this when the breakpoint that's being hit isn't marked as resolved.
|
|
||
| ### Fixed | ||
|
|
||
| - Fix breakpoint filtering fallback in debugger logging ([#1989](https://github.com/swiftlang/vscode-swift/pull/1989)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chore: You'll have to rebase this since the CHANGELOG was recently updated for version 2.14.2. This may require moving this bullet to a new ### Fixed section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do — I’ll rebase and move the entry to the current unreleased ### Fixed section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The location looks good now.
Though I just noticed that the wording here would only be meaningful to contributors and probably won't make much sense to users of the extension. Maybe we could go with something like Fixed breakpoints showing up as unresolved when using lldb-dap?
Co-authored-by: Matthew Bastien <[email protected]>
Removed version 2.14.2 entry and its fixed items from the changelog.
Added a note about using the JSON schema for editing config.json and fixed breakpoint filtering in debugger logging.
|
@amanthatdoescares I tried this out locally with Swift 6.2.0 and it looks like the logic isn't working. My breakpoint is not being resolved despite the debug session stopping at the breakpoint. Debugging through the tracker code you added shows that the breakpoint coming from the DAP does not have a source path and so the code is just ignoring it. What version of Swift did you test this with locally? There might be some differences in I'd like some integration tests to be added for this before we can merge. Preferably by starting a debugging session with a breakpoint and then making sure that it gets resolved once hit. |
|
@matthewbastien Thanks for the detailed review. After looking at it again, I realized I completely missed the real issue. My fallback logic only handles the happy case where the DAP breakpoint includes a source.path, and I didn’t actually test the scenario you ran into — the one where the adapter sends a breakpoint without a path. So the code ends up ignoring exactly the situation it was supposed to fix. Definitely a blooper on my part. It’s clear now that this isn’t an environment/version difference — the logic just isn’t handling the missing-path case at all.
I’ll update the PR once I’ve got the full flow working as intended. Thanks again for pointing out. |
Description
LLDB-DAP sometimes fails to mark breakpoints as verified in the
setBreakpointsresponse, even though the breakpoint is hit during debugging. This leads to the VS Code UI showing the breakpoint as “unverified” while execution actually stops there.This PR adds a safe fallback that marks breakpoints as verified when we detect them being hit via:
stoppedevent withreason: "breakpoint", orbreakpointevent containing a valid source and line.This improves consistency between actual debugger behavior and the UI, especially for Swift executables and
swift test.Issue: #1871
Tasks
[ ] Documentation has been updated