Fix Unable to step through Visual Studio remote debugger with coreclr executables...
authorMike McLaughlin <mikem@microsoft.com>
Thu, 22 Sep 2016 20:51:13 +0000 (13:51 -0700)
committerGitHub <noreply@github.com>
Thu, 22 Sep 2016 20:51:13 +0000 (13:51 -0700)
Needed to add back a dummy version of ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly interface so
VS doesn't get the QI failure and stop working by not calling the "Continue" method.

Issue #7316

clr.coreclr.props
clr.defines.targets
clrdefinitions.cmake
src/debug/di/process.cpp
src/debug/di/rspriv.h
src/inc/xcordebug.idl
src/pal/prebuilt/idl/xcordebug_i.cpp
src/pal/prebuilt/inc/xcordebug.h

index f6ac42f..50b3b4f 100644 (file)
@@ -59,6 +59,7 @@
     <FeatureCominteropWinRTManagedActivation>true</FeatureCominteropWinRTManagedActivation>
     <FeatureHostAssemblyResolver>true</FeatureHostAssemblyResolver>
     <FeatureLazyCOWPages Condition="('$(TargetArch)' == 'i386') or ('$(TargetArch)' == 'arm')">true</FeatureLazyCOWPages>
+    <FeatureLegacyNetCFDbgHostControl>true</FeatureLegacyNetCFDbgHostControl>
     <FeatureRandomizedStringHashing>true</FeatureRandomizedStringHashing>
     <!-- The rejit feature is available only on supported architectures (x86 & x64) -->
     <FeatureReJIT Condition="('$(TargetArch)' == 'i386') or ('$(TargetArch)' == 'amd64')">true</FeatureReJIT>
index fd2b5e4..9667a77 100644 (file)
@@ -54,6 +54,7 @@
         <CDefines Condition="'$(FeatureIsymReader)' == 'true'">$(CDefines);FEATURE_ISYM_READER</CDefines>
         <CDefines Condition="'$(FeatureLazyCOWPages)' == 'true'">$(CDefines);FEATURE_LAZY_COW_PAGES</CDefines>
         <CDefines Condition="'$(FeatureLeakCultureInfo)' == 'true'">$(CDefines);FEATURE_LEAK_CULTURE_INFO</CDefines>
+        <CDefines Condition="'$(FeatureLegacyNetCFDbgHostControl)' == 'true'">$(CDefines);FEATURE_LEGACYNETCF_DBG_HOST_CONTROL</CDefines> 
         <CDefines Condition="'$(FeatureLegacySurface)' == 'true'">$(CDefines);FEATURE_LEGACYSURFACE</CDefines>
         <CDefines Condition="'$(FeatureLoaderOptimization)' == 'true'">$(CDefines);FEATURE_LOADER_OPTIMIZATION</CDefines>
         <CDefines Condition="'$(FeatureMacl)' == 'true'">$(CDefines);FEATURE_MACL</CDefines>
index 1622377..b61ab8f 100644 (file)
@@ -186,6 +186,7 @@ endif(WIN32)
 if(NOT CLR_CMAKE_PLATFORM_UNIX)
     add_definitions(-DFEATURE_WIN32_REGISTRY)
 endif(NOT CLR_CMAKE_PLATFORM_UNIX)
+add_definitions(-DFEATURE_LEGACYNETCF_DBG_HOST_CONTROL)
 add_definitions(-DFEATURE_WINDOWSPHONE)
 add_definitions(-DFEATURE_WINMD_RESILIENT)
 add_definitions(-D_SECURE_SCL=0)
index ef7ede6..44e4a0c 100644 (file)
@@ -2142,6 +2142,12 @@ HRESULT CordbProcess::QueryInterface(REFIID id, void **pInterface)
     {
         *pInterface = static_cast<ICorDebugProcess8*>(this);
     }
+#ifdef FEATURE_LEGACYNETCF_DBG_HOST_CONTROL
+    else if (id == IID_ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly)
+    {
+        *pInterface = static_cast<ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly*>(this);
+    }
+#endif
     else if (id == IID_IUnknown)
     {
         *pInterface = static_cast<IUnknown*>(static_cast<ICorDebugProcess*>(this));
@@ -2495,6 +2501,20 @@ COM_METHOD CordbProcess::EnableExceptionCallbacksOutsideOfMyCode(BOOL enableExce
     return hr;
 }
 
+#ifdef FEATURE_LEGACYNETCF_DBG_HOST_CONTROL
+
+COM_METHOD CordbProcess::InvokePauseCallback()
+{
+    return S_OK;
+}
+
+COM_METHOD CordbProcess::InvokeResumeCallback()
+{
+    return S_OK;
+}
+
+#endif
+
 HRESULT CordbProcess::GetTypeForObject(CORDB_ADDRESS addr, CordbType **ppType, CordbAppDomain **pAppDomain)
 {
     VMPTR_AppDomain appDomain;
index 01e65ac..8537678 100644 (file)
@@ -2924,6 +2924,9 @@ class CordbProcess :
     public IDacDbiInterface::IAllocator,
     public IDacDbiInterface::IMetaDataLookup,
     public IProcessShimHooks
+#ifdef FEATURE_LEGACYNETCF_DBG_HOST_CONTROL
+    , public ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly
+#endif
 {
     // Ctor is private. Use OpenVirtualProcess instead. 
     CordbProcess(ULONG64 clrInstanceId, IUnknown * pDataTarget, HMODULE hDacModule,  Cordb * pCordb, DWORD dwProcessID, ShimProcess * pShim);
@@ -3129,6 +3132,16 @@ public:
     //-----------------------------------------------------------
     COM_METHOD EnableExceptionCallbacksOutsideOfMyCode(BOOL enableExceptionsOutsideOfJMC);
 
+#ifdef FEATURE_LEGACYNETCF_DBG_HOST_CONTROL
+    // ---------------------------------------------------------------
+    // ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly
+    // ---------------------------------------------------------------
+
+    COM_METHOD InvokePauseCallback();
+    COM_METHOD InvokeResumeCallback();
+
+#endif
+
     //-----------------------------------------------------------
     // Methods not exposed via a COM interface.
     //-----------------------------------------------------------
index ef9128b..646c206 100644 (file)
@@ -54,3 +54,32 @@ interface ICorDebugProcess4 : IUnknown
     HRESULT ProcessStateChanged([in] CorDebugStateChange eChange);
 
 };
+
+#ifdef FEATURE_LEGACYNETCF_DBG_HOST_CONTROL
+
+/* A private API for use on Windows phone to invoke CLR hosting
+ * callbacks on IHostNetCFDebugControlManager. This allows the
+ * host's UI thread to be suspended and resumed on demand.
+ *
+ * This API should not be used for anything other than the 
+ * Windows Phone scenario, it should never be made public,
+ * and as soon as we support mixed-mode debugging it should
+ * be retired by removing the interface and failing any
+ * QueryInterface call for it.
+*/
+[
+    object,
+    local,
+    uuid(34B27FB0-A318-450D-A0DD-11B70B21F41D),
+    pointer_default(unique)
+]
+interface ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly : IUnknown
+{
+    // Invokes IHostNetCFDebugControlManager::NotifyPause() on the debuggee's host
+    HRESULT InvokePauseCallback();
+
+    // Invokes IHostNetCFDebugControlManager::NotifyResume() on the debuggee's host
+    HRESULT InvokeResumeCallback();
+};
+
+#endif
\ No newline at end of file
index a3d9395..ffafd17 100644 (file)
@@ -63,6 +63,8 @@ typedef IID CLSID;
 
 MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess4,0xE930C679,0x78AF,0x4953,0x8A,0xB7,0xB0,0xAA,0xBF,0x0F,0x9F,0x80);
 
+MIDL_DEFINE_GUID(IID, IID_ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly,0x34B27FB0,0xA318,0x450D,0xA0,0xDD,0x11,0xB7,0x0B,0x21,0xF4,0x1D);
+
 #undef MIDL_DEFINE_GUID
 
 #ifdef __cplusplus
index 0cf4d8e..ce4dc07 100644 (file)
@@ -45,6 +45,11 @@ typedef interface ICorDebugProcess4 ICorDebugProcess4;
 
 #endif         /* __ICorDebugProcess4_FWD_DEFINED__ */
 
+#ifndef __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_FWD_DEFINED__
+#define __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_FWD_DEFINED__
+typedef interface ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly;
+
+#endif         /* __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_FWD_DEFINED__ */
 
 /* header files for imported files */
 #include "cordebug.h"
@@ -155,6 +160,91 @@ EXTERN_C const IID IID_ICorDebugProcess4;
 
 #endif         /* __ICorDebugProcess4_INTERFACE_DEFINED__ */
 
+#ifndef __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_INTERFACE_DEFINED__
+#define __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_INTERFACE_DEFINED__
+
+/* interface ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly */
+/* [unique][uuid][local][object] */ 
+
+
+EXTERN_C const IID IID_ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+    
+    MIDL_INTERFACE("34B27FB0-A318-450D-A0DD-11B70B21F41D")
+    ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly : public IUnknown
+    {
+    public:
+        virtual HRESULT STDMETHODCALLTYPE InvokePauseCallback( void) = 0;
+        
+        virtual HRESULT STDMETHODCALLTYPE InvokeResumeCallback( void) = 0;
+        
+    };
+    
+    
+#else  /* C style interface */
+
+    typedef struct ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnlyVtbl
+    {
+        BEGIN_INTERFACE
+        
+        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 
+            ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly * This,
+            /* [in] */ REFIID riid,
+            /* [annotation][iid_is][out] */ 
+            _COM_Outptr_  void **ppvObject);
+        
+        ULONG ( STDMETHODCALLTYPE *AddRef )( 
+            ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly * This);
+        
+        ULONG ( STDMETHODCALLTYPE *Release )( 
+            ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly * This);
+        
+        HRESULT ( STDMETHODCALLTYPE *InvokePauseCallback )( 
+            ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly * This);
+        
+        HRESULT ( STDMETHODCALLTYPE *InvokeResumeCallback )( 
+            ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly * This);
+        
+        END_INTERFACE
+    } ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnlyVtbl;
+
+    interface ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly
+    {
+        CONST_VTBL struct ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnlyVtbl *lpVtbl;
+    };
+
+    
+
+#ifdef COBJMACROS
+
+
+#define ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_QueryInterface(This,riid,ppvObject)    \
+    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) 
+
+#define ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_AddRef(This)   \
+    ( (This)->lpVtbl -> AddRef(This) ) 
+
+#define ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_Release(This)  \
+    ( (This)->lpVtbl -> Release(This) ) 
+
+
+#define ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_InvokePauseCallback(This)      \
+    ( (This)->lpVtbl -> InvokePauseCallback(This) ) 
+
+#define ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_InvokeResumeCallback(This)     \
+    ( (This)->lpVtbl -> InvokeResumeCallback(This) ) 
+
+#endif /* COBJMACROS */
+
+
+#endif         /* C style interface */
+
+
+
+
+#endif         /* __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_INTERFACE_DEFINED__ */
+
 
 /* Additional Prototypes for ALL interfaces */