Re: Partial solution to debugging eval() code

"John J. Barton" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
James Ross wrote:
> If you want to try being clever, would it not be possible to - from the 
> stack frame - work out the eval line number by subtracting the offset of 
> the call above it? I still think SpiderMonkey needs to fix this by 
> numbering the eval lines from 1 and not line-of-call. :)
> 

The eval line number relative to the eval source isn't useful unless we
have the eval source.  Numbering the eval lines from 1 would just shift
the problem from one random-looking location to another ;-).

But the real problem with these solutions is that the stack containing
the offsets is only available when eval() is called, while the code that
one wants to debug is called at any time later.  So we have foo() from
and eval that looks like it came from file bootstrap.js:240.   But we
don't have the source containing foo() declaration and we don't know
how many nested eval()s came between bootstrap.js:240 and the eval()
that spawned foo().

Or so I think now.  Maybe I'll look to see if this fact or fiction.

I sure wish I could build the moz code so I could debug into jsd and
see what really goes on.

John.
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.