Is there a way to show the functions called inside a function like in the stacktrace of error messages, even if the function returns successfully?
In other words, I would like to see something like [1]–[6] in the following error message, from the start to the end of a function call:
julia> broadcast(+, [1 2; 3 4], [1 2; 3 4; 5 6])
ERROR: DimensionMismatch("arrays could not be broadcast to a common size")
Stacktrace:
[1] _bcs1(::Base.OneTo{Int64}, ::Base.OneTo{Int64}) at ./broadcast.jl:70
[2] _bcs at ./broadcast.jl:63 [inlined]
[3] broadcast_shape at ./broadcast.jl:57 [inlined] (repeats 2 times)
[4] broadcast_indices at ./broadcast.jl:53 [inlined]
[5] broadcast_c at ./broadcast.jl:311 [inlined]
[6] broadcast(::Function, ::Array{Int64,2}, ::Array{Int64,2}) at ./broadcast.jl:434
I need this capability to debug semantic errors by showing all the functions visited and examine what went wrong. Currently I’m achieving this by successively calling which
.