JuliaDebug / JuliaDebug/Cthulhu.jl
Display preferences should persist between levels
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 709
- Forks
- 46
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 2
Description
When I set my display preference to Source, or AST, if I then descend further, I expect to retain the display preference. Example of this not working properly:
julia> using Cthulhu
julia> @noinline function bar(x)
return sqrt(x)
end
function foo(x)
x = x * 2
return bar(x) * x
end
foo (generic function with 1 method)
julia> @descend foo(1.0)
foo(x) @ Main REPL[36]:5
∘ ─ %0 = invoke foo(::Float64)::Float64
6 1 ─ %1 = Base.sitofp(Float64, 2)::Float64 │╻╷╷╷╷ *
│ %2 = Base.mul_float(x@_2, %1)::Float64 ││╻ *
7 │ %3 = invoke Main.bar(%2::Float64)::Float64 │
│ %4 = Base.mul_float(%3, %2)::Float64 │╻ *
└── return %4 │
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [o]ptimize, [w]arn, [h]ide type-stable statements, [d]ebuginfo, [r]emarks, [e]ffects, [i]nlining costs, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
Advanced: dump [P]arams cache.
• %3 = invoke bar(::Float64)::Float64
↩
function foo(x)
x = x * 2
return bar(x) * x
end
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [o]ptimize, [w]arn, [h]ide type-stable statements, [d]ebuginfo, [r]emarks, [e]ffects, [i]nlining costs, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
Advanced: dump [P]arams cache.
• %3 = invoke bar(::Float64)::Float64
↩
bar(x) @ Main REPL[36]:1
∘ ─ %0 = invoke bar(::Float64)::Float64
2 1 ─ %1 = Base.lt_float(x, 0.0)::Bool │╻╷ sqrt
└── goto #3 if not %1 ││
2 ─ invoke Base.Math.throw_complex_domainerror(:sqrt::Symbol, x::Float64)::Union{} ││
└── unreachable ││
3 ─ %5 = Base.Math.sqrt_llvm(x)::Float64 ││
└── goto #4 ││
4 ─ return %5 │
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [o]ptimize, [w]arn, [h]ide type-stable statements, [d]ebuginfo, [r]emarks, [e]ffects, [i]nlining costs, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
Advanced: dump [P]arams cache.
• %3 = invoke throw_complex_domainerror(::Symbol,::Float64)::Union{}
↩
This is using Cthulhu v2.7.6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the example with Cthulhu v2.7.6 using @descend, selecting Source or AST, and descending through multiple levels. Trace where the display preference is stored and passed during descent; done means the selected preference remains active at each deeper level.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100