Status

Other Applications
Venkman JS Debugger
16 years ago
10 years ago

People

(Reporter: Michael Schneider, Assigned: Robert Ginda)

Tracking

Trunk
x86
Windows XP

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461; .NET 
CLR 1.0.3705)
BuildID:    2002061104

we have our own debugger implementation, which is built on the JSD api. 
normally it's working fine, but the debugger sometimes displays a wrong line 
as the actual line. i've checked it and found the following script, failing in 
my own implementation as well as in the mozilla 1.1a (2002061104) debugger.


Reproducible: Always
Steps to Reproduce:
1. Create a html page with the following script:
this.m_sSQL = "";
var strFTSearch = "bla";

if (strFTSearch != "*")
{
 if ((1) && (2))
 {
  this.m_sSQL += strFTSearch;
  this.m_sSQL += "%')";
 }
 else if (3)
 {
  this.m_sSQL += strFTSearch;
  this.m_sSQL +=  "%')";
 }
 else
 {
  this.m_sSQL += strFTSearch;
  this.m_sSQL +=  "%')";
 }
}
else
{
 var bal = "a";
}


2.execute the script step by step in the debugger


Actual Results:  single stepping with step over steps after the end of
the first block at the end of the second block..

Expected Results:  it should ignore all else's after leaving the first block

Comment 1

16 years ago
Created attachment 91016 [details]
HTML testcase with code inside a test() function

Comment 2

16 years ago
Reassigning to JavaScript Debugger component -
Assignee: rogerl → rginda
Component: JavaScript Engine → JavaScript Debugger
QA Contact: pschwartau → caillon

Comment 3

16 years ago
Confirming reported behavior with Mozilla trunk binary 20020701xx.
I am running a developmental version of the JS Debugger.

I do see what the reporter says. If I step through the code inside
the test() function, whether via F10 or F11, here's what I see:


I step until the last line of block one:

  {
    this.m_sSQL += strFTSearch;
    this.m_sSQL += "%')";         <<<-------------- STOPPED HERE
  }

Then F10 or F11 takes me to the last line in block two:

  else if (3)
  {
    this.m_sSQL += strFTSearch;
    this.m_sSQL +=  "%')";        <<<-------------- WE STOP HERE
  }

Then F10 or F11 take me out of the function. Note we might
have expected to stop at the end of block three:

  else
  {
    this.m_sSQL += strFTSearch;
    this.m_sSQL +=  "%')";      <<<-------------- WE DON'T STOP HERE, THOUGH
  }


My version of the JS Debugger is not showing these lines as breakable!
I can't see any syntax errors in the code, so I'm puzzled at this -
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 4

16 years ago
It's most likely a problem in the pc->line number map we generate from the
source notes.  If so, this is actually a js engine issue.

Comment 5

14 years ago
brendan: any thoughts?
Product: Core → Other Applications

Comment 6

11 years ago
This is still an annoying problem. I noticed that when running scripts which are loaded and run through eval the current line is always off by one (the next row).

Comment 7

11 years ago
The off-by-one problem when using Pretty Print is a different issue.

Updated

10 years ago
Duplicate of this bug: 253995

Updated

10 years ago
QA Contact: caillon → venkman
You need to log in before you can comment on or make changes to this bug.