Skip to content

Commit b7f8d0e

Browse files
authored
add support for stepping into the last line of a call (#310)
1 parent a16efd2 commit b7f8d0e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ 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 call
57+
- `so`: step out of the current cal
58+
- `sl`: step into the last call on the current line (e.g. steps into `f` if the line is `f(g(h(x)))`).
5859
- `c`: continue execution until a breakpoint is hit
5960
- `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)
6061
- `up/down [i::Int]` go up or down one or `i` functions in the call stack

src/commands.jl

Lines changed: 3 additions & 2 deletions
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}}, 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}}, cmd::AbstractString)
2929
# These commands take no arguments
3030
kwargs = Dict()
3131
if v != Val(:u)
@@ -36,7 +36,7 @@ function execute_command(state::DebuggerState, v::Union{Val{:c},Val{:nc},Val{:n}
3636
cmd = args[1]
3737
if length(args) == 2
3838
line = tryparse(Int, args[2])
39-
line == nothing && return invalid_command(state, cmd)
39+
line === nothing && return invalid_command(state, cmd)
4040
kwargs = Dict(:line => line)
4141
end
4242
end
@@ -251,6 +251,7 @@ function execute_command(state::DebuggerState, ::Union{Val{:help}, Val{:?}}, cmd
251251
- `u [i::Int]`: step until line `i` or the next line past the current line\\
252252
- `s`: step into the next call\\
253253
- `so`: step out of the current call\\
254+
- `sl`: step into the last call on the current line (e.g. steps into `f` if the line is `f(g(h(x)))`).
254255
- `c`: continue execution until a breakpoint is hit\\
255256
- `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)\\
256257
- `up/down [i::Int]` go up or down one or `i` functions in the call stack\\

0 commit comments

Comments
 (0)