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

Possibility do add data breakpoints #58304

Open
britalmeida opened this Issue Sep 9, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@britalmeida
Copy link

britalmeida commented Sep 9, 2018

Please add a feature to "Add data breakpoint" (at least?) for the C and C++ language.

Ideally, this would be available both by:

  • entering an address or variable name in the breakpoints panel, and
  • right-click a variable within the code and "Add data breakpoint".

@weinand weinand added this to the On Deck milestone Nov 7, 2018

@weinand

This comment has been minimized.

Copy link
Member

weinand commented Nov 12, 2018

We will start exploring this in November

@weinand weinand modified the milestones: On Deck, November 2018 Nov 12, 2018

@kieferrm kieferrm referenced this issue Nov 12, 2018

Closed

Iteration Plan for November 2018 #62876

35 of 45 tasks complete
@weinand

This comment has been minimized.

Copy link
Member

weinand commented Nov 26, 2018

corresponding DAP proposal: Microsoft/debug-adapter-protocol#20

@weinand

This comment has been minimized.

Copy link
Member

weinand commented Dec 3, 2018

What we plan to do:

  • we support a new breakpoint type "data" which will be shown in the breakpoints view with a new icon
  • a data breakpoint can be created via a context menu action in the Variables and Watches view
  • data breakpoints have condition, hit count, and logPoints attributes (and the implementation provides information about what attributes are supported).
  • hitting a data breakpoint stops the program and the reason is shown in the Stacktrace.
  • initially a data breakpoint is defined by an expression and as such has no source location (in this respect it is similar to a function breakpoint). In the future it might become possible to set data breakpoints directly in the source and to show them in the gutter.

@weinand weinand modified the milestones: November 2018, On Deck Dec 3, 2018

@britalmeida

This comment has been minimized.

Copy link
Author

britalmeida commented Dec 3, 2018

The plan sounds great!

Regarding the UX:

  • it would be nice to be able to add a data breakpoint for a variable, also by right-clicking it on the source code directly. Otherwise, there is an extra step of having to add the variable to the Watches first.
  • it would also be nice to be able to enter an address manually, instead of just a variable name. This action is usually available on the breakpoints panel.
  • I can't immediately see a case where it would be helpful to see data breakpoints in the gutter. I would expect to see breaks for the flow there, but a data breakpoint would potentially show in many places. A common case of setting a data breakpoint is because it is not known when/where the data is changing, or it may be getting trampled by something else.

Data breakpoints with a condition, hit count and log:

  • this sounds super powerful! I can already see the use of checking when a variable is cleared or set to a specific value ^^
  • mind that logpoints are currently not working in C++ -> Microsoft/vscode-cpptools#2862
@weinand

This comment has been minimized.

Copy link
Member

weinand commented Dec 3, 2018

@britalmeida thanks for the feedback.

  • if you read my proposal carefully, you will find that I already mention "setting data breakpoints directly".
  • VS Code will never deal with "addresses". It only sends strings to the backend and the backend can decide what to do with it.
  • VS Code provides the UI, but not the implementation in the backend. So the conditions, hit counts and log points are only powerful, if a debugger extension is able to implement them. So please don't hold your breath...
@smorin-primero

This comment has been minimized.

Copy link

smorin-primero commented Jan 16, 2019

I wanted to add a link to #55931, because it's been marked as closed, but essentially, it is talking about the same thing.

@fredijude

This comment has been minimized.

Copy link

fredijude commented Feb 14, 2019

@weinand : will 'Data Breakpoint' will be part of the February 2019 VS Code release ? If not, when is it planned for ?

@weinand

This comment has been minimized.

Copy link
Member

weinand commented Feb 14, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment