Please add a feature to "Add data breakpoint" (at least?) for the C and C++ language.
Ideally, this would be available both by:
We will start exploring this in November
corresponding DAP proposal: https://github.com/Microsoft/debug-adapter-protocol/issues/20
What we plan to do:
The plan sounds great!
Regarding the UX:
Data breakpoints with a condition, hit count and log:
@britalmeida thanks for the feedback.
I wanted to add a link to https://github.com/Microsoft/vscode/issues/55931, because it's been marked as closed, but essentially, it is talking about the same thing.
@weinand : will 'Data Breakpoint' will be part of the February 2019 VS Code release ? If not, when is it planned for ?
The VS Code UI for Data Breakpoints is planned for March or April. But don't hold your breath...
In addition debugger extensions will have to provide backend support for Data Breakpoints.
We don't know when this will happen.
What we plan to do in August:
We support a new breakpoint type "data" which will be shown in the breakpoints view with a new icon (tbd). Data breakpoints optionally have a condition, a hit count, and support logPoints but currently VS Code has no UI to edit these attributes outside the source editor.
In the initial implementation data breakpoints only exist while a debug session is active (which means that data breakpoints are not persisted across debug sessions).
Only if a DA has a supportsDataBreakpoints capability, will VS Code use the data breakpoint specific DAP requests.
A data breakpoint can be created via a context menu action in the Variable view. The variable's reference and name is passed to the DAP request dataBreakpointInfo to determine whether the variable supports a data breakpoint. If successful the response provides an ID, a UI, and a set of access types for the data breakpoint. Also returned is a canPersist attribute that we will ignore in the initial implementation. The data breakpoint is shown in the breakpoints view with its UI name. We have to decide what to do with the access types. For the initial implementation I suggest that we just support the write access type (since that's the most useful anyways).
Data breakpoints are registered with the DA via the setDataBreakpoints request (which works similar to the setFunctionBreakpoints request).
Hitting a data breakpoint stops the program and a reason "data breakpoint" is shown in the Stacktrace view and the data breakpoint's name is shown when in the hover. Ideally we could show this information in the source as well (like we do for exceptions). Here is what VS shows in this situation:

Additional Info:
The DAP spec can be found here: https://github.com/microsoft/debug-adapter-protocol/issues/20
@isidorn I've created a mock implementation of data breakpoints in a branch of vscode-mock-debug: https://github.com/microsoft/vscode-mock-debug/tree/aweinand/databreakpoints
Thanks a lot. I'll pick this up and add UI.
I pushed an initial version of data breakpoints via https://github.com/microsoft/vscode/commit/a7cc79a55439bce5ea2e173b4d46655bdebe79a9
Initialy this seems to work fine for me with the Mock Debug.
This still needs quite some testing. So on Monday I plan to verify:
canPersist flag is present@weinand can you please check the changes in the EH area where I introduced a new type DataBreakpoint
@misolori we introduced data breakpoints. You can read more about them in this issue: basically a user sets them for a variable and the breakpoint gets hit when that variable gets modified.
Since we already have special icons for function breakpoints. We also need a new icon for data breakpoints.
Since we already use a triangle and a circle. Maybe we go with a square?
Is it possible that you design some icon for data breakpoints?
Here's a picture where data breakpoints would be seen in the breakpoints view

If a debug adapter supports data breakpoints it is possible to add them via the context menu on a variable in the VARIABLES view.
I have added code that data breakpoints get cleared when the session ends.
So the only thing for this milestone which we plan to add is the data breakpoint icon with @misolori
@gregg-miskelly @pieandcakes @WardenGnaw you can try out data breakpoints in latest VS Code insiders and let us know what you think.
Currently we just decorate the CALL STACK view with the reason which can be stopped on data breakpoint.
For a clearer indication for the user we have two options for the future:
Reval Active File in Side Bar)The first option we could easily do and it is pretty generic, as we would just show the description of the Data Breakpoint or some other field that we agree upon.
The second option is more tricky as it would need a stricter relationship between a data breakpoint and a variable. VS Code would have to be notified of the whole parent chaing of the variable in order to be able to expand all the elements. This stricter relationship would also help us to add some Data Breakpoint actions in the EXPRESSIONS view. Downside of this is that data breakpoints would get more tied to the variables, and in practice I am not sure if that is always the case in your debug extensions.
Currently it is not possible to add conditions and hit counts to data breakpoints. We can look into adding this in the future.
It is also not possible to add explicitly the adress - we could easily add this action to the breakpoints view if we decide we need it.
Let me know what you think and thanks
Closing since we have tackled this initialy in this milestone.
For additional improvments we will file new feature requests.
Most helpful comment
If a debug adapter supports data breakpoints it is possible to add them via the context menu on a variable in the VARIABLES view.
I have added code that data breakpoints get cleared when the session ends.
So the only thing for this milestone which we plan to add is the data breakpoint icon with @misolori
@gregg-miskelly @pieandcakes @WardenGnaw you can try out data breakpoints in latest VS Code insiders and let us know what you think.
Currently we just decorate the CALL STACK view with the reason which can be
stopped on data breakpoint.For a clearer indication for the user we have two options for the future:
Reval Active File in Side Bar)The first option we could easily do and it is pretty generic, as we would just show the description of the Data Breakpoint or some other field that we agree upon.
The second option is more tricky as it would need a stricter relationship between a data breakpoint and a variable. VS Code would have to be notified of the whole parent chaing of the variable in order to be able to expand all the elements. This stricter relationship would also help us to add some Data Breakpoint actions in the EXPRESSIONS view. Downside of this is that data breakpoints would get more tied to the variables, and in practice I am not sure if that is always the case in your debug extensions.
Currently it is not possible to add conditions and hit counts to data breakpoints. We can look into adding this in the future.
It is also not possible to add explicitly the adress - we could easily add this action to the breakpoints view if we decide we need it.
Let me know what you think and thanks