Skip to content

Commit

Permalink
Add :sr command to step until next return. (#325)
Browse files Browse the repository at this point in the history
* Add :sr command to step until next return.

See JuliaDebug/JuliaInterpreter.jl#558.

* Set version to 0.7.8.
  • Loading branch information
fredrikekre authored Jan 6, 2023
1 parent e3336d2 commit 86a1170
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Debugger"
uuid = "31a5f54b-26ea-5ae9-a837-f05ce5417438"
version = "0.7.7"
version = "0.7.8"

[deps]
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
Expand Down
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

2 comments on commit 86a1170

@KristofferC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/75223

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.8 -m "<description of version>" 86a11701a17343ba3b0446e6f2053cdc33bb7e19
git push origin v0.7.8

Please sign in to comment.