Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: src/debug-debugger.js

Issue 352583008: Rollback to Version 3.28.4 (based on bleeding_edge revision r22031) (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/debug.cc ('k') | src/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Default number of frames to include in the response to backtrace request. 5 // Default number of frames to include in the response to backtrace request.
6 var kDefaultBacktraceLength = 10; 6 var kDefaultBacktraceLength = 10;
7 7
8 var Debug = {}; 8 var Debug = {};
9 9
10 // Regular expression to skip "crud" at the beginning of a source line which is 10 // Regular expression to skip "crud" at the beginning of a source line which is
11 // not really code. Currently the regular expression matches whitespace and 11 // not really code. Currently the regular expression matches whitespace and
12 // comments. 12 // comments.
13 var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/; 13 var sourceLineBeginningSkip = /^(?:\s*(?:\/\*.*?\*\/)*)*/;
14 14
15 // Debug events which can occour in the V8 JavaScript engine. These originate 15 // Debug events which can occour in the V8 JavaScript engine. These originate
16 // from the API include file debug.h. 16 // from the API include file debug.h.
17 Debug.DebugEvent = { Break: 1, 17 Debug.DebugEvent = { Break: 1,
18 Exception: 2, 18 Exception: 2,
19 NewFunction: 3, 19 NewFunction: 3,
20 BeforeCompile: 4, 20 BeforeCompile: 4,
21 AfterCompile: 5, 21 AfterCompile: 5,
22 ScriptCollected: 6, 22 ScriptCollected: 6 };
23 CompileError: 7 };
24 23
25 // Types of exceptions that can be broken upon. 24 // Types of exceptions that can be broken upon.
26 Debug.ExceptionBreak = { Caught : 0, 25 Debug.ExceptionBreak = { Caught : 0,
27 Uncaught: 1 }; 26 Uncaught: 1 };
28 27
29 // The different types of steps. 28 // The different types of steps.
30 Debug.StepAction = { StepOut: 0, 29 Debug.StepAction = { StepOut: 0,
31 StepNext: 1, 30 StepNext: 1,
32 StepIn: 2, 31 StepIn: 2,
33 StepMin: 3, 32 StepMin: 3,
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 o.body.script = MakeScriptObject_(script, false); 1136 o.body.script = MakeScriptObject_(script, false);
1138 } 1137 }
1139 } else { 1138 } else {
1140 o.body.sourceLine = -1; 1139 o.body.sourceLine = -1;
1141 } 1140 }
1142 1141
1143 return o.toJSONProtocol(); 1142 return o.toJSONProtocol();
1144 }; 1143 };
1145 1144
1146 1145
1147 function MakeCompileEvent(script, type) { 1146 function MakeCompileEvent(script, before) {
1148 return new CompileEvent(script, type); 1147 return new CompileEvent(script, before);
1149 } 1148 }
1150 1149
1151 1150
1152 function CompileEvent(script, type) { 1151 function CompileEvent(script, before) {
1153 this.script_ = MakeMirror(script); 1152 this.script_ = MakeMirror(script);
1154 this.type_ = type; 1153 this.before_ = before;
1155 } 1154 }
1156 1155
1157 1156
1158 CompileEvent.prototype.eventType = function() { 1157 CompileEvent.prototype.eventType = function() {
1159 return this.type_; 1158 if (this.before_) {
1159 return Debug.DebugEvent.BeforeCompile;
1160 } else {
1161 return Debug.DebugEvent.AfterCompile;
1162 }
1160 }; 1163 };
1161 1164
1162 1165
1163 CompileEvent.prototype.script = function() { 1166 CompileEvent.prototype.script = function() {
1164 return this.script_; 1167 return this.script_;
1165 }; 1168 };
1166 1169
1167 1170
1168 CompileEvent.prototype.toJSONProtocol = function() { 1171 CompileEvent.prototype.toJSONProtocol = function() {
1169 var o = new ProtocolMessage(); 1172 var o = new ProtocolMessage();
1170 o.running = true; 1173 o.running = true;
1171 switch (this.type_) { 1174 if (this.before_) {
1172 case Debug.DebugEvent.BeforeCompile: 1175 o.event = "beforeCompile";
1173 o.event = "beforeCompile"; 1176 } else {
1174 case Debug.DebugEvent.AfterCompile: 1177 o.event = "afterCompile";
1175 o.event = "afterCompile";
1176 case Debug.DebugEvent.CompileError:
1177 o.event = "compileError";
1178 } 1178 }
1179 o.body = {}; 1179 o.body = {};
1180 o.body.script = this.script_; 1180 o.body.script = this.script_;
1181 1181
1182 return o.toJSONProtocol(); 1182 return o.toJSONProtocol();
1183 }; 1183 };
1184 1184
1185 1185
1186 function MakeScriptCollectedEvent(id) { 1186 function MakeScriptCollectedEvent(id) {
1187 return new ScriptCollectedEvent(id); 1187 return new ScriptCollectedEvent(id);
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
2539 2539
2540 default: 2540 default:
2541 json = null; 2541 json = null;
2542 } 2542 }
2543 return json; 2543 return json;
2544 } 2544 }
2545 2545
2546 Debug.TestApi = { 2546 Debug.TestApi = {
2547 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_ 2547 CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_
2548 }; 2548 };
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698