-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A fine debugger #23
A fine debugger #23
Conversation
working on it
insert all the needed breaks in the detailed IR (broken) insert all the needed breaks in the detailed IR
cd8abe0
to
006d659
Compare
If anyone would care to give this a quick review, that would be appreciated. It is basically working, It would be good to merge this, rather than continuing to add features to thiis PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very intriguing, @oxinabox! I can't pretend I understand this yet, but it looks like an interesting approach. Doing this kind of thing was the first thing I thought of when I first heard about Cassette, but I still haven't taken the plunge yet.
How's the run-time performance of the instrumented code? Over at JuliaInterpreter we're a lot slower than compiled code; I'm sure this is slower too, but it would be interesting to compare the magnitudes. My naive guess is this might be slower to compile but faster to run? (We have also thought about creating "compiled Frames," but that's in the future.)
We're gearing up for a release announcement of our debugger stack. How close is this? Would you be interested in making a discourse announcement at around the same time? Or is this still too much of a research project?
if mdata === nothing | ||
error( | ||
"According to CodeTracking.jl $mod is not loaded. " * | ||
"Revise.jl might be malfuncting." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be happy to work with you on this. Do you have a reproducible trigger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, I added that when I was seeing Nothing
related errors. I think on CI.
I'll let you know when I do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may have been a Standard Library.
As of the commit i just made we now attempt to do Revise.track(mod)
if pkgfiles
comes up with nothing
|
||
function containing_methods(file, linenum) | ||
#TODO: raise issue on CodeTracking.jl to expose public way | ||
# to get list of all loaded modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use Base.loaded_modules
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is that includes standard libraries, which are not tracked by default.
And that is probably a wise choice by Revise?
I've only just started some basic timings (using Optimum solving Rossenbock). Not great, I can get maybe down to 2 orders of magnitude of the original code, if I I have a feeling I am breaking compilation caching, since it is no faster the second time I run anything. Also that I should implement my own cache for the instrumentation step. |
When this PR is merged, I think it will be time for an announcement. There are some other thing I want to do that I don't want to put in this PR, like the ability to go back-up the callstack and read variables. Which shouldn't be too hard. Long term, I hope this can be complentairy to your work on Debugger.jl. I really need to catch up on the state of Debugger.jl |
The real guts are in JuliaInterpreter.jl; as of this morning there are some fairly decent docs, though a bit forward-looking since none of Debugger/Rebugger/Juno have released & tagged versions that support it (but Debugger.jl has it on master, and Rebugger on timholy/Rebugger.jl#61). Debugger.jl can be thought of as "just a REPL mode," i.e., the UI part. Rebugger.jl has (on that branch) a |
One option would be for you to implement the |
Further timing actually shows I am Normally calling: 1.318972 seconds (4.85 M allocations: 244.061 MiB, 9.40% gc time) With using 5.116838 seconds (17.96 M allocations: 921.936 MiB, 5.17% gc time) So it is indeed faster after compiling.
I tried this. It didn't work. |
Ok, that last cruicial feature is in. Thanks to @timholy's fixes for random files outside of packages in CodeTracking 0.4.0. |
This combines #14 and #19
I've just done the merge on this branch rather than master as neither felt complete without the other.
When this is complete one will have a debugger that works with line-numbers.