So we actually do have the tools to do liine based breakpoints already.
It is just a matter of assembliing them.
so ir,codelocs maps from index in ir.code to index in ir.linetable.
And ir.linetable basically has all the line number / file / etc stuff one could ever want.
Overall, we need to build (possibly lasily) a map of where methods are defined.
This will give us File+ Line Number -> Method. We see an overdub on that method.
Then we search though ir.linetable / ir.codelocs to find the first (or last?) statement index iine that line, and we then use a Cassette @pass to insert a call to break_action there.
It is possible that it some of the parts of this would be better living in CodeTracking.jl than here.
So we actually do have the tools to do liine based breakpoints already. It is just a matter of assembliing them.
so
ir,codelocs
maps from index inir.code
to index inir.linetable
. Andir.linetable
basically has all the line number / file / etc stuff one could ever want.We also need to link in to Revise.jl or CodeTracking.jl So things are correct after Revise screws wtih the line numbers See https://github.com/timholy/Revise.jl/issues/236
Overall, we need to build (possibly lasily) a map of where methods are defined. This will give us File+ Line Number -> Method. We see an
overdub
on that method. Then we search thoughir.linetable
/ir.codelocs
to find the first (or last?) statement index iine that line, and we then use a Cassette@pass
to insert a call tobreak_action
there.It is possible that it some of the parts of this would be better living in CodeTracking.jl than here.