OLD | NEW |
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 (function (global, utils) { | 5 (function (global, utils) { |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 // ---------------------------------------------------------------------------- | 8 // ---------------------------------------------------------------------------- |
9 // Imports | 9 // Imports |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // NOTE: This object does not have a reference to the function having break | 140 // NOTE: This object does not have a reference to the function having break |
141 // point as this would cause function not to be garbage collected when it is | 141 // point as this would cause function not to be garbage collected when it is |
142 // not used any more. We do not want break points to keep functions alive. | 142 // not used any more. We do not want break points to keep functions alive. |
143 function BreakPoint(source_position, opt_script_break_point) { | 143 function BreakPoint(source_position, opt_script_break_point) { |
144 this.source_position_ = source_position; | 144 this.source_position_ = source_position; |
145 if (opt_script_break_point) { | 145 if (opt_script_break_point) { |
146 this.script_break_point_ = opt_script_break_point; | 146 this.script_break_point_ = opt_script_break_point; |
147 } else { | 147 } else { |
148 this.number_ = next_break_point_number++; | 148 this.number_ = next_break_point_number++; |
149 } | 149 } |
150 this.hit_count_ = 0; | |
151 this.active_ = true; | 150 this.active_ = true; |
152 this.condition_ = null; | 151 this.condition_ = null; |
153 this.ignoreCount_ = 0; | |
154 } | 152 } |
155 | 153 |
156 | 154 |
157 BreakPoint.prototype.number = function() { | 155 BreakPoint.prototype.number = function() { |
158 return this.number_; | 156 return this.number_; |
159 }; | 157 }; |
160 | 158 |
161 | 159 |
162 BreakPoint.prototype.func = function() { | 160 BreakPoint.prototype.func = function() { |
163 return this.func_; | 161 return this.func_; |
164 }; | 162 }; |
165 | 163 |
166 | 164 |
167 BreakPoint.prototype.source_position = function() { | 165 BreakPoint.prototype.source_position = function() { |
168 return this.source_position_; | 166 return this.source_position_; |
169 }; | 167 }; |
170 | 168 |
171 | 169 |
172 BreakPoint.prototype.hit_count = function() { | |
173 return this.hit_count_; | |
174 }; | |
175 | |
176 | |
177 BreakPoint.prototype.active = function() { | 170 BreakPoint.prototype.active = function() { |
178 if (this.script_break_point()) { | 171 if (this.script_break_point()) { |
179 return this.script_break_point().active(); | 172 return this.script_break_point().active(); |
180 } | 173 } |
181 return this.active_; | 174 return this.active_; |
182 }; | 175 }; |
183 | 176 |
184 | 177 |
185 BreakPoint.prototype.condition = function() { | 178 BreakPoint.prototype.condition = function() { |
186 if (this.script_break_point() && this.script_break_point().condition()) { | 179 if (this.script_break_point() && this.script_break_point().condition()) { |
187 return this.script_break_point().condition(); | 180 return this.script_break_point().condition(); |
188 } | 181 } |
189 return this.condition_; | 182 return this.condition_; |
190 }; | 183 }; |
191 | 184 |
192 | 185 |
193 BreakPoint.prototype.ignoreCount = function() { | |
194 return this.ignoreCount_; | |
195 }; | |
196 | |
197 | |
198 BreakPoint.prototype.script_break_point = function() { | 186 BreakPoint.prototype.script_break_point = function() { |
199 return this.script_break_point_; | 187 return this.script_break_point_; |
200 }; | 188 }; |
201 | 189 |
202 | 190 |
203 BreakPoint.prototype.enable = function() { | 191 BreakPoint.prototype.enable = function() { |
204 this.active_ = true; | 192 this.active_ = true; |
205 }; | 193 }; |
206 | 194 |
207 | 195 |
208 BreakPoint.prototype.disable = function() { | 196 BreakPoint.prototype.disable = function() { |
209 this.active_ = false; | 197 this.active_ = false; |
210 }; | 198 }; |
211 | 199 |
212 | 200 |
213 BreakPoint.prototype.setCondition = function(condition) { | 201 BreakPoint.prototype.setCondition = function(condition) { |
214 this.condition_ = condition; | 202 this.condition_ = condition; |
215 }; | 203 }; |
216 | 204 |
217 | 205 |
218 BreakPoint.prototype.setIgnoreCount = function(ignoreCount) { | |
219 this.ignoreCount_ = ignoreCount; | |
220 }; | |
221 | |
222 | |
223 BreakPoint.prototype.isTriggered = function(exec_state) { | 206 BreakPoint.prototype.isTriggered = function(exec_state) { |
224 // Break point not active - not triggered. | 207 // Break point not active - not triggered. |
225 if (!this.active()) return false; | 208 if (!this.active()) return false; |
226 | 209 |
227 // Check for conditional break point. | 210 // Check for conditional break point. |
228 if (this.condition()) { | 211 if (this.condition()) { |
229 // If break point has condition try to evaluate it in the top frame. | 212 // If break point has condition try to evaluate it in the top frame. |
230 try { | 213 try { |
231 var mirror = exec_state.frame(0).evaluate(this.condition()); | 214 var mirror = exec_state.frame(0).evaluate(this.condition()); |
232 // If no sensible mirror or non true value break point not triggered. | 215 // If no sensible mirror or non true value break point not triggered. |
233 if (!(mirror instanceof ValueMirror) || !mirror.value_) { | 216 if (!(mirror instanceof ValueMirror) || !mirror.value_) { |
234 return false; | 217 return false; |
235 } | 218 } |
236 } catch (e) { | 219 } catch (e) { |
237 // Exception evaluating condition counts as not triggered. | 220 // Exception evaluating condition counts as not triggered. |
238 return false; | 221 return false; |
239 } | 222 } |
240 } | 223 } |
241 | 224 |
242 // Update the hit count. | |
243 this.hit_count_++; | |
244 if (this.script_break_point_) { | |
245 this.script_break_point_.hit_count_++; | |
246 } | |
247 | |
248 // If the break point has an ignore count it is not triggered. | |
249 if (this.ignoreCount_ > 0) { | |
250 this.ignoreCount_--; | |
251 return false; | |
252 } | |
253 | |
254 // Break point triggered. | 225 // Break point triggered. |
255 return true; | 226 return true; |
256 }; | 227 }; |
257 | 228 |
258 | 229 |
259 // Function called from the runtime when a break point is hit. Returns true if | 230 // Function called from the runtime when a break point is hit. Returns true if |
260 // the break point is triggered and supposed to break execution. | 231 // the break point is triggered and supposed to break execution. |
261 function IsBreakPointTriggered(break_id, break_point) { | 232 function IsBreakPointTriggered(break_id, break_point) { |
262 return break_point.isTriggered(MakeExecutionState(break_id)); | 233 return break_point.isTriggered(MakeExecutionState(break_id)); |
263 } | 234 } |
(...skipping 12 matching lines...) Expand all Loading... |
276 } else if (type == Debug.ScriptBreakPointType.ScriptRegExp) { | 247 } else if (type == Debug.ScriptBreakPointType.ScriptRegExp) { |
277 this.script_regexp_object_ = new GlobalRegExp(script_id_or_name); | 248 this.script_regexp_object_ = new GlobalRegExp(script_id_or_name); |
278 } else { | 249 } else { |
279 throw MakeError(kDebugger, "Unexpected breakpoint type " + type); | 250 throw MakeError(kDebugger, "Unexpected breakpoint type " + type); |
280 } | 251 } |
281 this.line_ = opt_line || 0; | 252 this.line_ = opt_line || 0; |
282 this.column_ = opt_column; | 253 this.column_ = opt_column; |
283 this.groupId_ = opt_groupId; | 254 this.groupId_ = opt_groupId; |
284 this.position_alignment_ = IS_UNDEFINED(opt_position_alignment) | 255 this.position_alignment_ = IS_UNDEFINED(opt_position_alignment) |
285 ? Debug.BreakPositionAlignment.Statement : opt_position_alignment; | 256 ? Debug.BreakPositionAlignment.Statement : opt_position_alignment; |
286 this.hit_count_ = 0; | |
287 this.active_ = true; | 257 this.active_ = true; |
288 this.condition_ = null; | 258 this.condition_ = null; |
289 this.ignoreCount_ = 0; | |
290 this.break_points_ = []; | 259 this.break_points_ = []; |
291 } | 260 } |
292 | 261 |
293 | 262 |
294 // Creates a clone of script breakpoint that is linked to another script. | 263 // Creates a clone of script breakpoint that is linked to another script. |
295 ScriptBreakPoint.prototype.cloneForOtherScript = function (other_script) { | 264 ScriptBreakPoint.prototype.cloneForOtherScript = function (other_script) { |
296 var copy = new ScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, | 265 var copy = new ScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, |
297 other_script.id, this.line_, this.column_, this.groupId_, | 266 other_script.id, this.line_, this.column_, this.groupId_, |
298 this.position_alignment_); | 267 this.position_alignment_); |
299 copy.number_ = next_break_point_number++; | 268 copy.number_ = next_break_point_number++; |
300 script_break_points.push(copy); | 269 script_break_points.push(copy); |
301 | 270 |
302 copy.hit_count_ = this.hit_count_; | |
303 copy.active_ = this.active_; | 271 copy.active_ = this.active_; |
304 copy.condition_ = this.condition_; | 272 copy.condition_ = this.condition_; |
305 copy.ignoreCount_ = this.ignoreCount_; | |
306 return copy; | 273 return copy; |
307 }; | 274 }; |
308 | 275 |
309 | 276 |
310 ScriptBreakPoint.prototype.number = function() { | 277 ScriptBreakPoint.prototype.number = function() { |
311 return this.number_; | 278 return this.number_; |
312 }; | 279 }; |
313 | 280 |
314 | 281 |
315 ScriptBreakPoint.prototype.groupId = function() { | 282 ScriptBreakPoint.prototype.groupId = function() { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 return locations; | 322 return locations; |
356 }; | 323 }; |
357 | 324 |
358 | 325 |
359 ScriptBreakPoint.prototype.update_positions = function(line, column) { | 326 ScriptBreakPoint.prototype.update_positions = function(line, column) { |
360 this.line_ = line; | 327 this.line_ = line; |
361 this.column_ = column; | 328 this.column_ = column; |
362 }; | 329 }; |
363 | 330 |
364 | 331 |
365 ScriptBreakPoint.prototype.hit_count = function() { | |
366 return this.hit_count_; | |
367 }; | |
368 | |
369 | |
370 ScriptBreakPoint.prototype.active = function() { | 332 ScriptBreakPoint.prototype.active = function() { |
371 return this.active_; | 333 return this.active_; |
372 }; | 334 }; |
373 | 335 |
374 | 336 |
375 ScriptBreakPoint.prototype.condition = function() { | 337 ScriptBreakPoint.prototype.condition = function() { |
376 return this.condition_; | 338 return this.condition_; |
377 }; | 339 }; |
378 | 340 |
379 | 341 |
380 ScriptBreakPoint.prototype.ignoreCount = function() { | |
381 return this.ignoreCount_; | |
382 }; | |
383 | |
384 | |
385 ScriptBreakPoint.prototype.enable = function() { | 342 ScriptBreakPoint.prototype.enable = function() { |
386 this.active_ = true; | 343 this.active_ = true; |
387 }; | 344 }; |
388 | 345 |
389 | 346 |
390 ScriptBreakPoint.prototype.disable = function() { | 347 ScriptBreakPoint.prototype.disable = function() { |
391 this.active_ = false; | 348 this.active_ = false; |
392 }; | 349 }; |
393 | 350 |
394 | 351 |
395 ScriptBreakPoint.prototype.setCondition = function(condition) { | 352 ScriptBreakPoint.prototype.setCondition = function(condition) { |
396 this.condition_ = condition; | 353 this.condition_ = condition; |
397 }; | 354 }; |
398 | 355 |
399 | 356 |
400 ScriptBreakPoint.prototype.setIgnoreCount = function(ignoreCount) { | |
401 this.ignoreCount_ = ignoreCount; | |
402 | |
403 // Set ignore count on all break points created from this script break point. | |
404 for (var i = 0; i < this.break_points_.length; i++) { | |
405 this.break_points_[i].setIgnoreCount(ignoreCount); | |
406 } | |
407 }; | |
408 | |
409 | |
410 // Check whether a script matches this script break point. Currently this is | 357 // Check whether a script matches this script break point. Currently this is |
411 // only based on script name. | 358 // only based on script name. |
412 ScriptBreakPoint.prototype.matchesScript = function(script) { | 359 ScriptBreakPoint.prototype.matchesScript = function(script) { |
413 if (this.type_ == Debug.ScriptBreakPointType.ScriptId) { | 360 if (this.type_ == Debug.ScriptBreakPointType.ScriptId) { |
414 return this.script_id_ == script.id; | 361 return this.script_id_ == script.id; |
415 } else { | 362 } else { |
416 // We might want to account columns here as well. | 363 // We might want to account columns here as well. |
417 if (!(script.line_offset <= this.line_ && | 364 if (!(script.line_offset <= this.line_ && |
418 this.line_ < script.line_offset + script.lineCount())) { | 365 this.line_ < script.line_offset + script.lineCount())) { |
419 return false; | 366 return false; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 401 |
455 // Convert the line and column into an absolute position within the script. | 402 // Convert the line and column into an absolute position within the script. |
456 var position = Debug.findScriptSourcePosition(script, this.line(), column); | 403 var position = Debug.findScriptSourcePosition(script, this.line(), column); |
457 | 404 |
458 // If the position is not found in the script (the script might be shorter | 405 // If the position is not found in the script (the script might be shorter |
459 // than it used to be) just ignore it. | 406 // than it used to be) just ignore it. |
460 if (IS_NULL(position)) return; | 407 if (IS_NULL(position)) return; |
461 | 408 |
462 // Create a break point object and set the break point. | 409 // Create a break point object and set the break point. |
463 var break_point = MakeBreakPoint(position, this); | 410 var break_point = MakeBreakPoint(position, this); |
464 break_point.setIgnoreCount(this.ignoreCount()); | |
465 var actual_position = %SetScriptBreakPoint(script, position, | 411 var actual_position = %SetScriptBreakPoint(script, position, |
466 this.position_alignment_, | 412 this.position_alignment_, |
467 break_point); | 413 break_point); |
468 if (IS_UNDEFINED(actual_position)) { | 414 if (IS_UNDEFINED(actual_position)) { |
469 actual_position = position; | 415 actual_position = position; |
470 } | 416 } |
471 var actual_location = script.locationFromPosition(actual_position, true); | 417 var actual_location = script.locationFromPosition(actual_position, true); |
472 break_point.actual_location = { line: actual_location.line, | 418 break_point.actual_location = { line: actual_location.line, |
473 column: actual_location.column, | 419 column: actual_location.column, |
474 script_id: script.id }; | 420 script_id: script.id }; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } | 665 } |
720 }; | 666 }; |
721 | 667 |
722 | 668 |
723 Debug.changeBreakPointCondition = function(break_point_number, condition) { | 669 Debug.changeBreakPointCondition = function(break_point_number, condition) { |
724 var break_point = this.findBreakPoint(break_point_number, false); | 670 var break_point = this.findBreakPoint(break_point_number, false); |
725 break_point.setCondition(condition); | 671 break_point.setCondition(condition); |
726 }; | 672 }; |
727 | 673 |
728 | 674 |
729 Debug.changeBreakPointIgnoreCount = function(break_point_number, ignoreCount) { | |
730 if (ignoreCount < 0) throw MakeError(kDebugger, 'Invalid argument'); | |
731 var break_point = this.findBreakPoint(break_point_number, false); | |
732 break_point.setIgnoreCount(ignoreCount); | |
733 }; | |
734 | |
735 | |
736 Debug.clearBreakPoint = function(break_point_number) { | 675 Debug.clearBreakPoint = function(break_point_number) { |
737 var break_point = this.findBreakPoint(break_point_number, true); | 676 var break_point = this.findBreakPoint(break_point_number, true); |
738 if (break_point) { | 677 if (break_point) { |
739 return %ClearBreakPoint(break_point); | 678 return %ClearBreakPoint(break_point); |
740 } else { | 679 } else { |
741 break_point = this.findScriptBreakPoint(break_point_number, true); | 680 break_point = this.findScriptBreakPoint(break_point_number, true); |
742 if (!break_point) throw MakeError(kDebugger, 'Invalid breakpoint'); | 681 if (!break_point) throw MakeError(kDebugger, 'Invalid breakpoint'); |
743 } | 682 } |
744 }; | 683 }; |
745 | 684 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 }; | 789 }; |
851 | 790 |
852 | 791 |
853 Debug.changeScriptBreakPointCondition = function( | 792 Debug.changeScriptBreakPointCondition = function( |
854 break_point_number, condition) { | 793 break_point_number, condition) { |
855 var script_break_point = this.findScriptBreakPoint(break_point_number, false); | 794 var script_break_point = this.findScriptBreakPoint(break_point_number, false); |
856 script_break_point.setCondition(condition); | 795 script_break_point.setCondition(condition); |
857 }; | 796 }; |
858 | 797 |
859 | 798 |
860 Debug.changeScriptBreakPointIgnoreCount = function( | |
861 break_point_number, ignoreCount) { | |
862 if (ignoreCount < 0) throw MakeError(kDebugger, 'Invalid argument'); | |
863 var script_break_point = this.findScriptBreakPoint(break_point_number, false); | |
864 script_break_point.setIgnoreCount(ignoreCount); | |
865 }; | |
866 | |
867 | |
868 Debug.scriptBreakPoints = function() { | 799 Debug.scriptBreakPoints = function() { |
869 return script_break_points; | 800 return script_break_points; |
870 }; | 801 }; |
871 | 802 |
872 | 803 |
873 Debug.clearStepping = function() { | 804 Debug.clearStepping = function() { |
874 %ClearStepping(); | 805 %ClearStepping(); |
875 }; | 806 }; |
876 | 807 |
877 Debug.setBreakOnException = function() { | 808 Debug.setBreakOnException = function() { |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 } | 1427 } |
1497 | 1428 |
1498 // Pull out arguments. | 1429 // Pull out arguments. |
1499 var type = request.arguments.type; | 1430 var type = request.arguments.type; |
1500 var target = request.arguments.target; | 1431 var target = request.arguments.target; |
1501 var line = request.arguments.line; | 1432 var line = request.arguments.line; |
1502 var column = request.arguments.column; | 1433 var column = request.arguments.column; |
1503 var enabled = IS_UNDEFINED(request.arguments.enabled) ? | 1434 var enabled = IS_UNDEFINED(request.arguments.enabled) ? |
1504 true : request.arguments.enabled; | 1435 true : request.arguments.enabled; |
1505 var condition = request.arguments.condition; | 1436 var condition = request.arguments.condition; |
1506 var ignoreCount = request.arguments.ignoreCount; | |
1507 var groupId = request.arguments.groupId; | 1437 var groupId = request.arguments.groupId; |
1508 | 1438 |
1509 // Check for legal arguments. | 1439 // Check for legal arguments. |
1510 if (!type || IS_UNDEFINED(target)) { | 1440 if (!type || IS_UNDEFINED(target)) { |
1511 response.failed('Missing argument "type" or "target"'); | 1441 response.failed('Missing argument "type" or "target"'); |
1512 return; | 1442 return; |
1513 } | 1443 } |
1514 | 1444 |
1515 // Either function or script break point. | 1445 // Either function or script break point. |
1516 var break_point_number; | 1446 var break_point_number; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 break_point_number = | 1492 break_point_number = |
1563 Debug.setScriptBreakPointByRegExp(target, line, column, condition, | 1493 Debug.setScriptBreakPointByRegExp(target, line, column, condition, |
1564 groupId); | 1494 groupId); |
1565 } else { | 1495 } else { |
1566 response.failed('Illegal type "' + type + '"'); | 1496 response.failed('Illegal type "' + type + '"'); |
1567 return; | 1497 return; |
1568 } | 1498 } |
1569 | 1499 |
1570 // Set additional break point properties. | 1500 // Set additional break point properties. |
1571 var break_point = Debug.findBreakPoint(break_point_number); | 1501 var break_point = Debug.findBreakPoint(break_point_number); |
1572 if (ignoreCount) { | |
1573 Debug.changeBreakPointIgnoreCount(break_point_number, ignoreCount); | |
1574 } | |
1575 if (!enabled) { | 1502 if (!enabled) { |
1576 Debug.disableBreakPoint(break_point_number); | 1503 Debug.disableBreakPoint(break_point_number); |
1577 } | 1504 } |
1578 | 1505 |
1579 // Add the break point number to the response. | 1506 // Add the break point number to the response. |
1580 response.body = { type: type, | 1507 response.body = { type: type, |
1581 breakpoint: break_point_number }; | 1508 breakpoint: break_point_number }; |
1582 | 1509 |
1583 // Add break point information to the response. | 1510 // Add break point information to the response. |
1584 if (break_point instanceof ScriptBreakPoint) { | 1511 if (break_point instanceof ScriptBreakPoint) { |
(...skipping 25 matching lines...) Expand all Loading... |
1610 // Check for legal request. | 1537 // Check for legal request. |
1611 if (!request.arguments) { | 1538 if (!request.arguments) { |
1612 response.failed('Missing arguments'); | 1539 response.failed('Missing arguments'); |
1613 return; | 1540 return; |
1614 } | 1541 } |
1615 | 1542 |
1616 // Pull out arguments. | 1543 // Pull out arguments. |
1617 var break_point = TO_NUMBER(request.arguments.breakpoint); | 1544 var break_point = TO_NUMBER(request.arguments.breakpoint); |
1618 var enabled = request.arguments.enabled; | 1545 var enabled = request.arguments.enabled; |
1619 var condition = request.arguments.condition; | 1546 var condition = request.arguments.condition; |
1620 var ignoreCount = request.arguments.ignoreCount; | |
1621 | 1547 |
1622 // Check for legal arguments. | 1548 // Check for legal arguments. |
1623 if (!break_point) { | 1549 if (!break_point) { |
1624 response.failed('Missing argument "breakpoint"'); | 1550 response.failed('Missing argument "breakpoint"'); |
1625 return; | 1551 return; |
1626 } | 1552 } |
1627 | 1553 |
1628 // Change enabled state if supplied. | 1554 // Change enabled state if supplied. |
1629 if (!IS_UNDEFINED(enabled)) { | 1555 if (!IS_UNDEFINED(enabled)) { |
1630 if (enabled) { | 1556 if (enabled) { |
1631 Debug.enableBreakPoint(break_point); | 1557 Debug.enableBreakPoint(break_point); |
1632 } else { | 1558 } else { |
1633 Debug.disableBreakPoint(break_point); | 1559 Debug.disableBreakPoint(break_point); |
1634 } | 1560 } |
1635 } | 1561 } |
1636 | 1562 |
1637 // Change condition if supplied | 1563 // Change condition if supplied |
1638 if (!IS_UNDEFINED(condition)) { | 1564 if (!IS_UNDEFINED(condition)) { |
1639 Debug.changeBreakPointCondition(break_point, condition); | 1565 Debug.changeBreakPointCondition(break_point, condition); |
1640 } | 1566 } |
1641 | |
1642 // Change ignore count if supplied | |
1643 if (!IS_UNDEFINED(ignoreCount)) { | |
1644 Debug.changeBreakPointIgnoreCount(break_point, ignoreCount); | |
1645 } | |
1646 }; | 1567 }; |
1647 | 1568 |
1648 | 1569 |
1649 DebugCommandProcessor.prototype.clearBreakPointGroupRequest_ = function( | 1570 DebugCommandProcessor.prototype.clearBreakPointGroupRequest_ = function( |
1650 request, response) { | 1571 request, response) { |
1651 // Check for legal request. | 1572 // Check for legal request. |
1652 if (!request.arguments) { | 1573 if (!request.arguments) { |
1653 response.failed('Missing arguments'); | 1574 response.failed('Missing arguments'); |
1654 return; | 1575 return; |
1655 } | 1576 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 request, response) { | 1631 request, response) { |
1711 var array = []; | 1632 var array = []; |
1712 for (var i = 0; i < script_break_points.length; i++) { | 1633 for (var i = 0; i < script_break_points.length; i++) { |
1713 var break_point = script_break_points[i]; | 1634 var break_point = script_break_points[i]; |
1714 | 1635 |
1715 var description = { | 1636 var description = { |
1716 number: break_point.number(), | 1637 number: break_point.number(), |
1717 line: break_point.line(), | 1638 line: break_point.line(), |
1718 column: break_point.column(), | 1639 column: break_point.column(), |
1719 groupId: break_point.groupId(), | 1640 groupId: break_point.groupId(), |
1720 hit_count: break_point.hit_count(), | |
1721 active: break_point.active(), | 1641 active: break_point.active(), |
1722 condition: break_point.condition(), | 1642 condition: break_point.condition(), |
1723 ignoreCount: break_point.ignoreCount(), | |
1724 actual_locations: break_point.actual_locations() | 1643 actual_locations: break_point.actual_locations() |
1725 }; | 1644 }; |
1726 | 1645 |
1727 if (break_point.type() == Debug.ScriptBreakPointType.ScriptId) { | 1646 if (break_point.type() == Debug.ScriptBreakPointType.ScriptId) { |
1728 description.type = 'scriptId'; | 1647 description.type = 'scriptId'; |
1729 description.script_id = break_point.script_id(); | 1648 description.script_id = break_point.script_id(); |
1730 } else if (break_point.type() == Debug.ScriptBreakPointType.ScriptName) { | 1649 } else if (break_point.type() == Debug.ScriptBreakPointType.ScriptName) { |
1731 description.type = 'scriptName'; | 1650 description.type = 'scriptName'; |
1732 description.script_name = break_point.script_name(); | 1651 description.script_name = break_point.script_name(); |
1733 } else if (break_point.type() == Debug.ScriptBreakPointType.ScriptRegExp) { | 1652 } else if (break_point.type() == Debug.ScriptBreakPointType.ScriptRegExp) { |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 "IsBreakPointTriggered", IsBreakPointTriggered, | 2522 "IsBreakPointTriggered", IsBreakPointTriggered, |
2604 "UpdateScriptBreakPoints", UpdateScriptBreakPoints, | 2523 "UpdateScriptBreakPoints", UpdateScriptBreakPoints, |
2605 ]); | 2524 ]); |
2606 | 2525 |
2607 // Export to liveedit.js | 2526 // Export to liveedit.js |
2608 utils.Export(function(to) { | 2527 utils.Export(function(to) { |
2609 to.GetScriptBreakPoints = GetScriptBreakPoints; | 2528 to.GetScriptBreakPoints = GetScriptBreakPoints; |
2610 }); | 2529 }); |
2611 | 2530 |
2612 }) | 2531 }) |
OLD | NEW |