Keno / ASTInterpreter.jl

Gallium's AST interpreter as a separate package to simplify development
Other
16 stars 10 forks source link

Specific use-case #53

Open quinnj opened 8 years ago

quinnj commented 8 years ago

So every once in a while I need to debug an error or segfault in ODBC and it's currently pretty painful because I have to manually step through so many levels of code (user-level, lower-level, API level, etc.). One use-case I thought of watching the presentation today would involve doing something like:

@enterall ODBC.query("select * from table") > output.debug

which would effectively do @enter, then prehood fr v to print the current frame variables for every frame, then si through every frame. Obviously this would generate huge walls of text as you're literally stepping in and through every call and printing the variables at each step, but sometimes that's almost what I want anyway when debugging some hard-to-find segfault. I could print it out and read it on the train in the morning :)

Anyway, I thought I'd post in case this is already trivial or if there's a quick pointer on how to write something like this if only for my own use.

Keno commented 8 years ago

The debugger is quite easily scriptable, so this is quite doable. If it's a segfault though, I may have something better for you assuming you're using Linux.

quinnj commented 8 years ago

I'm on OSX usually, but have access to a linux box. Any pointers on scripting the debugger?

Keno commented 8 years ago

There should be a cleaner API but check in test/stepping.jl