summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Au <cshung@gmail.com>2019-01-04 14:15:55 -0800
committerGitHub <noreply@github.com>2019-01-04 14:15:55 -0800
commit509419356160fc419a6bbf1b70f5efb8e1dc4d10 (patch)
treed6d63192129378d2103d781ed9605174ada2f4cf
parent0234d6bcfe3c7cf98ba6dbd9d23cdbdcdd0d4a04 (diff)
downloadcoreclr-509419356160fc419a6bbf1b70f5efb8e1dc4d10.tar.gz
coreclr-509419356160fc419a6bbf1b70f5efb8e1dc4d10.tar.bz2
coreclr-509419356160fc419a6bbf1b70f5efb8e1dc4d10.zip
If the debugger is stopped on a garbage collection event, resuming the threads during detach should simply be setting the event (#21764)
-rw-r--r--src/debug/ee/debugger.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp
index 7031b55b09..573653a915 100644
--- a/src/debug/ee/debugger.cpp
+++ b/src/debug/ee/debugger.cpp
@@ -11351,14 +11351,23 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent)
// the detach reply before the process exits if the main thread is near exiting.
m_pRCThread->SendIPCReply();
- // Let the process run free now... there is no debugger to bother it anymore.
- fContinue = ResumeThreads(NULL);
+ if (this->m_isBlockedOnGarbageCollectionEvent)
+ {
+ this->m_stopped = FALSE;
+ SetEvent(this->GetGarbageCollectionBlockerEvent());
+ }
+ else
+ {
+ // Let the process run free now... there is no debugger to bother it anymore.
+ fContinue = ResumeThreads(pEvent->vmAppDomain.GetRawPtr());
+
+ //
+ // Go ahead and release the TSL now that we're continuing. This ensures that we've held
+ // the thread store lock the entire time the Runtime was just stopped.
+ //
+ ThreadSuspend::UnlockThreadStore(FALSE, ThreadSuspend::SUSPEND_FOR_DEBUGGER);
+ }
- //
- // Go ahead and release the TSL now that we're continuing. This ensures that we've held
- // the thread store lock the entire time the Runtime was just stopped.
- //
- ThreadSuspend::UnlockThreadStore(FALSE, ThreadSuspend::SUSPEND_FOR_DEBUGGER);
break;
#ifndef DACCESS_COMPILE