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

Unified Diff: src/debug-delay.js

Issue 149197: Allow deleting groups of breakpoints (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/debug-clearbreakpointgroup.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-delay.js
===================================================================
--- src/debug-delay.js (revision 2375)
+++ src/debug-delay.js (working copy)
@@ -223,7 +223,8 @@
// Object representing a script break point. The script is referenced by its
// script name or script id and the break point is represented as line and
// column.
-function ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column) {
+function ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column,
+ opt_groupId) {
this.type_ = type;
if (type == Debug.ScriptBreakPointType.ScriptId) {
this.script_id_ = script_id_or_name;
@@ -232,6 +233,7 @@
}
this.line_ = opt_line || 0;
this.column_ = opt_column;
+ this.groupId_ = opt_groupId;
this.hit_count_ = 0;
this.active_ = true;
this.condition_ = null;
@@ -244,6 +246,11 @@
};
+ScriptBreakPoint.prototype.groupId = function() {
+ return this.groupId_;
+};
+
+
ScriptBreakPoint.prototype.type = function() {
return this.type_;
};
@@ -611,10 +618,12 @@
// Sets a breakpoint in a script identified through id or name at the
// specified source line and column within that line.
Debug.setScriptBreakPoint = function(type, script_id_or_name,
- opt_line, opt_column, opt_condition) {
+ opt_line, opt_column, opt_condition,
+ opt_groupId) {
// Create script break point object.
var script_break_point =
- new ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column);
+ new ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column,
+ opt_groupId);
// Assign number to the new script break point and add it.
script_break_point.number_ = next_break_point_number++;
@@ -636,19 +645,19 @@
Debug.setScriptBreakPointById = function(script_id,
opt_line, opt_column,
- opt_condition) {
+ opt_condition, opt_groupId) {
return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId,
script_id, opt_line, opt_column,
- opt_condition)
+ opt_condition, opt_groupId);
}
Debug.setScriptBreakPointByName = function(script_name,
opt_line, opt_column,
- opt_condition) {
+ opt_condition, opt_groupId) {
return this.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptName,
script_name, opt_line, opt_column,
- opt_condition)
+ opt_condition, opt_groupId);
}
@@ -1210,6 +1219,8 @@
this.changeBreakPointRequest_(request, response);
} else if (request.command == 'clearbreakpoint') {
this.clearBreakPointRequest_(request, response);
+ } else if (request.command == 'clearbreakpointgroup') {
+ this.clearBreakPointGroupRequest_(request, response);
} else if (request.command == 'backtrace') {
this.backtraceRequest_(request, response);
} else if (request.command == 'frame') {
@@ -1325,6 +1336,7 @@
true : request.arguments.enabled;
var condition = request.arguments.condition;
var ignoreCount = request.arguments.ignoreCount;
+ var groupId = request.arguments.groupId;
// Check for legal arguments.
if (!type || IS_UNDEFINED(target)) {
@@ -1378,10 +1390,11 @@
} else if (type == 'script') {
// set script break point.
break_point_number =
- Debug.setScriptBreakPointByName(target, line, column, condition);
+ Debug.setScriptBreakPointByName(target, line, column, condition,
+ groupId);
} else { // type == 'scriptId.
break_point_number =
- Debug.setScriptBreakPointById(target, line, column, condition);
+ Debug.setScriptBreakPointById(target, line, column, condition, groupId);
}
// Set additional break point properties.
@@ -1454,6 +1467,40 @@
}
+DebugCommandProcessor.prototype.clearBreakPointGroupRequest_ = function(request, response) {
+ // Check for legal request.
+ if (!request.arguments) {
+ response.failed('Missing arguments');
+ return;
+ }
+
+ // Pull out arguments.
+ var group_id = request.arguments.groupId;
+
+ // Check for legal arguments.
+ if (!group_id) {
+ response.failed('Missing argument "groupId"');
+ return;
+ }
+
+ var cleared_break_points = [];
+ var new_script_break_points = [];
+ for (var i = 0; i < script_break_points.length; i++) {
+ var next_break_point = script_break_points[i];
+ if (next_break_point.groupId() == group_id) {
+ cleared_break_points.push(next_break_point.number());
+ next_break_point.clear();
+ } else {
+ new_script_break_points.push(next_break_point);
+ }
+ }
+ script_break_points = new_script_break_points;
+
+ // Add the cleared break point numbers to the response.
+ response.body = { breakpoints: cleared_break_points };
+}
+
+
DebugCommandProcessor.prototype.clearBreakPointRequest_ = function(request, response) {
// Check for legal request.
if (!request.arguments) {
« no previous file with comments | « no previous file | test/mjsunit/debug-clearbreakpointgroup.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698