Find where a specific method gets called

backtrace was indeed the word I was looking for, thanks for pointing me in that direction!

I do the following now

function Base.*(a::MyType, b::MyType)
    tr = backtrace()
    Base.show_backtrace(stdout, tr[1:2]) # I don't need the whole trace
    return dostuff(a, b)
end

which has the advantage that execution does not stop and prints only the interesting part of the stacktrace.

2 Likes