Closed Bug 389370 Opened 17 years ago Closed 16 years ago

JavaScript stack frames through DumpJSStack are usually one line off

Categories

(Core :: JavaScript Engine, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 418491

People

(Reporter: WeirdAl, Unassigned)

Details

Attachments

(1 file)

      No description provided.
Flags: in-testsuite?
Flags: blocking1.9?
Attachment #273550 - Attachment is patch: true
Attachment #273550 - Attachment mime type: text/x-patch → text/plain
Sorry, I filed this before I could detail it.

For many months now, I've noticed the line number for JS-based components in a stack trace from DumpJSStack() is usually off by one.  Where DumpJSStack() will report line 57, the line in question is really line 58.

I've tracked it as far as js_PCToLineNumber(), observing script->lineno == 50, which is a comment line (|// nsIProperty|).

This bug may be closely related to bug 194828, based on my reading of that bug.

Steps to reproduce:
(1) Apply this patch to a trunk XULRunner source tree.
(2) ac_add_options --enable-application=psycho, --enable-debug
(3) make -f client.mk build
(4) dist/bin/xulrunner dist/bin/application.ini
(5) Wait five seconds; it will automatically crash.
(6) (gdb) frame 4
(7) (gdb) call DumpJSStack()

Expected results:
Frame 1 says nsJSPropertyBag.js:58

Actual results:
Frame 1 says nsJSPropertyBag.js:57
Note:  It correctly reports the line number for the psycho.xul file.
I don't feel this is worth a blocking flag.
Flags: blocking1.9?
Does comment #2 mean we can actually mark this WFM?
No, there's a difference between the line numbering for a chrome file and for a component file.  The chrome file line numbering is correct, but the component file isn't.

At least, that was the state of affairs when I reported this bug...
Flags: blocking1.9-
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: