Re: Strange behaviour on stepping.

"Dassburger" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Organization http://groups.google.com
Message-ID <[email protected]>
James Ross wrote:
> Dassburger wrote:
> > Hello!
> >
> > One more question from me. Suppose we have the following script:
> >
> > ===================================================
> > 1:   var x = 5;
> > 2:
> > 3:   Log.WriteLine('1');
> > 4:
> > 5:   x = x + 2;
> > 6:
> > 7:   var y = x + 3;
> > 8:   Log.WriteLine('2');
> > ===================================================
> >
> > First, I set an execution hook at line 1, start the script. Then I add
> > an interrupt hook and return from execution hook handler. I see a
> > strange behaviour. SpiderMonkey seems to pass the script twice, first,
> > it only stops at lines 1 and 7. Then it starts to execute the script as
> > usual, line by line: 3, 5, 7, 8.
>
> Is that the exact script used? I ask because if you have functions, you
> will get an execution hook for each function declaration in the
> top-level script as that is run (even if there's no code outside functions).

This is the exact test script. I already noticed the behaviour of JSD
when it meets functions. It, surely, will make a user to scratch
his/her head a little bit, but we can live with it.

> If it is the exact script used, can you try dumping all the PC values
> through a single run? I'm interested in whether the places it stops on
> line 1 and 7 are PC values that it hits again during the 'real' run.

They differ. For example, pass 1 gives such:

1: 80640600
7: 80640603

and pass 2 gives such:

1: 80640606
7: 80640644

The sequence of calls JSD_GetPCForStackFrame() -> JSD_GetClosestLine()
however returns line numbers 1 and 7 on both passes.

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