Skip to content
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

[RFC] Add full support for data breakpoints #1161

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

puremourning
Copy link
Contributor

RFC - Opening this to see if you're interested in the contribution. I'm working on implementing data breakpoints in vimspector, and as always it's much easier to hack codelldb than anything else, so I implemented the extra features from DAP spec. Only lightly tested at this point.


Currently, we only provode support for data breakpoints where the request is for a child of some container using variables_reference. However, the spec includes support for:

  • an arbitrary expression, and
  • an arbitrary address, and
  • an optional size in bytes.

The later two are supported via a capability
"supportsDataBreakpointBytes". We add support for all of these options.

It's fairly trivial to evaluate an expression and do esentially what we do now for children (find the load address, check its size). But we can also accept a size, so long as it's valid watchpoint size. Similarly for addresses, if 'asAddress' is supplied we can just try to use it. It will probably fail if the address is actually invalid, but that's sort of the point.

Currently, we only provode support for data breakpoints where the
request is for a child of some container using variables_reference.
However, the spec includes support for:

- an arbitrary expression, and
- an arbitrary address, and
- an optional size in bytes.

The later two are supported via a capability
"supportsDataBreakpointBytes". We add support for all of these options.

It's fairly trivial to evaluate an expression and do esentially what we
do now for children (find the load address, check its size). But we can
also accept a size, so long as it's valid watchpoint size. Similarly for
addresses, if 'asAddress' is supplied we can just try to use it. It will
probably fail if the address is actually invalid, but that's sort of the
point.
In LLDB command line you can specify any variable and it will attempt to
create a series of watchpoints, regardless of the size of the requested
variable or range. We do the same: if a non-native size is requested,
then create N watchpoints of word-size contiguously from the base
address. If any one of them fails, delete all of them.
@vadimcn
Copy link
Owner

vadimcn commented Oct 18, 2024

Would be great to have that. These extra options were added after I implemented data breakpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants