re: jsdIStackFrame.pc semantics
"Adam L. Peller" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jsdebugger |
|---|---|
| Message-ID | <[email protected]> |
John, I may not be parsing your question correctly, but when you're
inside the eval, the top of the stack will tell you you're at line 5 +
whatever line of req.responseText you're at, right? (bug #332176)
You'll probably want PCMAP_SOURCETEXT if you're comparing to the
actual source code. PCMAP_PRETTYPRINT only makes sense if you compare
against the source the way JSD formats it.
-Adam
> I have code like this:
> --------
> var req = new XMLHttpRequest();
>
> req.onreadystatechange = function() { // line 3
> if( req.readyState == 4) {
> eval( req.responseText); // line 5
> }
> };
> ---------
>
> When the eval() executes, within which line should I
> expect the program counter for the caller? I expected
> line 5, but it comes out on line 6. (Well the numerical
> value is 4 since it comes out of pcToLine relative to
> the start of the function).
>
> So one model is that the PC is somehow at the end of
> the function call:
>
> eval( req.responseText); // line 5
> ---------------------------------------^
> so it is just on the next line "barely".
>
> Or there is just another "off-by-one" problem in my code,
> not the first I guess ;-).
>
> But I see one case where the PC points to the line
> with the eval().
>
> This is all with PCMAP_PRETTYPRINT output, which I guess
> really means source-like text decompiled from bytecodes.
>
> Thanks,
> John.
>
>
> ------------------------------
>
> _______________________________________________
> dev-apps-js-debugger mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-apps-js-debugger
>
>
> End of dev-apps-js-debugger Digest, Vol 11, Issue 6
> ***************************************************
>