Skip to content

Commit ccd654d

Browse files
committed
Add :sr command to step until next return.
See JuliaDebug/JuliaInterpreter.jl#558.
1 parent 75059ca commit ccd654d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ Stepping (basic):
5454
- `n`: step to the next line
5555
- `u [i::Int]`: step until line `i` or the next line past the current line
5656
- `s`: step into the next call
57-
- `so`: step out of the current cal
57+
- `so`: step out of the current call
5858
- `sl`: step into the last call on the current line (e.g. steps into `f` if the line is `f(g(h(x)))`).
59+
- `sr`: step until next `return`.
5960
- `c`: continue execution until a breakpoint is hit
6061
- `f [i::Int]`: go to the `i`-th function in the call stack (stepping is only possible in the function at the top of the call stack)
6162
- `up/down [i::Int]` go up or down one or `i` functions in the call stack

src/commands.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function show_breakpoint(io::IO, bp::BreakpointRef, state::DebuggerState)
2525
print(io, String(take!(outbuf.io)))
2626
end
2727

28-
function execute_command(state::DebuggerState, v::Union{Val{:c},Val{:nc},Val{:n},Val{:se},Val{:s},Val{:si},Val{:sg},Val{:so},Val{:u},Val{:sl}}, cmd::AbstractString)
28+
function execute_command(state::DebuggerState, v::Union{Val{:c},Val{:nc},Val{:n},Val{:se},Val{:s},Val{:si},Val{:sg},Val{:so},Val{:u},Val{:sl},Val{:sr}}, cmd::AbstractString)
2929
# These commands take no arguments
3030
kwargs = Dict()
3131
if v != Val(:u)
@@ -252,6 +252,7 @@ function execute_command(state::DebuggerState, ::Union{Val{:help}, Val{:?}}, cmd
252252
- `s`: step into the next call\\
253253
- `so`: step out of the current call\\
254254
- `sl`: step into the last call on the current line (e.g. steps into `f` if the line is `f(g(h(x)))`).\\
255+
- `sr`: step until next `return`.\\
255256
- `c`: continue execution until a breakpoint is hit\\
256257
- `f [i::Int]`: go to the `i`-th function in the call stack (stepping is only possible in the function at the top of the call stack)\\
257258
- `up/down [i::Int]` go up or down one or `i` functions in the call stack\\

0 commit comments

Comments
 (0)