Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Fix Unable to step through Visual Studio remote debugger with coreclr…
Browse files Browse the repository at this point in the history
… executables on Nano Server (#7326)

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
  • Loading branch information
mikem8361 authored Sep 23, 2016
1 parent b9d1aae commit ecbf7ad
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 0 deletions.
1 change: 1 addition & 0 deletions clr.coreclr.props
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,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>
Expand Down
1 change: 1 addition & 0 deletions clr.defines.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,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)
Expand Down
20 changes: 20 additions & 0 deletions src/debug/di/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions src/debug/di/rspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -3129,6 +3132,16 @@ class CordbProcess :
//-----------------------------------------------------------
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.
//-----------------------------------------------------------
Expand Down
29 changes: 29 additions & 0 deletions src/inc/xcordebug.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/pal/prebuilt/idl/xcordebug_i.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
90 changes: 90 additions & 0 deletions src/pal/prebuilt/inc/xcordebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 */

Expand Down

0 comments on commit ecbf7ad

Please sign in to comment.