Commit 93bd4954 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Minor debugger cleanup. Store the running state of the previous debugger...

Minor debugger cleanup. Store the running state of the previous debugger response to avoid having to parse the just generated JSON response just to pick out the running state. Also removed an unused function.
Review URL: http://codereview.chromium.org/20039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1222 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4b05db4e
...@@ -945,6 +945,7 @@ NewFunctionEvent.prototype.setBreakPoint = function(p) { ...@@ -945,6 +945,7 @@ NewFunctionEvent.prototype.setBreakPoint = function(p) {
function DebugCommandProcessor(exec_state) { function DebugCommandProcessor(exec_state) {
this.exec_state_ = exec_state; this.exec_state_ = exec_state;
this.running_ = false;
}; };
...@@ -953,11 +954,6 @@ DebugCommandProcessor.prototype.processDebugRequest = function (request) { ...@@ -953,11 +954,6 @@ DebugCommandProcessor.prototype.processDebugRequest = function (request) {
} }
DebugCommandProcessor.prototype.responseIsRunning = function (response) {
return this.isRunning(response);
}
function ResponsePacket(request) { function ResponsePacket(request) {
// Build the initial response from the request. // Build the initial response from the request.
this.seq = next_response_seq++; this.seq = next_response_seq++;
...@@ -1032,7 +1028,7 @@ DebugCommandProcessor.prototype.createResponse = function(request) { ...@@ -1032,7 +1028,7 @@ DebugCommandProcessor.prototype.createResponse = function(request) {
}; };
DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request, stopping) { DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request) {
var request; // Current request. var request; // Current request.
var response; // Generated response. var response; // Generated response.
try { try {
...@@ -1091,10 +1087,7 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request, ...@@ -1091,10 +1087,7 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request,
// Return the response as a JSON encoded string. // Return the response as a JSON encoded string.
try { try {
// Set the running state to what indicated. this.running_ = response.running; // Store the running state.
if (!IS_UNDEFINED(stopping)) {
response.running = !stopping;
}
return response.toJSONProtocol(); return response.toJSONProtocol();
} catch (e) { } catch (e) {
// Failed to generate response - return generic error. // Failed to generate response - return generic error.
...@@ -1538,18 +1531,10 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) { ...@@ -1538,18 +1531,10 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
}; };
// Check whether the JSON response indicate that the VM should be running. // Check whether the previously processed command caused the VM to become
DebugCommandProcessor.prototype.isRunning = function(json_response) { // running.
try { DebugCommandProcessor.prototype.isRunning = function() {
// Convert the JSON string to an object. return this.running_;
response = %CompileString('(' + json_response + ')', 0)();
// Return whether VM should be running after this request.
return response.running;
} catch (e) {
return false;
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment