Skip to content

Commit ba9691b

Browse files
authored
Expand documentation for eval mode (#254)
* Expand documentation for eval mode Includes how one exits eval mode. Fixes #253.
1 parent 4cf99c6 commit ba9691b

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ the context of functions.
3939

4040
Below, square brackets denote optional arguments.
4141

42+
All of the following commands work when the prompt is `1|debug>`:
43+
4244
Misc:
4345
- `o`: open the current line in an editor
4446
- `q`: quit the debugger, returning `nothing`
@@ -67,7 +69,6 @@ Querying:
6769
- `fr [i::Int]`: show all variables in the current or `i`th frame
6870

6971
Evaluation:
70-
- ``` `stuff ```: run `stuff` in the current function's context
7172
- `w`
7273
- `w add expr`: add an expression to the watch list
7374
- `w`: show all watch expressions evaluated in the current function's context
@@ -92,6 +93,15 @@ Breakpoints:
9293

9394
An empty command will execute the previous command.
9495

96+
Changing frames with `f i::Int` will change the prompt to `$i|debug>`.
97+
Stepping commands will not work until you return to `f 1`, but a subset of normal commands will continue to work.
98+
99+
In addition to these debugging commands, you can type `` ` `` to enter "evaluation mode" indicated by a prompt `$i|julia>`.
100+
In evaluation mode, any expression you type is executed in the debug context.
101+
For example, if you have a local variable named `n`, then once in evaluation mode typing `n` will show you the value of `n` rather than advancing to the next line.
102+
103+
Hit backspace as the first character of the line to return to "debug mode."
104+
95105
### Breakpoints
96106

97107
To add and manipulate breakpoints, either the `bp add` command in the debug interface or the JuliaInterpreter breakpoint API, documented [here](https://juliadebug.github.io/JuliaInterpreter.jl/latest/dev_reference/#Breakpoints-1)

src/commands.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ function execute_command(state::DebuggerState, ::Union{Val{:help}, Val{:?}}, cmd
270270
271271
272272
Evaluation:\\
273-
- ``` `stuff ```: run `stuff` in the current function's context\\
274273
- `w`\\
275274
- `w add expr`: add an expression to the watch list\\
276275
- `w`: show all watch expressions evaluated in the current function's context\\
@@ -294,7 +293,10 @@ function execute_command(state::DebuggerState, ::Union{Val{:help}, Val{:?}}, cmd
294293
- `bp on/off throw` - turn on or off break on throw\\
295294
296295
297-
An empty command will execute the previous command.""")
296+
An empty command will execute the previous command.
297+
298+
Hit `` ` `` to enter "evaluation mode," where any expression you type is executed in the debug context.
299+
Hit backspace as the first character of the line (or `^C` anywhere) to return to "debug mode." """)
298300
return false
299301
end
300302

0 commit comments

Comments
 (0)