Skip to content

Commit

Permalink
Add dummy frames
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Nov 14, 2021
1 parent e37c0d5 commit 3f8868a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions test/backtrace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,25 @@ withframeaddress
@noinline f(Ptr{Cvoid}(sp))
end

@noinline noinlinecall(f) = @noinline f()

function sandwiched_backtrace()
local ptr1, ptr2, bt
withframeaddress() do p1
ptr1 = p1
bt = ccall(:jl_backtrace_from_here, Ref{Base.SimpleVector}, (Cint, Cint), true, 0)
withframeaddress() do p2
ptr2 = p2
noinlinecall() do
bt = ccall(
:jl_backtrace_from_here,
Ref{Base.SimpleVector},
(Cint, Cint),
true,
0,
)
noinlinecall() do
withframeaddress() do p2
ptr2 = p2
end
end
end
end
return ptr1, ptr2, bt
Expand Down

0 comments on commit 3f8868a

Please sign in to comment.