Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Up>/<Down> arrow for navigating command history in debug mode between sessions #326

Open
filchristou opened this issue Feb 6, 2023 · 0 comments

Comments

@filchristou
Copy link

Currently the<Up>/<Down> arrow key can navigate throughout debug history commands but only for the current debug session.
It would be nice if the debug history commands of previous @enter ... calls were available.

Example

Let's say I define the function

function meaninglessfunc(a::T,b::T) where T
    c = zero(T)
    if a > b
        c += max(a,b)
    else
        c += min(a,b)
    end
    return c
end

And I want to debug it:

julia> @enter meaninglessfunc(5,1)
In meaninglessfunc(a, b) at /u/home/wima/fchrstou/code/julia/temp/temp.jl:15
 15  function meaninglessfunc(a::T,b::T) where T
>16      c = zero(T)
 17      if a > b

About to run: (zero)(Int64)
1|debug> bp add max
[ Info: added breakpoint for function max
1] mylittlefunc:22
2] maximum
3] max

1|debug> c
Hit breakpoint:
In max(x, y) at promotion.jl:488
>488  max(x::T, y::T) where {T<:Real} = ifelse(y < x, x, y)

About to run: (<)(1, 5)
1|debug> c
5

Next time I run a debugger, it will not remember any command history

julia> @enter meaninglessfunc(5,1)
In meaninglessfunc(a, b) at /u/home/wima/fchrstou/code/julia/temp/temp.jl:15
 15  function meaninglessfunc(a::T,b::T) where T
>16      c = zero(T)
 17      if a > b

About to run: (zero)(Int64)
1|debug> <Up-Arrow> # nothing happens

When I add a series of peculiar breakpoint to different functions and files, it would be nice that I can easily carry on this setup in consecutive debugging sessions, rather than painfully redefining them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant