Suspend/resume working.

This commit is contained in:
Ben Vanik
2013-12-23 19:46:35 -08:00
parent dc48b0a85a
commit 98efc7ddfa
11 changed files with 95 additions and 28 deletions

View File

@@ -218,6 +218,10 @@ void Processor::OnDebugClientDisconnected(uint32_t client_id) {
debug_client_states_.erase(client_id);
xe_mutex_unlock(debug_client_states_lock_);
delete client_state;
// Whenever we support multiple clients we will need to respect pause
// settings. For now, resume until running.
runtime_->debugger()->ResumeAllThreads(true);
}
json_t* Processor::OnDebugRequest(
@@ -417,6 +421,21 @@ json_t* Processor::OnDebugRequest(
return json_string("Unable to remove breakpoints");
}
return json_null();
} else if (xestrcmpa(command, "continue") == 0) {
if (runtime_->debugger()->ResumeAllThreads()) {
succeeded = false;
return json_string("Unable to resume threads");
}
return json_null();
} else if (xestrcmpa(command, "break") == 0) {
if (runtime_->debugger()->SuspendAllThreads()) {
succeeded = false;
return json_string("Unable to suspend threads");
}
return json_null();
} else if (xestrcmpa(command, "step") == 0) {
// threadId
return json_null();
} else {
succeeded = false;
return json_string("Unknown command");