Debug.jl
Debug.jl copied to clipboard
Stepping into functions in other files
Adding the ability to jump into functions in other files (or included modules) would be incredibly useful. I'm thinking a way to do it would be when we hit a :call node in the AST to look for the function definition in all source files that have been included or required (including the current file) and insert the AST for the function definition into the decorated AST and replace the original :call to jump to the injected function definition rather than the compile code.
Once could even probably step into functions in modules by searching through the .julia directory.
Does this sound "easily" doable?
Just wanted to throw this out there as another idea that would make the debugger really useful for julia users.
Thanks
I'll have to give this one some thought. I agree that it would be an incredibly useful feature (and it might be the one that I've got most requests for, so far). I also think that one of the most important qualities of a debugger is that it should never change how the code behaves, and I am not sure yet if this feature can be implemented in a foolproof way.
I should add that the debugger will step into other functions and files, as long as the target is wrapped in a @debug block as well. Se also #19, where the idea was to be able to wrap code in a @debuggable macro to save the AST so that it could be instrumented later. If I attempt something like this, that is probably where I would start.
No big deal. I thought I had tried stepping into a function in another
file wrapped in @debug, but I'll try again.
Any thoughts on context printing from issue #37?
On Tue, Mar 5, 2013 at 1:12 AM, toivoh [email protected] wrote:
I'll have to give this one some thought. I agree that it would be an incredibly useful feature (and it might be the one that I've got most requests for, so far). I also think that one of the most important qualities of a debugger is that it should never change how the code behaves, and I am not sure yet if this feature can be implemented in a foolproof way.
I should add that the debugger will step into other functions and files, as long as the target is wrapped in a @debug block as well. Se also #19https://github.com/toivoh/Debug.jl/issues/19, where the idea was to be able to wrap code in a @debuggable macro to save the AST so that it could be instrumented later. If I attempt something like this, that is probably where I would start.
— Reply to this email directly or view it on GitHubhttps://github.com/toivoh/Debug.jl/issues/38#issuecomment-14425262 .
You're right, stepping into functions in other files does work as long as
they're wrapped in @debug.
With the context printing (using a slightly modified parser) the debugging experience is quite nice. No rush, but when you have a chance, let's figure out what the best course of action is for this. I determined that the julia parser only returns file information for lines in functions. One can fix this by modifying a few lines in the parser scheme file, but we should probably talk to the core guys to make sure it's done in an efficient way.
Thanks, sorry to hijack this issue.