On Tuesday, July 10, 2012 12:41:07 PM Stefan Karpinski wrote:
> As to the debugger, I don't know, but what Jeff and I had once discussed
> was having a debug mode where code is just emitted such that a debug
> callback is invoked after the evaluation of each expression. That really
> might not be much harder than writing a profiler, just by writing @debug
> begin ... end and munging the AST that @debug gets. Most of the time you
> want to just debug a particular block of code anyway, so that would be a
> good starting point.
Something along these lines was tickling at the back of my brain, too, but it
hadn't crystallized this way yet. Thanks!
But what is a "debug callback"? In particular, for "dbstop if error" I guess
the core would be something like this:
macro dbstop_one_line(ex)
quote
try
$ex
catch
keyboard # gives me a "julia-debug> " interactive prompt
end
end
end
I don't know how to write "keyboard." Hmm, I see there's a file in base/ called
"client.jl," is the answer in there?
--Tim