Closed Bug 619749 Opened 14 years ago Closed 14 years ago

JSD: can't reach the last line when single stepping

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Honza, Assigned: sfink)

References

Details

(Whiteboard: [firebug-p1][fixed-in-tracemonkey])

Attachments

(1 file, 1 obsolete file)

(origins of this bug comes from bug 610793)

It's not possible to reach the last line of debugged script (within a function) by stepping. The debugger is resumed before reaching the last line.

In order to reproduce this bug, please follow instructions on this page:
http://getfirebug.com/tests/content/script/singleStepping/single-stepping1.html

Tested with trace-monkey build that includes patch from bug 610793, see more here: https://bugzilla.mozilla.org/show_bug.cgi?id=610793#c42

Honza
Argh. I could reproduce this when using my own hacked version of an older Firebug 1.7. Unfortunately, when I updated to the latest firebug 1.7, I now hit yet another compartment mismatch (not firebug's fault), which is blocking me from digging further into this. I'm probably just off by one somewhere.

I'll work on filing the latest compartment problem.

Thanks for splitting off this bug, Honza.
Assignee: general → sphink
Status: NEW → ASSIGNED
Attached patch Fix src note scanning (obsolete) — Splinter Review
Yep, it's an off by one. Or specifically, I thought the delta field on src notes was the delta to the next note. It turns out it's the delta from the *previous* note to this one, which is a little odd to my eye (what does the first note's delta mean? It's not always zero!)

This patch should fix the observed issue, and should also fix some cases where lines would be skipped over when single-stepping. (I haven't observed any, but I haven't played with it much either.)
Attachment #498242 - Flags: review?(dmandelin)
Attachment #498242 - Flags: review?(dmandelin) → review+
(In reply to comment #2)
> Created attachment 498242 [details] [diff] [review]
> Fix src note scanning
> 
> Yep, it's an off by one. Or specifically, I thought the delta field on src
> notes was the delta to the next note. It turns out it's the delta from the
> *previous* note to this one, which is a little odd to my eye (what does the
> first note's delta mean? It's not always zero!)

The first note does not necessarily annotate the first bytecode in the script's code vector, so the delta (which may be big enough -- if not, then one or more SRC_XDELTA notes will be needed) tells bytes from start of script.

/be
(In reply to comment #3)
> (In reply to comment #2)
> > Created attachment 498242 [details] [diff] [review] [details]
> > Fix src note scanning
> > 
> > Yep, it's an off by one. Or specifically, I thought the delta field on src
> > notes was the delta to the next note. It turns out it's the delta from the
> > *previous* note to this one, which is a little odd to my eye (what does the
> > first note's delta mean? It's not always zero!)
> 
> The first note does not necessarily annotate the first bytecode in the script's
> code vector, so the delta (which may be big enough -- if not, then one or more
> SRC_XDELTA notes will be needed) tells bytes from start of script.
> 
> /be

Oops! Then sorry dmandelin, but I need to update this again to set the initial PC offset correctly.
Attachment #498242 - Attachment is obsolete: true
Attachment #498851 - Flags: review?(dmandelin)
Blocks: 620218
Attachment #498851 - Flags: review?(dmandelin) → review+
Whiteboard: [firebug-p1]
http://hg.mozilla.org/tracemonkey/rev/955e406e35b1

I botched the commit message; it refers to bug 619479 when it should be this bug 619749.
Whiteboard: [firebug-p1] → [firebug-p1][fixed-in-tracemonkey]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Blocks: 624408
No longer blocks: 624408
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: