Skip to content

Commit

Permalink
Add :sr command to step until next return.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Jan 6, 2023
1 parent e3336d2 commit 3bd698e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ Stepping (basic):
- `n`: step to the next line
- `u [i::Int]`: step until line `i` or the next line past the current line
- `s`: step into the next call
- `so`: step out of the current cal
- `so`: step out of the current call
- `sl`: step into the last call on the current line (e.g. steps into `f` if the line is `f(g(h(x)))`).
- `sr`: step until next `return`.
- `c`: continue execution until a breakpoint is hit
- `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)
- `up/down [i::Int]` go up or down one or `i` functions in the call stack
Expand Down
3 changes: 2 additions & 1 deletion src/commands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function show_breakpoint(io::IO, bp::BreakpointRef, state::DebuggerState)
print(io, String(take!(outbuf.io)))
end

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)
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)
# These commands take no arguments
kwargs = Dict()
if v != Val(:u)
Expand Down Expand Up @@ -252,6 +252,7 @@ function execute_command(state::DebuggerState, ::Union{Val{:help}, Val{:?}}, cmd
- `s`: step into the next call\\
- `so`: step out of the current call\\
- `sl`: step into the last call on the current line (e.g. steps into `f` if the line is `f(g(h(x)))`).\\
- `sr`: step until next `return`.\\
- `c`: continue execution until a breakpoint is hit\\
- `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)\\
- `up/down [i::Int]` go up or down one or `i` functions in the call stack\\
Expand Down

0 comments on commit 3bd698e

Please sign in to comment.