Reading local variables at_exit

Discussion in 'Ruby' started by Andreas Lundgren, Sep 16, 2011.

  1. Hi!

    I'm writing a slim Ruby Debugger using the set_trace_function.

    For each line that are stepped, I can find local variables using the
    binding object in the set_trace_func. I only update the variables in
    the GUI when the code is stepped or pauesd at a breakpoint, not when
    running free.

    However, when the debuggd scripts exits, I would like to do a final
    update of all variables in the GUI. If the script was running free
    since the last breakpoint, variable that was updated at last
    breakpoint must be updated again in the GUI when the program exits.

    Is it possible to reach local variables from the block where the code
    exited in the "at_exit" proc ?

    Code: Event: GUI
    a=1 RUN Not updated
    a=2 RUN Not updated
    a=3 BREAKPOINT Gui is updated with "a=3"
    a=4 RUN Not updated
    a=5 RUN Not updated
    a=6 EXIT Here I want the GUI to update with

    Andreas Lundgren
    Andreas Lundgren, Sep 16, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.