summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorMike McLaughlin <mikem@microsoft.com>2018-01-24 12:31:44 -0800
committerGitHub <noreply@github.com>2018-01-24 12:31:44 -0800
commit7b551b61bbf1a681fee67ae63dea022ad00d778d (patch)
treebb6b76b11721b1b37725ac1935c83984a832e942 /src/debug
parent9b947ca3059da9416168b39bebb2717433ffd4d3 (diff)
downloadcoreclr-7b551b61bbf1a681fee67ae63dea022ad00d778d.tar.gz
coreclr-7b551b61bbf1a681fee67ae63dea022ad00d778d.tar.bz2
coreclr-7b551b61bbf1a681fee67ae63dea022ad00d778d.zip
Add "CLRJitAttachState" global export from coreclr.dll that contains the CLR_DEBUGGING_PROCESS_FLAGS for VS. (#15973)
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/ee/debugger.cpp18
-rw-r--r--src/debug/ee/debugger.h7
2 files changed, 10 insertions, 15 deletions
diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp
index bd5ba80243..baefbb5bd8 100644
--- a/src/debug/ee/debugger.cpp
+++ b/src/debug/ee/debugger.cpp
@@ -67,6 +67,10 @@ GPTR_IMPL(Debugger, g_pDebugger);
GPTR_IMPL(EEDebugInterface, g_pEEInterface);
SVAL_IMPL_INIT(BOOL, Debugger, s_fCanChangeNgenFlags, TRUE);
+// This is a public export so debuggers can read and determine if the coreclr
+// process is waiting for JIT debugging attach.
+GVAL_IMPL_INIT(ULONG, CLRJitAttachState, 0);
+
bool g_EnableSIS = false;
// The following instances are used for invoking overloaded new/delete
@@ -941,9 +945,7 @@ Debugger::Debugger()
#endif //_DEBUG
m_threadsAtUnsafePlaces(0),
m_jitAttachInProgress(FALSE),
- m_attachingForManagedEvent(FALSE),
m_launchingDebugger(FALSE),
- m_userRequestedDebuggerLaunch(FALSE),
m_LoggingEnabled(TRUE),
m_pAppDomainCB(NULL),
m_dClassLoadCallbackCount(0),
@@ -6738,9 +6740,8 @@ DebuggerLaunchSetting Debugger::GetDbgJITDebugLaunchSetting()
CLR_DEBUGGING_PROCESS_FLAGS Debugger::GetAttachStateFlags()
{
LIMITED_METHOD_DAC_CONTRACT;
- return (CLR_DEBUGGING_PROCESS_FLAGS)
- ((m_attachingForManagedEvent ? CLR_DEBUGGING_MANAGED_EVENT_PENDING : 0)
- | (m_userRequestedDebuggerLaunch ? CLR_DEBUGGING_MANAGED_EVENT_DEBUGGER_LAUNCH : 0));
+ ULONG flags = CLRJitAttachState;
+ return (CLR_DEBUGGING_PROCESS_FLAGS)flags;
}
#ifndef DACCESS_COMPILE
@@ -6965,9 +6966,8 @@ BOOL Debugger::PreJitAttach(BOOL willSendManagedEvent, BOOL willLaunchDebugger,
if (!m_jitAttachInProgress)
{
m_jitAttachInProgress = TRUE;
- m_attachingForManagedEvent = willSendManagedEvent;
m_launchingDebugger = willLaunchDebugger;
- m_userRequestedDebuggerLaunch = explicitUserRequest;
+ CLRJitAttachState = (willSendManagedEvent ? CLR_DEBUGGING_MANAGED_EVENT_PENDING : 0) | (explicitUserRequest ? CLR_DEBUGGING_MANAGED_EVENT_DEBUGGER_LAUNCH : 0);
ResetEvent(GetUnmanagedAttachEvent());
ResetEvent(GetAttachEvent());
LOG( (LF_CORDB, LL_INFO10000, "D::PreJA: Leaving - first thread\n") );
@@ -7139,9 +7139,9 @@ void Debugger::PostJitAttach()
// clear the attaching flags which allows other threads to initiate jit attach if needed
m_jitAttachInProgress = FALSE;
- m_attachingForManagedEvent = FALSE;
m_launchingDebugger = FALSE;
- m_userRequestedDebuggerLaunch = FALSE;
+ CLRJitAttachState = 0;
+
// set the attaching events to unblock other threads waiting on this attach
// regardless of whether or not it completed
SetEvent(GetUnmanagedAttachEvent());
diff --git a/src/debug/ee/debugger.h b/src/debug/ee/debugger.h
index b8766d8a19..5eec66cefd 100644
--- a/src/debug/ee/debugger.h
+++ b/src/debug/ee/debugger.h
@@ -110,6 +110,7 @@ typedef DPTR(struct DebuggerIPCControlBlock) PTR_DebuggerIPCControlBlock;
GPTR_DECL(Debugger, g_pDebugger);
GPTR_DECL(EEDebugInterface, g_pEEInterface);
+GVAL_DECL(ULONG, CLRJitAttachState);
#ifndef FEATURE_PAL
GVAL_DECL(HANDLE, g_hContinueStartupEvent);
#endif
@@ -2849,13 +2850,7 @@ private:
#endif
LONG m_threadsAtUnsafePlaces;
Volatile<BOOL> m_jitAttachInProgress;
-
- // True if after the jit attach we plan to send a managed non-catchup
- // debug event
- BOOL m_attachingForManagedEvent;
BOOL m_launchingDebugger;
- BOOL m_userRequestedDebuggerLaunch;
-
BOOL m_LoggingEnabled;
AppDomainEnumerationIPCBlock *m_pAppDomainCB;