From c7d6bd7cffe9f1afe9e0aebd3206aedf904d66aa Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Mon, 14 May 2018 10:18:38 -0700 Subject: [PATCH] Boilerplate for adding new DBI method --- src/debug/di/process.cpp | 12 +++ src/debug/di/rspriv.h | 5 ++ src/inc/cordebug.idl | 11 +++ src/inc/xcordebug.idl | 11 --- src/pal/prebuilt/idl/cordebug_i.cpp | 3 + src/pal/prebuilt/idl/xcordebug_i.cpp | 21 ++++-- src/pal/prebuilt/inc/cordebug.h | 137 +++++++++++++++++++++++++++++------ src/pal/prebuilt/inc/xcordebug.h | 91 +---------------------- 8 files changed, 159 insertions(+), 132 deletions(-) diff --git a/src/debug/di/process.cpp b/src/debug/di/process.cpp index fd3e3c9..b8b0f26 100644 --- a/src/debug/di/process.cpp +++ b/src/debug/di/process.cpp @@ -2529,6 +2529,18 @@ COM_METHOD CordbProcess::EnableExceptionCallbacksOutsideOfMyCode(BOOL enableExce return hr; } +COM_METHOD CordbProcess::GetContainerObject(CORDB_ADDRESS interiorPointer, ICorDebugValue** ppContainerObject) +{ + HRESULT hr = S_OK; + PUBLIC_API_BEGIN(this); + + // TODO, databp, implementation + hr = E_NOTIMPL; + + PUBLIC_API_END(hr); + return hr; +} + COM_METHOD CordbProcess::CreateBreakpoint(CORDB_ADDRESS address, ICorDebugValueBreakpoint **ppBreakpoint) { HRESULT hr = S_OK; diff --git a/src/debug/di/rspriv.h b/src/debug/di/rspriv.h index 950013a..1122489 100644 --- a/src/debug/di/rspriv.h +++ b/src/debug/di/rspriv.h @@ -3162,6 +3162,11 @@ public: //----------------------------------------------------------- COM_METHOD EnableExceptionCallbacksOutsideOfMyCode(BOOL enableExceptionsOutsideOfJMC); + //----------------------------------------------------------- + // ICorDebugProcess9 + //----------------------------------------------------------- + COM_METHOD GetContainerObject(CORDB_ADDRESS interiorPointer, ICorDebugValue** ppContainerObject); + COM_METHOD CreateBreakpoint(CORDB_ADDRESS address, ICorDebugValueBreakpoint **ppBreakpoint); #ifdef FEATURE_LEGACYNETCF_DBG_HOST_CONTROL diff --git a/src/inc/cordebug.idl b/src/inc/cordebug.idl index ea9ea2b..0faaa7a 100644 --- a/src/inc/cordebug.idl +++ b/src/inc/cordebug.idl @@ -3259,6 +3259,17 @@ interface ICorDebugProcess8 : IUnknown HRESULT EnableExceptionCallbacksOutsideOfMyCode([in] BOOL enableExceptionsOutsideOfJMC); } +[ + object, + local, + uuid(8F378F6F-1017-4461-9890-ECF64C54079F), + pointer_default(unique) +] +interface ICorDebugProcess9 : IUnknown +{ + HRESULT GetContainerObject([in] CORDB_ADDRESS interiorPointer, [out] ICorDebugValue** ppContainerObject); +} + // Event types MODULE_LOADED and MODULE_UNLOADED implement this interface [ object, diff --git a/src/inc/xcordebug.idl b/src/inc/xcordebug.idl index 5a1a48a..646c206 100644 --- a/src/inc/xcordebug.idl +++ b/src/inc/xcordebug.idl @@ -55,17 +55,6 @@ interface ICorDebugProcess4 : IUnknown }; -[ - object, - local, - uuid(CB54E392-C6DD-47BE-9C60-A99F3ECE3A98), - pointer_default(unique) -] -interface ICorDebugProcess9 : IUnknown -{ - HRESULT CreateBreakpoint([in] CORDB_ADDRESS address, [out] ICorDebugValueBreakpoint **ppBreakpoint); -} - #ifdef FEATURE_LEGACYNETCF_DBG_HOST_CONTROL /* A private API for use on Windows phone to invoke CLR hosting diff --git a/src/pal/prebuilt/idl/cordebug_i.cpp b/src/pal/prebuilt/idl/cordebug_i.cpp index 69d03ac..15e25c8 100644 --- a/src/pal/prebuilt/idl/cordebug_i.cpp +++ b/src/pal/prebuilt/idl/cordebug_i.cpp @@ -202,6 +202,9 @@ MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess7,0x9B2C54E4,0x119F,0x4D6F,0xB4,0x02,0 MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess8,0x2E6F28C1,0x85EB,0x4141,0x80,0xAD,0x0A,0x90,0x94,0x4B,0x96,0x39); +MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess9,0x8F378F6F,0x1017,0x4461,0x98,0x90,0xEC,0xF6,0x4C,0x54,0x07,0x9F); + + MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleDebugEvent,0x51A15E8D,0x9FFF,0x4864,0x9B,0x87,0xF4,0xFB,0xDE,0xA7,0x47,0xA2); diff --git a/src/pal/prebuilt/idl/xcordebug_i.cpp b/src/pal/prebuilt/idl/xcordebug_i.cpp index ffafd17..d87c3dc 100644 --- a/src/pal/prebuilt/idl/xcordebug_i.cpp +++ b/src/pal/prebuilt/idl/xcordebug_i.cpp @@ -1,7 +1,3 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - /* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ @@ -9,7 +5,17 @@ /* link this file in with the server and any clients */ - /* File created by MIDL compiler version 8.00.0603 */ + /* File created by MIDL compiler version 8.01.0622 */ +/* at Mon Jan 18 19:14:07 2038 + */ +/* Compiler settings for F:/Dev/coreclr/src/inc/xcordebug.idl: + Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ /* @@MIDL_FILE_HEADING( ) */ #pragma warning( disable: 4049 ) /* more than 64k source lines */ @@ -57,12 +63,13 @@ typedef IID CLSID; #endif // CLSID_DEFINED #define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ - const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} -#endif !_MIDL_USE_GUIDDEF_ +#endif // !_MIDL_USE_GUIDDEF_ 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 diff --git a/src/pal/prebuilt/inc/cordebug.h b/src/pal/prebuilt/inc/cordebug.h index 55460ca..f89a745 100644 --- a/src/pal/prebuilt/inc/cordebug.h +++ b/src/pal/prebuilt/inc/cordebug.h @@ -360,6 +360,13 @@ typedef interface ICorDebugProcess8 ICorDebugProcess8; #endif /* __ICorDebugProcess8_FWD_DEFINED__ */ +#ifndef __ICorDebugProcess9_FWD_DEFINED__ +#define __ICorDebugProcess9_FWD_DEFINED__ +typedef interface ICorDebugProcess9 ICorDebugProcess9; + +#endif /* __ICorDebugProcess9_FWD_DEFINED__ */ + + #ifndef __ICorDebugModuleDebugEvent_FWD_DEFINED__ #define __ICorDebugModuleDebugEvent_FWD_DEFINED__ typedef interface ICorDebugModuleDebugEvent ICorDebugModuleDebugEvent; @@ -7804,6 +7811,88 @@ EXTERN_C const IID IID_ICorDebugProcess8; #endif /* __ICorDebugProcess8_INTERFACE_DEFINED__ */ +#ifndef __ICorDebugProcess9_INTERFACE_DEFINED__ +#define __ICorDebugProcess9_INTERFACE_DEFINED__ + +/* interface ICorDebugProcess9 */ +/* [unique][uuid][local][object] */ + + +EXTERN_C const IID IID_ICorDebugProcess9; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8F378F6F-1017-4461-9890-ECF64C54079F") + ICorDebugProcess9 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetContainerObject( + /* [in] */ CORDB_ADDRESS interiorPointer, + /* [out] */ ICorDebugValue **ppContainerObject) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorDebugProcess9Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorDebugProcess9 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorDebugProcess9 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICorDebugProcess9 * This); + + HRESULT ( STDMETHODCALLTYPE *GetContainerObject )( + ICorDebugProcess9 * This, + /* [in] */ CORDB_ADDRESS interiorPointer, + /* [out] */ ICorDebugValue **ppContainerObject); + + END_INTERFACE + } ICorDebugProcess9Vtbl; + + interface ICorDebugProcess9 + { + CONST_VTBL struct ICorDebugProcess9Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorDebugProcess9_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorDebugProcess9_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorDebugProcess9_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorDebugProcess9_GetContainerObject(This,interiorPointer,ppContainerObject) \ + ( (This)->lpVtbl -> GetContainerObject(This,interiorPointer,ppContainerObject) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICorDebugProcess9_INTERFACE_DEFINED__ */ + + #ifndef __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ #define __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ @@ -10788,7 +10877,7 @@ EXTERN_C const IID IID_ICorDebugILFrame3; #endif /* __ICorDebugILFrame3_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0066 */ +/* interface __MIDL_itf_cordebug_0000_0067 */ /* [local] */ typedef @@ -10800,8 +10889,8 @@ enum ILCodeKind -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0066_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0066_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0067_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0067_v0_0_s_ifspec; #ifndef __ICorDebugILFrame4_INTERFACE_DEFINED__ #define __ICorDebugILFrame4_INTERFACE_DEFINED__ @@ -11165,15 +11254,15 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; #endif /* __ICorDebugNativeFrame_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0068 */ +/* interface __MIDL_itf_cordebug_0000_0069 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0068_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0068_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_s_ifspec; #ifndef __ICorDebugNativeFrame2_INTERFACE_DEFINED__ #define __ICorDebugNativeFrame2_INTERFACE_DEFINED__ @@ -11743,14 +11832,14 @@ EXTERN_C const IID IID_ICorDebugModule; #endif /* __ICorDebugModule_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0072 */ +/* interface __MIDL_itf_cordebug_0000_0073 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0072_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0072_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0073_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0073_v0_0_s_ifspec; #ifndef __ICorDebugModule2_INTERFACE_DEFINED__ #define __ICorDebugModule2_INTERFACE_DEFINED__ @@ -14707,15 +14796,15 @@ EXTERN_C const IID IID_ICorDebugBoxValue; #endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0098 */ +/* interface __MIDL_itf_cordebug_0000_0099 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0098_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0098_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0099_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0099_v0_0_s_ifspec; #ifndef __ICorDebugStringValue_INTERFACE_DEFINED__ #define __ICorDebugStringValue_INTERFACE_DEFINED__ @@ -14855,14 +14944,14 @@ EXTERN_C const IID IID_ICorDebugStringValue; #endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0099 */ +/* interface __MIDL_itf_cordebug_0000_0100 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0099_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0099_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0100_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0100_v0_0_s_ifspec; #ifndef __ICorDebugArrayValue_INTERFACE_DEFINED__ #define __ICorDebugArrayValue_INTERFACE_DEFINED__ @@ -17637,15 +17726,15 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum; #endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0123 */ +/* interface __MIDL_itf_cordebug_0000_0124 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0123_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0123_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0124_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0124_v0_0_s_ifspec; #ifndef __ICorDebugMDA_INTERFACE_DEFINED__ #define __ICorDebugMDA_INTERFACE_DEFINED__ @@ -17785,7 +17874,7 @@ EXTERN_C const IID IID_ICorDebugMDA; #endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0124 */ +/* interface __MIDL_itf_cordebug_0000_0125 */ /* [local] */ #pragma warning(pop) @@ -17793,8 +17882,8 @@ EXTERN_C const IID IID_ICorDebugMDA; #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0124_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0124_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_s_ifspec; #ifndef __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ #define __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ @@ -17910,14 +17999,14 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo; #endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0125 */ +/* interface __MIDL_itf_cordebug_0000_0126 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0126_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0126_v0_0_s_ifspec; #ifndef __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ #define __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ diff --git a/src/pal/prebuilt/inc/xcordebug.h b/src/pal/prebuilt/inc/xcordebug.h index 3c97b12..4160fe5 100644 --- a/src/pal/prebuilt/inc/xcordebug.h +++ b/src/pal/prebuilt/inc/xcordebug.h @@ -6,7 +6,7 @@ /* File created by MIDL compiler version 8.01.0622 */ /* at Mon Jan 18 19:14:07 2038 */ -/* Compiler settings for C:/coreclr/src/inc/xcordebug.idl: +/* Compiler settings for F:/Dev/coreclr/src/inc/xcordebug.idl: Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data @@ -52,13 +52,6 @@ typedef interface ICorDebugProcess4 ICorDebugProcess4; #endif /* __ICorDebugProcess4_FWD_DEFINED__ */ -#ifndef __ICorDebugProcess9_FWD_DEFINED__ -#define __ICorDebugProcess9_FWD_DEFINED__ -typedef interface ICorDebugProcess9 ICorDebugProcess9; - -#endif /* __ICorDebugProcess9_FWD_DEFINED__ */ - - #ifndef __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_FWD_DEFINED__ #define __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_FWD_DEFINED__ typedef interface ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly; @@ -176,88 +169,6 @@ EXTERN_C const IID IID_ICorDebugProcess4; #endif /* __ICorDebugProcess4_INTERFACE_DEFINED__ */ -#ifndef __ICorDebugProcess9_INTERFACE_DEFINED__ -#define __ICorDebugProcess9_INTERFACE_DEFINED__ - -/* interface ICorDebugProcess9 */ -/* [unique][uuid][local][object] */ - - -EXTERN_C const IID IID_ICorDebugProcess9; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("CB54E392-C6DD-47BE-9C60-A99F3ECE3A98") - ICorDebugProcess9 : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE CreateBreakpoint( - /* [in] */ CORDB_ADDRESS address, - /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint) = 0; - - }; - - -#else /* C style interface */ - - typedef struct ICorDebugProcess9Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ICorDebugProcess9 * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - _COM_Outptr_ void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - ICorDebugProcess9 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - ICorDebugProcess9 * This); - - HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( - ICorDebugProcess9 * This, - /* [in] */ CORDB_ADDRESS address, - /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); - - END_INTERFACE - } ICorDebugProcess9Vtbl; - - interface ICorDebugProcess9 - { - CONST_VTBL struct ICorDebugProcess9Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ICorDebugProcess9_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ICorDebugProcess9_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ICorDebugProcess9_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ICorDebugProcess9_CreateBreakpoint(This,address,ppBreakpoint) \ - ( (This)->lpVtbl -> CreateBreakpoint(This,address,ppBreakpoint) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ICorDebugProcess9_INTERFACE_DEFINED__ */ - - #ifndef __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_INTERFACE_DEFINED__ #define __ICorDebugLegacyNetCFHostCallbackInvoker_PrivateWindowsPhoneOnly_INTERFACE_DEFINED__ -- 2.7.4