Suspend some host threads that make guest callbacks.

This commit is contained in:
Ben Vanik
2015-09-21 21:24:26 -07:00
parent 4c8634bc31
commit 3fc1d02a09
8 changed files with 25 additions and 8 deletions

View File

@@ -225,7 +225,7 @@ bool Debugger::SuspendAllThreads() {
thread_info->state == ThreadExecutionInfo::State::kExited) {
// Thread is dead and cannot be suspended - ignore.
continue;
} else if (!thread_info->thread->is_guest_thread()) {
} else if (!thread_info->thread->can_debugger_suspend()) {
// Thread is a host thread, and we aren't suspending those (for now).
continue;
} else if (XThread::IsInThread() &&
@@ -266,7 +266,7 @@ bool Debugger::ResumeAllThreads() {
thread_info->state == ThreadExecutionInfo::State::kExited) {
// Thread is dead and cannot be resumed - ignore.
continue;
} else if (!thread_info->thread->is_guest_thread()) {
} else if (!thread_info->thread->can_debugger_suspend()) {
// Thread is a host thread, and we aren't suspending those (for now).
continue;
} else if (XThread::IsInThread() &&
@@ -295,7 +295,7 @@ void Debugger::UpdateThreadExecutionStates(uint32_t override_handle,
// Grab PPC context.
// Note that this is only up to date if --store_all_context_values is
// enabled (or --debug).
if (thread->is_guest_thread()) {
if (thread->can_debugger_suspend()) {
std::memcpy(&thread_info->guest_context,
thread->thread_state()->context(),
sizeof(thread_info->guest_context));

View File

@@ -1104,7 +1104,7 @@ void DebugWindow::DrawThreadsPane() {
ImGui::SetNextTreeNodeOpened(true, ImGuiSetCond_Always);
}
const char* state_label = "?";
if (thread->is_guest_thread()) {
if (thread->can_debugger_suspend()) {
if (thread->is_running()) {
if (thread->suspend_count() > 1) {
state_label = "SUSPEND";