var next_break_point_number = 1;
var break_points = [];
var script_break_points = [];
+var debugger_flags = {
+ breakPointsActive: {
+ value: true,
+ getValue: function() { return this.value; },
+ setValue: function(value) {
+ this.value = !!value;
+ %SetDisableBreak(!this.value);
+ }
+ }
+};
// Create a new break point object and add it to the list of break points.
other_script.id, this.line_, this.column_, this.groupId_);
copy.number_ = next_break_point_number++;
script_break_points.push(copy);
-
+
copy.hit_count_ = this.hit_count_;
copy.active_ = this.active_;
copy.condition_ = this.condition_;
Debug.scripts = function() {
// Collect all scripts in the heap.
return %DebugGetLoadedScripts();
-}
+};
+
+
+Debug.debuggerFlags = function() {
+ return debugger_flags;
+};
+
function MakeExecutionState(break_id) {
return new ExecutionState(break_id);
} else if (request.command == 'version') {
this.versionRequest_(request, response);
} else if (request.command == 'profile') {
- this.profileRequest_(request, response);
+ this.profileRequest_(request, response);
} else if (request.command == 'changelive') {
- this.changeLiveRequest_(request, response);
+ this.changeLiveRequest_(request, response);
+ } else if (request.command == 'flags') {
+ this.debuggerFlagsRequest_(request, response);
} else {
throw new Error('Unknown command "' + request.command + '" in request');
}
response.body = { breakpoint: break_point }
}
+
DebugCommandProcessor.prototype.listBreakpointsRequest_ = function(request, response) {
var array = [];
for (var i = 0; i < script_break_points.length; i++) {
ignoreCount: break_point.ignoreCount(),
actual_locations: break_point.actual_locations()
}
-
+
if (break_point.type() == Debug.ScriptBreakPointType.ScriptId) {
description.type = 'scriptId';
description.script_id = break_point.script_id();
}
array.push(description);
}
-
+
response.body = { breakpoints: array }
}
}
var change_log = new Array();
-
+
if (!IS_STRING(request.arguments.new_source)) {
throw "new_source argument expected";
}
};
+DebugCommandProcessor.prototype.debuggerFlagsRequest_ = function(request,
+ response) {
+ // Check for legal request.
+ if (!request.arguments) {
+ response.failed('Missing arguments');
+ return;
+ }
+
+ // Pull out arguments.
+ var flags = request.arguments.flags;
+
+ response.body = { flags: [] };
+ if (!IS_UNDEFINED(flags)) {
+ for (var i = 0; i < flags.length; i++) {
+ var name = flags[i].name;
+ var debugger_flag = debugger_flags[name];
+ if (!debugger_flag) {
+ continue;
+ }
+ if ('value' in flags[i]) {
+ debugger_flag.setValue(flags[i].value);
+ }
+ response.body.flags.push({ name: name, value: debugger_flag.getValue() });
+ }
+ } else {
+ for (var name in debugger_flags) {
+ var value = debugger_flags[name].getValue();
+ response.body.flags.push({ name: name, value: value });
+ }
+ }
+}
+
+
// Check whether the previously processed command caused the VM to become
// running.
DebugCommandProcessor.prototype.isRunning = function() {