This is an archive of the discontinued LLVM Phabricator instance.

[lldb-vscode] Allow an empty 'breakpoints' field to clear breakpoints.
ClosedPublic

Authored by rupprecht on Sep 29 2020, 2:39 PM.

Details

Summary

Per the DAP spec for SetBreakpoints [1], the way to clear breakpoints is: To clear all breakpoint for a source, specify an empty array.

However, leaving the breakpoints field unset is also a well formed request (note the breakpoints?: in the SetBreakpointsArguments definition). If it's unset, we have a couple choices:

  1. Crash (current behavior)
  2. Clear breakpoints
  3. Return an error response that the breakpoints field is missing.

I propose we do (2) instead of (1), and treat an unset breakpoints field the same as an empty breakpoints field.

[1] https://microsoft.github.io/debug-adapter-protocol/specification#Requests_SetBreakpoints

Diff Detail

Event Timeline

rupprecht created this revision.Sep 29 2020, 2:39 PM
Herald added a project: Restricted Project. · View Herald Transcript
rupprecht requested review of this revision.Sep 29 2020, 2:39 PM
wallace accepted this revision.Sep 29 2020, 3:42 PM

Very good! Thank you

lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py
228

you might want to add one additional breakpoint here to make the test more robust

This revision is now accepted and ready to land.Sep 29 2020, 3:42 PM
labath accepted this revision.Sep 30 2020, 6:00 AM
This revision was landed with ongoing or failed builds.Sep 30 2020, 11:33 AM
This revision was automatically updated to reflect the committed changes.
rupprecht marked an inline comment as done.