Closed Bug 92087 Opened 23 years ago Closed 23 years ago

console debugger: cannot display variables

Categories

(Other Applications Graveyard :: Venkman JS Debugger, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: olaf.meincke, Assigned: rginda)

Details

(Keywords: regression, Whiteboard: [native])

Attachments

(1 file)

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
Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
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
Status: NEW → ASSIGNED
Priority: -- → P1
I may need to sit with Brendan on this one.
Target Milestone: --- → mozilla0.9.9
Whiteboard: [native]
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
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
Comment on attachment 68742 [details] [diff] [review]
proposed hack fix

Yeah, this fixes things.
r=rginda
Attachment #68742 - Flags: review+
Comment on attachment 68742 [details] [diff] [review]
proposed hack fix

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

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

Attachment

General

Created:
Updated:
Size: