Re: JSD: Stepping by line

James Ross <[email protected]>
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
Adam Peller wrote:
> I think on each step we're also doing string comparisons against the function
> name?  This is not an exact science, since function names are often null, as is
> the case in many JS toolkits today where anonymous functions and closures are
> used.  If you've got a bunch of anonymous functions in the stack, comparing
> their names is of no value, so I wonder how accurate the stepping can be?  Same
> can be said for recursion?  This is one place where I was wondering if having JS
> Engine state could help us follow the stack.

For Step In, Venkman stores (and thus compares) the stack frame count, 
the script's filename, and the line number.

For Step Out, Venkman stores the stack depth, and waits for the call 
hook (for entering/leaving functions) to say it's leaving that stack depth.

For Step Over, Venkman uses a combination of both methods: the exact 
line and stack depth (with +1 so it catches the return into the code, 
not the return out of it).

The function name is never involved in stepping in Venkman.

Making JSD only call the interrupt hook when the line has changed would 
be helpful, but it really doesn't have much better information to make 
said decision. (And I think changing SpiderMonkey is out of the question 
here.)

-- 
James Ross <[email protected]>
ChatZilla Developer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.