[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dbstop doesn't break with run script
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: dbstop doesn't break with run script |
Date: |
Thu, 26 May 2011 15:33:59 -0500 |
2011/5/25 John W. Eaton <address@hidden>:
> On 25-May-2011, Jordi Gutiérrez Hermoso wrote:
>
> | If you do
> |
> | dbstop foo 5
> |
> | and a breakpoint is set and later type
> |
> | run foo.m
> |
> | the breakpoint isn't hit. Is this a bug?
>
> Here's what I think is happening:
>
> When you set the breakpoint, Octave finds the function or script foo.
> If it is not already in the symbol table, it parses it, then tags the
> function's parse tree with the debug breakpoint. Then if you type
>
> foo
>
> to execute the script, Octave will find it in the symbol table and
> execute the already parsed version of the script with the debugging
> info, so you'll end up stopping at the breakpoint you set.
>
> When you use the run function to execute the script, it ultimately
> calls
>
> evalin ("caller", sprintf ("source (\"%s\");", script),
> "rethrow (lasterror ())");
>
> to evaluate "./foo.m". The source function does not look for
> "./foo.m" in the symbol table, but instead unconditionally parses the
> file and executes the resulting parse tree object, which does not have
> the debugging info attached to it.
Thanks, I opened a bug and assigned it to myself. This is a good
excuse for me to learn more about how the parser works:
https://savannah.gnu.org/bugs/?33411
- Jordi G. H.