Skip to content

Commit 61867d4

Browse files
committed
Add basic docs for data breakpoints
1 parent 252d949 commit 61867d4

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,28 @@ then answer `Y` to that (for example).
10571057
You can configure your choices in the `.vimspector.json`. See
10581058
[the configuration guide][vimspector-ref-exception] for details on that.
10591059

1060+
### Data breakpoints
1061+
1062+
Data breakpoints are not supported by all debug adapters. They are breakpoints
1063+
which trigger when some memory is read or written. They can be created:
1064+
1065+
- For a given variable in the variables window (`<F9>` on variable)
1066+
- For a given child variable in the watches or variables windows
1067+
(`<F9>` on child variable)
1068+
- For an arbitrary expression which evaluates to an address (`<F9>` in watch
1069+
window, not on any variable)
1070+
1071+
When specifying an expression, you can also specify a size.
1072+
1073+
In general, if you hit `<F9>` (or whatever mapping you have) in the Variables or
1074+
Watch window, you'll be adding a Data Breakpoint. If the context looks like a
1075+
variable, then Vimspector will ask the debug adapter to create a data breakpoint
1076+
on that variable expression. Otherwise, you'll be asked to enter an expression,
1077+
or an address and a size, depending on the capabilities of the debugger.
1078+
1079+
NOTE: Not all debug adapters support data breakpoints, and the ability to
1080+
actually create them often depends on the hardware of the target.
1081+
10601082
### API Summary
10611083

10621084
***NOTE:*** Previously, ToggleBreakpoint would cycle between 3 states:
@@ -1082,6 +1104,7 @@ deletes a breakpoint. If you wish to 'disable' breakpoints, use the
10821104
* `call vimspector#ListBreakpoints()` - toggle breakpoints window
10831105
* `call vimspector#BreakpointsAsQuickFix()` - return the current set of
10841106
breakpoints in vim quickfix format
1107+
* `call vimspector#AddDataBreakpoint()` - add a data breakpoint
10851108

10861109
Examples:
10871110

@@ -1209,6 +1232,7 @@ autocmd SessionLoadPost * silent! VimspectorLoadSession
12091232
* View the type of the variable via mouse hover.
12101233
* When changing the stack frame the locals window updates.
12111234
* While paused, hover to see values.
1235+
* Create a data breakpoint with `<F9>`.
12121236

12131237
![locals window](https://puremourning.github.io/vimspector-web/img/vimspector-locals-window.png)
12141238

@@ -1259,6 +1283,7 @@ to add a new watch expression.
12591283
* Set the value of the variable with `<C-CR>` (control + `<CR>`) or
12601284
`<leader><CR>` (if `modifyOtherKeys` doesn't work for you)
12611285
* Delete with `<DEL>`.
1286+
* Create a data breakpoint with `<F9>`.
12621287

12631288
![watch window](https://puremourning.github.io/vimspector-web/img/vimspector-watch-window.png)
12641289

python3/vimspector/debug_session.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,6 @@ def add_bp( conn, name, msg ):
10661066
con, arguments = self._variablesView.GetDataBreakpointInfoRequest(
10671067
buf,
10681068
line_num )
1069-
# TODO: in theory, we could specify a bytes (size) option here, but I sort
1070-
# of doubt that anyone actually implements that.
10711069

10721070
if not con:
10731071
# No watch variable was found, so enter an expression and pass it in

0 commit comments

Comments
 (0)