If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

console debugger: cannot display variables

RESOLVED FIXED in mozilla0.9.9

Status

Other Applications
Venkman JS Debugger
P1
normal
RESOLVED FIXED
16 years ago
13 years ago

People

(Reporter: olaf.meincke, Assigned: Robert Ginda)

Tracking

({regression})

Trunk
mozilla0.9.9
regression

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [native])

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
I am using the CVS sources from Jul 21 2001 and have applied the latest patch 
(id=42509) from bug #82188. Under certain circumstances I cannot display the 
content of variables using the show command in the console debugger.

Running the following script:

var a = 42;
debugger;

I can display the value of 'a' by typing: show('a')
However, when doing the same thing in the following script:

foo();

function foo() {
  var a = 42;
  debugger;
}


the console debugger displays 'undefined' for the value of 'a'.

Olaf

Comment 1

16 years ago
Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: correctness, regression
If the function is not JSFUN_HEAVYWEIGHT, then it has no scope object, and all
local variable and argument references are compiled into stack frame (argv and
vars) slot gets and sets.  But why isn't the compiler instance invoked from
JS_EvaluateInStackFrame optimizing all local variable and argument references
using the same bytecodes?

To debug this, break in JS_EvaluateInStackFrame, then break in LookupArgOrVar in
jsemit.c and follow the logic.

/be
(Assignee)

Updated

16 years ago
Status: NEW → ASSIGNED
Priority: -- → P1
(Assignee)

Comment 3

16 years ago
I may need to sit with Brendan on this one.
Target Milestone: --- → mozilla0.9.9
(Assignee)

Updated

16 years ago
Whiteboard: [native]
(Assignee)

Comment 4

16 years ago
Brendan and I had a look at this and found the problem in
JS_EvaluateUCScriptInStackFrame (jsdbgapi.c:736.)  Here
JS_CompileUSScriptForPrincipals is called on the fp we're going to execute in,
which doesn't have the EVAL_FRAME and DEBUGGER_FRAME flags set.  js_EmitTree
optimizes our script to death because of these missing flags.

Actually, the compiler uses the caller's frame, which is not special (neither
eval nor debugger) -- the frame we're going to execute in won't be pushed until
js_Execute is called, and that frame is on the C stack, so we can't readily
share it with the compiler -- but no big deal.  Patch coming right up.

/be
Created attachment 68742 [details] [diff] [review]
proposed hack fix

If this works, let's put it in for 0.9.9.  Cleanup later, probably after 1.0 in
view of other priorities.

/be
Does this fix things?  Should we go with it?

/be
(Assignee)

Comment 8

16 years ago
Comment on attachment 68742 [details] [diff] [review]
proposed hack fix

Yeah, this fixes things.
r=rginda
Attachment #68742 - Flags: review+

Comment 9

16 years ago
Comment on attachment 68742 [details] [diff] [review]
proposed hack fix

sr=jband
Attachment #68742 - Flags: superreview+
Fix is in, thanks.

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
Product: Core → Other Applications
You need to log in before you can comment on or make changes to this bug.