test and doc updates for conditional breakpoints

use a better description of hit condition and describe the options dict.
This commit is contained in:
Ben Jackson 2020-04-26 11:14:44 +01:00
commit 77dc400077
5 changed files with 218 additions and 9 deletions

View file

@ -517,7 +517,7 @@ let g:vimspector_enable_mappings = 'HUMAN'
| `F4` | Restart debugging with the same configuration. | `vimspector#Restart()` |
| `F6` | Pause debugee. | `vimspector#Pause()` |
| `F9` | Toggle line breakpoint on the current line. | `vimspector#ToggleBreakpoint()` |
| `<leader>F9` | Toggle conditional line breakpoint on the current line. | `vimspector#ToggleBreakpoint( {condition, hit condition } )` |
| `<leader>F9` | Toggle conditional line breakpoint on the current line. | `vimspector#ToggleBreakpoint( { trigger expr, hit count expr } )` |
| `F8` | Add a function breakpoint for the expression under cursor | `vimspector#AddFunctionBreakpoint( '<cexpr>' )` |
| `F10` | Step Over | `vimspector#StepOver()` |
| `F11` | Step Into | `vimspector#StepInto()` |
@ -530,6 +530,8 @@ let g:vimspector_enable_mappings = 'HUMAN'
* Create `vimspector.json`. See [below](#supported-languages).
* `:call vimspector#Launch()` and select a configuration.
![debug session](https://puremourning.github.io/vimspector-web/img/vimspector-overview.png)
### Launch with options
To launch a specific debug configuration, or specify [replacement
@ -562,16 +564,35 @@ debugger](#java---partially-supported)
## Breakpoints
* Use `vimspector#ToggleBreakpoint([ { 'condition': '<condition>' } ])`
* Use `vimspector#ToggleBreakpoint([ { 'condition': '<condition expr>' } ])`
to set/disable/delete a line breakpoint, with optional condition.
* Use `vimspector#AddFunctionBreakpoint( '<name>' [, { 'condition': '<condition>' } ] )`
* Use `vimspector#AddFunctionBreakpoint( '<name>' [, { 'condition': '<condition expr>' } ] )`
to add a function breakpoint with optional condition.
Both of these functions take a single optional argument which is a dictionary of
options. The dictionary can have the following keys:
* `condition`: An optional expression evaluated to deterimie if the breakpoint
should fire. Not supported by all debug adapters. For example, to break when
`abc` is `10`, enter something like `abc == 10`, depending on the language.
* `hitCondition`: An optional expression evaluated to determine a number of
times the breakpoint should be ignored. Should (probablty?) not be used in
combination with `condition`. Not supported by all debug adapters. For
example, to break on the 3rd time hitting this line, enter `3`.
In both cases, the expression is evaluated by the debugger, so should be in
whatever dialect the debugger understands when evaluating expressions.
When using the `<leader><F9>` mapping, the user is prompted to enter these
expressions in a command line (with history).
## Stepping
* Step in/out, finish, continue, pause etc. using the WinBar.
* Step in/out, finish, continue, pause etc. using the WinBar, or mappings.
* If you really want to, the API is `vimspector#StepInto()` etc.
![code window](https://puremourning.github.io/vimspector-web/img/vimspector-code-window.png)
## Variables and scopes
* Current scope shows values of locals.
@ -579,6 +600,8 @@ debugger](#java---partially-supported)
* When changing the stack frame the locals window updates.
* While paused, hover to see values
![locals window](https://puremourning.github.io/vimspector-web/img/vimspector-locals-window.png)
## Watches
The watches window is a prompt buffer, where that's available. Enter insert mode
@ -591,11 +614,15 @@ to add a new watch expression.
* Expand result with `<CR>`.
* Delete with `<DEL>`.
![watch window](https://puremourning.github.io/vimspector-web/img/vimspector-watch-window.png)
## Stack Traces
* In the threads window, use `<CR>` to expand/collapse.
* Use `<CR>` on a stack frame to jump to it.
![stack trace](https://puremourning.github.io/vimspector-web/img/vimspector-callstack-window.png)
## Program Output
* In the outputs window use the WinBar to select the output channel.
@ -604,6 +631,8 @@ to add a new watch expression.
* The debugee prints to the stdout channel.
* Other channels may be useful for debugging.
![output window](https://puremourning.github.io/vimspector-web/img/vimspector-output-window.png)
### Console
The console window is a prompt buffer, where that's available, and can be used