Juno Debugger can't show source code, only lowered code

debug
#1

I’m trying to get used to the new Debugger in Juno and I encountered many cases where it is unable to show me the source code, only the lowered code, which is less intuitive (at least for me) to track where I am. I have encountered the problems for many functions, but an example would be:

function h1()
    x = 2
    return x
end

function h2()
    j = 0
    for i in 1:10
        j += i
    end
end

@enter h1() ## everything goes fine, source code
@enter h2() ## not anymore, lowered code

Sometimes there is a warning that the source code could not be found, sometimes not.
Is there a reason why this happens and a way to fix it, or good habits to have?

Many thanks,

#2

Have you saved the file before trying to debug functions in it?

1 Like
#3

Oh my bad… I thought interpreting the functions again would suffice, so it’s really based on the file content…? Am I being particularly stupid or would this need to be documented somewhere? (Maybe it is already and I’ve missed it…?)

Anyway, thanks a lot @kristoffer.carlsson!

#4

Yes, the file has the source code that we read.

1 Like
#5

Ok makes sense, I thought that Juno also had the source code stored somewhere and was able to send it to the Debugger. Anyway thanks again!