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

@@ -63,12 +63,12 @@ int Debugger::ResumeThread(uint32_t thread_id) {
return result;
}
int Debugger::ResumeAllThreads() {
int Debugger::ResumeAllThreads(bool force) {
int result = 0;
LockMutex(threads_lock_);
for (auto it = threads_.begin(); it != threads_.end(); ++it) {
ThreadState* thread_state = it->second;
if (thread_state->Resume()) {
if (thread_state->Resume(force)) {
result = 1;
}
}

View File

@@ -84,7 +84,7 @@ public:
int SuspendAllThreads(uint32_t timeout_ms = UINT_MAX);
int ResumeThread(uint32_t thread_id);
int ResumeAllThreads();
int ResumeAllThreads(bool force = false);
int AddBreakpoint(Breakpoint* breakpoint);
int RemoveBreakpoint(Breakpoint* breakpoint);

View File

@@ -32,8 +32,10 @@ public:
void* backend_data() const { return backend_data_; }
void* raw_context() const { return raw_context_; }
virtual volatile int* suspend_flag_address() const = 0;
virtual int Suspend(uint32_t timeout_ms = UINT_MAX) = 0;
virtual int Resume() = 0;
virtual int Resume(bool force = false) = 0;
virtual void EnterSuspend() = 0;
static void Bind(ThreadState* thread_state);
static ThreadState* Get();