Need to support 'debugger' statement

RESOLVED FIXED

Status

Rhino
Core
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Bob Jervis, Unassigned)

Tracking

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3
Build Identifier: 

The 'debugger' statement is a useful debugging tool.  We should recognize it in user source and do something useful in a JavaScript debugger.

Reproducible: Always

Steps to Reproduce:
1. Take any working script and add 'debugger;' as a statement
2.
3.
Actual Results:  
Parse error

Expected Results:  
Normal execution (with 'debugger' behaving like a no-op).  A debugger should stop and report a breakpoint hit or some equivalent message.
(Reporter)

Comment 1

10 years ago
Created attachment 271087 [details] [diff] [review]
Partal patch for 'debugger' statement.

This is a partial patch.  It parses the 'debugger' statement and inserts a bytecode for it in the interpreted code path (and does nothing in the compiled path).  I have sent mail to Norris to get his opinion on how we should plumb this through to the DebugFrame interface.
(Reporter)

Comment 2

10 years ago
Created attachment 271769 [details] [diff] [review]
Full patch implementing 'debugger' statement

This revises the debugger support to include actual hitting of breakpoints within the debugger itself.
Attachment #271087 - Attachment is obsolete: true

Comment 3

10 years ago
Checked in proposed patch: 

Checking in src/org/mozilla/javascript/IRFactory.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/IRFactory.java,v  <--  IRFactory.java
new revision: 1.107; previous revision: 1.106
done
Checking in src/org/mozilla/javascript/Interpreter.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Interpreter.java,v  <--  Interpreter.java
new revision: 1.328; previous revision: 1.327
done
Checking in src/org/mozilla/javascript/Parser.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Parser.java,v  <--  Parser.java
new revision: 1.117; previous revision: 1.116
done
Checking in src/org/mozilla/javascript/Token.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Token.java,v  <--  Token.java
new revision: 1.41; previous revision: 1.40
done
Checking in src/org/mozilla/javascript/TokenStream.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/TokenStream.java,v  <--  TokenStream.java
new revision: 1.68; previous revision: 1.67
done
Checking in src/org/mozilla/javascript/debug/DebugFrame.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/debug/DebugFrame.java,v  <--  DebugFrame.java
new revision: 1.10; previous revision: 1.9
done
Checking in src/org/mozilla/javascript/optimizer/Codegen.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/optimizer/Codegen.java,v  <--  Codegen.java
new revision: 1.249; previous revision: 1.248
done
Checking in toolsrc/org/mozilla/javascript/tools/debugger/Dim.java;
/cvsroot/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java,v  <--  Dim.java
new revision: 1.13; previous revision: 1.12
done
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.