diff options
Diffstat (limited to 'src/debug/ee')
-rw-r--r-- | src/debug/ee/CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/debug/ee/dbgtransportproxy.cpp | 122 | ||||
-rw-r--r-- | src/debug/ee/dbgtransportproxy.h | 51 | ||||
-rw-r--r-- | src/debug/ee/ddunpack.cpp | 4578 | ||||
-rw-r--r-- | src/debug/ee/ddunpack.h | 498 | ||||
-rw-r--r-- | src/debug/ee/debugger.cpp | 227 | ||||
-rw-r--r-- | src/debug/ee/debugger.h | 34 | ||||
-rw-r--r-- | src/debug/ee/inprocdac.cpp | 432 | ||||
-rw-r--r-- | src/debug/ee/inprocdac.h | 157 | ||||
-rw-r--r-- | src/debug/ee/rcthread.cpp | 326 |
10 files changed, 209 insertions, 6225 deletions
diff --git a/src/debug/ee/CMakeLists.txt b/src/debug/ee/CMakeLists.txt index 5200072353..2b8d229cee 100644 --- a/src/debug/ee/CMakeLists.txt +++ b/src/debug/ee/CMakeLists.txt @@ -36,15 +36,6 @@ set(CORDBEE_SOURCES_DAC ${CORDBEE_SOURCES_DAC_AND_WKS} ) -if(WIN32) - list(APPEND CORDBEE_SOURCES_WKS - # The following files need to be ported to Linux - inprocdac.cpp - dbgtransportproxy.cpp - ddunpack.cpp - ) -endif(WIN32) - if (IS_64BIT_BUILD EQUAL 1) list(APPEND CORDBEE_SOURCES_WKS amd64/amd64walker.cpp) else () diff --git a/src/debug/ee/dbgtransportproxy.cpp b/src/debug/ee/dbgtransportproxy.cpp deleted file mode 100644 index 7847d9aff3..0000000000 --- a/src/debug/ee/dbgtransportproxy.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// - - -#include "stdafx.h" -#include "dbgtransportsession.h" -#include "dbgtransportproxy.h" -#include "dbgproxy.h" - -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - -// -// Provides access to the debugging proxy process from the left side. -// - -DbgTransportProxy::DbgTransportProxy() -{ - memset(this, 0, sizeof(*this)); -} - -// Startup and shutdown. Initialization takes the port number (in host byte order) that the left side will -// wait on for debugger connections. -HRESULT DbgTransportProxy::Init(unsigned short usPort) -{ - // Query the debugger configuration for the current user, this will give us the port number the proxy is - // using. By the time the this method is called we know that debugging is configured on for this process. - DbgConfiguration sDbgConfig; - if (!GetDebuggerConfiguration(&sDbgConfig)) - return E_OUTOFMEMORY; - _ASSERTE(sDbgConfig.m_fEnabled); - m_usProxyPort = sDbgConfig.m_usProxyPort; - - m_usPort = usPort; - - // Initialize some data the proxy needs when we register. - m_uiPID = GetCurrentProcessId(); - - // Allocate the connection manager and initialize it. - m_pConnectionManager = AllocateSecConnMgr(); - if (m_pConnectionManager == NULL) - return E_OUTOFMEMORY; - - SecConnStatus eStatus = m_pConnectionManager->Initialize(); - if (eStatus != SCS_Success) - return eStatus == SCS_OutOfMemory ? E_OUTOFMEMORY : E_FAIL; - - return S_OK; -} - -void DbgTransportProxy::Shutdown() -{ - if (m_pConnectionManager) - m_pConnectionManager->Destroy(); -} - -// Talk with the proxy process and register this instantiation of the runtime with it. The reply from the -// proxy will indicate whether a debugger wishes to attach to us before any managed code is allowed to -// run. This method is synchronous and will wait for the reply from the proxy (or a timeout). -DbgProxyResult DbgTransportProxy::RegisterWithProxy() -{ - // Attempt a connection to the proxy. Any failure is treated as the proxy not being there. No time for - // retries and timeouts, we're holding up process startup. - SecConn *pConnection = NULL; - SecConnStatus eStatus = m_pConnectionManager->AllocateConnection(DBGIPC_NTOHL(inet_addr("127.0.0.1")), - m_usProxyPort, - &pConnection); - if (eStatus == SCS_Success) - eStatus = pConnection->Connect(); - - if (eStatus != SCS_Success) - { - DbgTransportLog(LC_Proxy, "DbgTransportProxy::RegisterWithProxy(): failed to connect to proxy"); - if (pConnection) - pConnection->Destroy(); - return RequestTimedOut; - } - - // Format a registration message for the proxy. - DbgProxyRegisterRuntimeMessage sRequest; - sRequest.m_sHeader.m_eType = DPMT_RegisterRuntime; - sRequest.m_sHeader.m_uiRequestID = 0; - sRequest.m_sHeader.m_uiMagic = DBGPROXY_MAGIC_VALUE(&sRequest.m_sHeader); - sRequest.m_sHeader.m_uiReserved = 0; - sRequest.m_uiMajorVersion = kCurrentMajorVersion; - sRequest.m_uiMinorVersion = kCurrentMinorVersion; - sRequest.m_uiPID = m_uiPID; - sRequest.m_usPort = m_usPort; - - // Send the message. If we can't even do that we act as though the proxy timed out on us (runtime startup - // will continue and this process will not be debuggable). - if (!pConnection->Send((unsigned char*)&sRequest, sizeof(sRequest))) - { - DbgTransportLog(LC_Proxy, "DbgTransportProxy::RegisterWithProxy(): failed to send registration to proxy"); - return RequestTimedOut; - } - - // Wait for the reply. - DbgProxyMessageHeader sReply; - if (!pConnection->Receive((unsigned char*)&sReply, sizeof(sReply))) - { - DbgTransportLog(LC_Proxy, "DbgTransportProxy::RegisterWithProxy(): failed to receive reply from proxy"); - return RequestTimedOut; - } - - // Validate reply. - if (sReply.m_eType != DPMT_RuntimeRegistered || - sReply.VariantData.RuntimeRegistered.m_uiMajorVersion != (unsigned)kCurrentMajorVersion || - sReply.m_uiMagic != DBGPROXY_MAGIC_VALUE(&sReply)) - { - DbgTransportLog(LC_Proxy, "DbgTransportProxy::RegisterWithProxy(): bad reply from the proxy"); - return RequestTimedOut; - } - - bool fWaitForDebugger = sReply.VariantData.RuntimeRegistered.m_fWaitForDebuggerAttach; - DbgTransportLog(LC_Proxy, "DbgTransportProxy::RegisterWithProxy(): %s for the debugger", - fWaitForDebugger ? "Waiting" : "Not waiting"); - return fWaitForDebugger ? PendingDebuggerAttach : RequestSuccessful; -} - -#endif // FEATURE_DBGIPC_TRANSPORT_VM diff --git a/src/debug/ee/dbgtransportproxy.h b/src/debug/ee/dbgtransportproxy.h deleted file mode 100644 index 25f8a501b3..0000000000 --- a/src/debug/ee/dbgtransportproxy.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// - - -#ifndef __DBG_TRANSPORT_PROXY_INCLUDED -#define __DBG_TRANSPORT_PROXY_INCLUDED - -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - -#include "dbgproxy.h" - -// -// Provides access to the debugging proxy process from the left side. -// - -// The answers the proxy can give to us during runtime startup. -enum DbgProxyResult -{ - RequestSuccessful, // Successfully registered the runtime, no debugger is currently interested in us - RequestTimedOut, // Timed-out trying to reach the proxy (it's probably not configured or started) - PendingDebuggerAttach // Successfully registered the runtime, a debugger wishes to attach before code is run -}; - -class DbgTransportProxy -{ -public: - DbgTransportProxy(); - - // Startup and shutdown. Initialization takes the port number (in host byte order) that the left side - // will wait on for debugger connections. - HRESULT Init(unsigned short usPort); - void Shutdown(); - - // Talk with the proxy process and register this instantiation of the runtime with it. The reply from the - // proxy will indicate whether a debugger wishes to attach to us before any managed code is allowed to - // run. This method is synchronous and will wait for the reply from the proxy (or a timeout). - DbgProxyResult RegisterWithProxy(); - -private: - unsigned int m_uiPID; // PID of the current process - unsigned short m_usPort; // Port the LS waits on for debugger connections - unsigned short m_usProxyPort; // Port the proxy waits on for requests - - SecConnMgr *m_pConnectionManager; // Factory for network connections -}; - -#endif // FEATURE_DBGIPC_TRANSPORT_VM - -#endif // __DBG_TRANSPORT_PROXY_INCLUDED diff --git a/src/debug/ee/ddunpack.cpp b/src/debug/ee/ddunpack.cpp deleted file mode 100644 index 90b65c8a98..0000000000 --- a/src/debug/ee/ddunpack.cpp +++ /dev/null @@ -1,4578 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// - -// Unpacker -// -// Lives on EE side of the fence -// -// Note that this file is generated by ndp\clr\src\Debug\tools\BuildDDMarshal\. -// Changes should be made to output\DDUnpack_template.cpp in that directory. -// - - -#include "stdafx.h" - -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) -#include "dacdbiinterface.h" - -#include "ddshared.h" - -#include "ddmarshalutil.h" - -#include "ddunpack.h" - -#include "../shared/stringcopyholder.cpp" - -// Suppress PREFast warning about overly large function -// These functions are automatically generated. -#if defined(_PREFAST_) -#pragma warning(disable:21000) -#endif - -// general callback for Callback functions. -template <class T> -void GeneralEnumerationCallback(T vmAppDomain, void * pUserData) -{ - WriteBuffer * pResult = (WriteBuffer *) pUserData; - - DWORD dw = 1; // Continue - WriteToBuffer(pResult, dw); - WriteToBuffer(pResult, vmAppDomain); -} - - - - -// -// These stubs are called by the handler -// -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT CheckDbiVersion(const DbiVersion * pVersion) -void DDUnpack::Unpack_CheckDbiVersion(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - DbiVersion _pVersion; // storage - const DbiVersion * pVersion = &_pVersion; - ReadFromBuffer(pSend, &_pVersion); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->CheckDbiVersion(pVersion); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method CheckDbiVersion - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetLocalInterfaceHashAndTimestamp(DWORD & hash1, DWORD & hash2, DWORD & hash3, DWORD & hash4, DWORD & timestamp1, DWORD & timestamp2) -void DDUnpack::Unpack_GetLocalInterfaceHashAndTimestamp(ReadBuffer * pSend, WriteBuffer * pResult) -{ - // Callbacks not yet implemented - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetLocalInterfaceHashAndTimestamp - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetRemoteInterfaceHashAndTimestamp(DWORD & hash1, DWORD & hash2, DWORD & hash3, DWORD & hash4, DWORD & timestamp1, DWORD & timestamp2) -void DDUnpack::Unpack_GetRemoteInterfaceHashAndTimestamp(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - DWORD hash1; - // hash1 does not need to be copied on input - DWORD hash2; - // hash2 does not need to be copied on input - DWORD hash3; - // hash3 does not need to be copied on input - DWORD hash4; - // hash4 does not need to be copied on input - DWORD timestamp1; - // timestamp1 does not need to be copied on input - DWORD timestamp2; - // timestamp2 does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - hash1 = 0xe5ffdbe6; - hash2 = 0xf26b43be; - hash3 = 0x6c9685ac; - hash4 = 0xdd723940; - timestamp1 = 0x1cc67fb; - timestamp2 = 0xe3ad5a06; - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hash1); - WriteToBuffer(pResult, hash2); - WriteToBuffer(pResult, hash3); - WriteToBuffer(pResult, hash4); - WriteToBuffer(pResult, timestamp1); - WriteToBuffer(pResult, timestamp2); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetRemoteInterfaceHashAndTimestamp - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT FlushCache() -void DDUnpack::Unpack_FlushCache(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->FlushCache(); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method FlushCache - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void DacSetTargetConsistencyChecks(bool fEnableAsserts) -void DDUnpack::Unpack_DacSetTargetConsistencyChecks(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - bool fEnableAsserts; - ReadFromBuffer(pSend, fEnableAsserts); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->DacSetTargetConsistencyChecks(fEnableAsserts); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method DacSetTargetConsistencyChecks - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void Destroy() -void DDUnpack::Unpack_Destroy(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->Destroy(); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method Destroy - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsLeftSideInitialized() -void DDUnpack::Unpack_IsLeftSideInitialized(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsLeftSideInitialized(); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsLeftSideInitialized - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_AppDomain GetAppDomainFromId(ULONG appdomainId) -void DDUnpack::Unpack_GetAppDomainFromId(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - ULONG appdomainId; - ReadFromBuffer(pSend, appdomainId); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_AppDomain _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetAppDomainFromId(appdomainId); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAppDomainFromId - -//--------------------------------------------------------------------- -// Unpacking stub for: -// ULONG GetAppDomainId(VMPTR_AppDomain vmAppDomain) -void DDUnpack::Unpack_GetAppDomainId(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - ULONG _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetAppDomainId(vmAppDomain); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAppDomainId - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_OBJECTHANDLE GetAppDomainObject(VMPTR_AppDomain vmAppDomain) -void DDUnpack::Unpack_GetAppDomainObject(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_OBJECTHANDLE _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetAppDomainObject(vmAppDomain); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAppDomainObject - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsDefaultDomain(VMPTR_AppDomain vmAppDomain) -void DDUnpack::Unpack_IsDefaultDomain(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsDefaultDomain(vmAppDomain); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsDefaultDomain - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetAssemblyFromDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, VMPTR_Assembly * vmAssembly) -void DDUnpack::Unpack_GetAssemblyFromDomainAssembly(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainAssembly vmDomainAssembly; - ReadFromBuffer(pSend, vmDomainAssembly); - VMPTR_Assembly _vmAssembly; // storage - VMPTR_Assembly * vmAssembly = &_vmAssembly; - // vmAssembly does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetAssemblyFromDomainAssembly(vmDomainAssembly, vmAssembly); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, vmAssembly); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAssemblyFromDomainAssembly - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsAssemblyFullyTrusted(VMPTR_DomainAssembly vmDomainAssembly) -void DDUnpack::Unpack_IsAssemblyFullyTrusted(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainAssembly vmDomainAssembly; - ReadFromBuffer(pSend, vmDomainAssembly); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsAssemblyFullyTrusted(vmDomainAssembly); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsAssemblyFullyTrusted - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetAppDomainFullName(VMPTR_AppDomain vmAppDomain, IStringHolder * pStrName) -void DDUnpack::Unpack_GetAppDomainFullName(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - StringCopyHolder _pStrName; // storage - StringCopyHolder* pStrName = &_pStrName; - // pStrName does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetAppDomainFullName(vmAppDomain, pStrName); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pStrName); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAppDomainFullName - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetModuleSimpleName(VMPTR_Module vmModule, IStringHolder * pStrFilename) -void DDUnpack::Unpack_GetModuleSimpleName(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Module vmModule; - ReadFromBuffer(pSend, vmModule); - StringCopyHolder _pStrFilename; // storage - StringCopyHolder* pStrFilename = &_pStrFilename; - // pStrFilename does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetModuleSimpleName(vmModule, pStrFilename); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pStrFilename); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetModuleSimpleName - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL GetAssemblyPath(VMPTR_Assembly vmAssembly, IStringHolder * pStrFilename) -void DDUnpack::Unpack_GetAssemblyPath(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Assembly vmAssembly; - ReadFromBuffer(pSend, vmAssembly); - StringCopyHolder _pStrFilename; // storage - StringCopyHolder* pStrFilename = &_pStrFilename; - // pStrFilename does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetAssemblyPath(vmAssembly, pStrFilename); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pStrFilename); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAssemblyPath - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void ResolveTypeReference(const TypeRefData * pTypeRefInfo, TypeRefData * pTargetRefInfo) -void DDUnpack::Unpack_ResolveTypeReference(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - TypeRefData _pTypeRefInfo; // storage - const TypeRefData * pTypeRefInfo = &_pTypeRefInfo; - ReadFromBuffer(pSend, &_pTypeRefInfo); // serialize to storage - TypeRefData _pTargetRefInfo; // storage - TypeRefData * pTargetRefInfo = &_pTargetRefInfo; - ReadFromBuffer(pSend, &_pTargetRefInfo); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->ResolveTypeReference(pTypeRefInfo, pTargetRefInfo); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pTargetRefInfo); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method ResolveTypeReference - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL GetModulePath(VMPTR_Module vmModule, IStringHolder * pStrFilename) -void DDUnpack::Unpack_GetModulePath(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Module vmModule; - ReadFromBuffer(pSend, vmModule); - StringCopyHolder _pStrFilename; // storage - StringCopyHolder* pStrFilename = &_pStrFilename; - // pStrFilename does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetModulePath(vmModule, pStrFilename); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pStrFilename); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetModulePath - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL GetModuleNGenPath(VMPTR_Module vmModule, IStringHolder * pStrFilename) -void DDUnpack::Unpack_GetModuleNGenPath(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Module vmModule; - ReadFromBuffer(pSend, vmModule); - StringCopyHolder _pStrFilename; // storage - StringCopyHolder* pStrFilename = &_pStrFilename; - // pStrFilename does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetModuleNGenPath(vmModule, pStrFilename); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pStrFilename); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetModuleNGenPath - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetMetadata(VMPTR_Module vmModule, TargetBuffer * pTargetBuffer) -void DDUnpack::Unpack_GetMetadata(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Module vmModule; - ReadFromBuffer(pSend, vmModule); - TargetBuffer _pTargetBuffer; // storage - TargetBuffer * pTargetBuffer = &_pTargetBuffer; - // pTargetBuffer does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetMetadata(vmModule, pTargetBuffer); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pTargetBuffer); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetMetadata - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetSymbolsBuffer(VMPTR_Module vmModule, TargetBuffer * pTargetBuffer, IDacDbiInterface::SymbolFormat * pSymbolFormat) -void DDUnpack::Unpack_GetSymbolsBuffer(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Module vmModule; - ReadFromBuffer(pSend, vmModule); - TargetBuffer _pTargetBuffer; // storage - TargetBuffer * pTargetBuffer = &_pTargetBuffer; - // pTargetBuffer does not need to be copied on input - IDacDbiInterface::SymbolFormat _pSymbolFormat; // storage - IDacDbiInterface::SymbolFormat * pSymbolFormat = &_pSymbolFormat; - // pSymbolFormat does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetSymbolsBuffer(vmModule, pTargetBuffer, pSymbolFormat); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pTargetBuffer); - WriteToBuffer(pResult, pSymbolFormat); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetSymbolsBuffer - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetModuleData(VMPTR_Module vmModule, ModuleInfo * pData) -void DDUnpack::Unpack_GetModuleData(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Module vmModule; - ReadFromBuffer(pSend, vmModule); - ModuleInfo _pData; // storage - ModuleInfo * pData = &_pData; - // pData does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetModuleData(vmModule, pData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pData); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetModuleData - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetDomainFileData(VMPTR_DomainFile vmDomainFile, DomainFileInfo * pData) -void DDUnpack::Unpack_GetDomainFileData(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainFile vmDomainFile; - ReadFromBuffer(pSend, vmDomainFile); - DomainFileInfo _pData; // storage - DomainFileInfo * pData = &_pData; - // pData does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetDomainFileData(vmDomainFile, pData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pData); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetDomainFileData - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetModuleForDomainFile(VMPTR_DomainFile vmDomainFile, VMPTR_Module * pModule) -void DDUnpack::Unpack_GetModuleForDomainFile(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainFile vmDomainFile; - ReadFromBuffer(pSend, vmDomainFile); - VMPTR_Module _pModule; // storage - VMPTR_Module * pModule = &_pModule; - // pModule does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetModuleForDomainFile(vmDomainFile, pModule); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pModule); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetModuleForDomainFile - -//--------------------------------------------------------------------- -// Unpacking stub for: -// IDacDbiInterface::AddressType GetAddressType(CORDB_ADDRESS address) -void DDUnpack::Unpack_GetAddressType(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS address; - ReadFromBuffer(pSend, address); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - IDacDbiInterface::AddressType _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetAddressType(address); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAddressType - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsTransitionStub(CORDB_ADDRESS address) -void DDUnpack::Unpack_IsTransitionStub(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS address; - ReadFromBuffer(pSend, address); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsTransitionStub(address); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsTransitionStub - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetCompilerFlags(VMPTR_DomainFile vmDomainFile, BOOL * pfAllowJITOpts, BOOL * pfEnableEnC) -void DDUnpack::Unpack_GetCompilerFlags(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainFile vmDomainFile; - ReadFromBuffer(pSend, vmDomainFile); - BOOL _pfAllowJITOpts; // storage - BOOL * pfAllowJITOpts = &_pfAllowJITOpts; - // pfAllowJITOpts does not need to be copied on input - BOOL _pfEnableEnC; // storage - BOOL * pfEnableEnC = &_pfEnableEnC; - // pfEnableEnC does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetCompilerFlags(vmDomainFile, pfAllowJITOpts, pfEnableEnC); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pfAllowJITOpts); - WriteToBuffer(pResult, pfEnableEnC); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetCompilerFlags - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT SetCompilerFlags(VMPTR_DomainFile vmDomainFile, BOOL fAllowJitOpts, BOOL fEnableEnC) -void DDUnpack::Unpack_SetCompilerFlags(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainFile vmDomainFile; - ReadFromBuffer(pSend, vmDomainFile); - BOOL fAllowJitOpts; - ReadFromBuffer(pSend, fAllowJitOpts); - BOOL fEnableEnC; - ReadFromBuffer(pSend, fEnableEnC); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->SetCompilerFlags(vmDomainFile, fAllowJitOpts, fEnableEnC); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method SetCompilerFlags - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void EnumerateAppDomains(IDacDbiInterface::FP_APPDOMAIN_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) -void DDUnpack::Unpack_EnumerateAppDomains(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - // Extra stuff for callback handlers - m_pReal->EnumerateAppDomains(GeneralEnumerationCallback, pResult); - - } - EX_CATCH_HRESULT(hr); - - // Sentinel for callback list - DWORD dw = 2; // Stop - WriteToBuffer(pResult, dw); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnumerateAppDomains - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void EnumerateAssembliesInAppDomain(VMPTR_AppDomain vmAppDomain, IDacDbiInterface::FP_ASSEMBLY_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) -void DDUnpack::Unpack_EnumerateAssembliesInAppDomain(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - // Extra stuff for callback handlers - m_pReal->EnumerateAssembliesInAppDomain(vmAppDomain, GeneralEnumerationCallback, pResult); - - } - EX_CATCH_HRESULT(hr); - - // Sentinel for callback list - DWORD dw = 2; // Stop - WriteToBuffer(pResult, dw); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnumerateAssembliesInAppDomain - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void EnumerateModulesInAssembly(VMPTR_DomainAssembly vmAssembly, IDacDbiInterface::FP_MODULE_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) -void DDUnpack::Unpack_EnumerateModulesInAssembly(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainAssembly vmAssembly; - ReadFromBuffer(pSend, vmAssembly); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - // Extra stuff for callback handlers - m_pReal->EnumerateModulesInAssembly(vmAssembly, GeneralEnumerationCallback, pResult); - - } - EX_CATCH_HRESULT(hr); - - // Sentinel for callback list - DWORD dw = 2; // Stop - WriteToBuffer(pResult, dw); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnumerateModulesInAssembly - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void RequestSyncAtEvent() -void DDUnpack::Unpack_RequestSyncAtEvent(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->RequestSyncAtEvent(); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method RequestSyncAtEvent - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void MarkDebuggerAttachPending() -void DDUnpack::Unpack_MarkDebuggerAttachPending(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->MarkDebuggerAttachPending(); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method MarkDebuggerAttachPending - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void MarkDebuggerAttached(BOOL fAttached) -void DDUnpack::Unpack_MarkDebuggerAttached(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - BOOL fAttached; - ReadFromBuffer(pSend, fAttached); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->MarkDebuggerAttached(fAttached); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method MarkDebuggerAttached - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void Hijack(VMPTR_Thread vmThread, ULONG32 dwThreadId, const EXCEPTION_RECORD * pRecord, T_CONTEXT * pOriginalContext, ULONG32 cbSizeContext, EHijackReason::EHijackReason reason, void * pUserData, CORDB_ADDRESS * pRemoteContextAddr) -void DDUnpack::Unpack_Hijack(ReadBuffer * pSend, WriteBuffer * pResult) -{ - // Callbacks not yet implemented - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method Hijack - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void EnumerateConnections(IDacDbiInterface::FP_CONNECTION_CALLBACK fpCallback, CALLBACK_DATA pUserData) -void DDUnpack::Unpack_EnumerateConnections(ReadBuffer * pSend, WriteBuffer * pResult) -{ - // Callbacks not yet implemented - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnumerateConnections - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void EnumerateThreads(IDacDbiInterface::FP_THREAD_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) -void DDUnpack::Unpack_EnumerateThreads(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - // Extra stuff for callback handlers - m_pReal->EnumerateThreads(GeneralEnumerationCallback, pResult); - - } - EX_CATCH_HRESULT(hr); - - // Sentinel for callback list - DWORD dw = 2; // Stop - WriteToBuffer(pResult, dw); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnumerateThreads - -//--------------------------------------------------------------------- -// Unpacking stub for: -// bool IsThreadMarkedDead(VMPTR_Thread vmThread) -void DDUnpack::Unpack_IsThreadMarkedDead(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - bool _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsThreadMarkedDead(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsThreadMarkedDead - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HANDLE GetThreadHandle(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetThreadHandle(ReadBuffer * pSend, WriteBuffer * pResult) -{ - // Callbacks not yet implemented - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetThreadHandle - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_OBJECTHANDLE GetThreadObject(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetThreadObject(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_OBJECTHANDLE _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetThreadObject(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetThreadObject - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void SetDebugState(VMPTR_Thread vmThread, CorDebugThreadState debugState) -void DDUnpack::Unpack_SetDebugState(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - CorDebugThreadState debugState; - ReadFromBuffer(pSend, debugState); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->SetDebugState(vmThread, debugState); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method SetDebugState - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL HasUnhandledException(VMPTR_Thread vmThread) -void DDUnpack::Unpack_HasUnhandledException(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->HasUnhandledException(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method HasUnhandledException - -//--------------------------------------------------------------------- -// Unpacking stub for: -// CorDebugUserState GetUserState(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetUserState(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - CorDebugUserState _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetUserState(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetUserState - -//--------------------------------------------------------------------- -// Unpacking stub for: -// CONNID GetConnectionID(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetConnectionID(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - CONNID _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetConnectionID(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetConnectionID - -//--------------------------------------------------------------------- -// Unpacking stub for: -// TASKID GetTaskID(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetTaskID(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - TASKID _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetTaskID(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetTaskID - -//--------------------------------------------------------------------- -// Unpacking stub for: -// DWORD TryGetVolatileOSThreadID(VMPTR_Thread vmThread) -void DDUnpack::Unpack_TryGetVolatileOSThreadID(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - DWORD _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->TryGetVolatileOSThreadID(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method TryGetVolatileOSThreadID - -//--------------------------------------------------------------------- -// Unpacking stub for: -// DWORD GetUniqueThreadID(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetUniqueThreadID(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - DWORD _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetUniqueThreadID(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetUniqueThreadID - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_OBJECTHANDLE GetCurrentException(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetCurrentException(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_OBJECTHANDLE _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetCurrentException(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetCurrentException - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_OBJECTHANDLE GetCurrentCustomDebuggerNotification(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetCurrentCustomDebuggerNotification(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_OBJECTHANDLE _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetCurrentCustomDebuggerNotification(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetCurrentCustomDebuggerNotification - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_AppDomain GetCurrentAppDomain(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetCurrentAppDomain(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_AppDomain _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetCurrentAppDomain(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetCurrentAppDomain - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_DomainAssembly ResolveAssembly(VMPTR_DomainFile vmScope, mdToken tkAssemblyRef) -void DDUnpack::Unpack_ResolveAssembly(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainFile vmScope; - ReadFromBuffer(pSend, vmScope); - mdToken tkAssemblyRef; - ReadFromBuffer(pSend, tkAssemblyRef); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_DomainAssembly _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->ResolveAssembly(vmScope, tkAssemblyRef); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method ResolveAssembly - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetNativeCodeSequencePointsAndVarInfo(VMPTR_MethodDesc vmMethodDesc, CORDB_ADDRESS startAddress, BOOL fCodeAvailabe, NativeVarData * pNativeVarData, SequencePoints * pSequencePoints) -void DDUnpack::Unpack_GetNativeCodeSequencePointsAndVarInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_MethodDesc vmMethodDesc; - ReadFromBuffer(pSend, vmMethodDesc); - CORDB_ADDRESS startAddress; - ReadFromBuffer(pSend, startAddress); - BOOL fCodeAvailabe; - ReadFromBuffer(pSend, fCodeAvailabe); - NativeVarData _pNativeVarData; // storage - NativeVarData * pNativeVarData = &_pNativeVarData; - // pNativeVarData does not need to be copied on input - SequencePoints _pSequencePoints; // storage - SequencePoints * pSequencePoints = &_pSequencePoints; - // pSequencePoints does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetNativeCodeSequencePointsAndVarInfo(vmMethodDesc, startAddress, fCodeAvailabe, pNativeVarData, pSequencePoints); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pNativeVarData); - WriteToBuffer(pResult, pSequencePoints); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetNativeCodeSequencePointsAndVarInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_CONTEXT GetManagedStoppedContext(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetManagedStoppedContext(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_CONTEXT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetManagedStoppedContext(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetManagedStoppedContext - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void CreateStackWalk(VMPTR_Thread vmThread, DT_CONTEXT * pInternalContextBuffer, StackWalkHandle * ppSFIHandle) -void DDUnpack::Unpack_CreateStackWalk(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - DT_CONTEXT _pInternalContextBuffer; // storage - DT_CONTEXT * pInternalContextBuffer = &_pInternalContextBuffer; - ReadFromBuffer(pSend, &_pInternalContextBuffer); // serialize to storage - StackWalkHandle _ppSFIHandle; // storage - StackWalkHandle * ppSFIHandle = &_ppSFIHandle; - // ppSFIHandle does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->CreateStackWalk(vmThread, pInternalContextBuffer, ppSFIHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pInternalContextBuffer); - WriteToBuffer(pResult, ppSFIHandle); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method CreateStackWalk - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void DeleteStackWalk(StackWalkHandle ppSFIHandle) -void DDUnpack::Unpack_DeleteStackWalk(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - StackWalkHandle ppSFIHandle; - ReadFromBuffer(pSend, ppSFIHandle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->DeleteStackWalk(ppSFIHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method DeleteStackWalk - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetStackWalkCurrentContext(StackWalkHandle pSFIHandle, DT_CONTEXT * pContext) -void DDUnpack::Unpack_GetStackWalkCurrentContext(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - StackWalkHandle pSFIHandle; - ReadFromBuffer(pSend, pSFIHandle); - DT_CONTEXT _pContext; // storage - DT_CONTEXT * pContext = &_pContext; - ReadFromBuffer(pSend, &_pContext); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetStackWalkCurrentContext(pSFIHandle, pContext); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pContext); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetStackWalkCurrentContext - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void SetStackWalkCurrentContext(VMPTR_Thread vmThread, StackWalkHandle pSFIHandle, CorDebugSetContextFlag flag, DT_CONTEXT * pContext) -void DDUnpack::Unpack_SetStackWalkCurrentContext(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - StackWalkHandle pSFIHandle; - ReadFromBuffer(pSend, pSFIHandle); - CorDebugSetContextFlag flag; - ReadFromBuffer(pSend, flag); - DT_CONTEXT _pContext; // storage - DT_CONTEXT * pContext = &_pContext; - ReadFromBuffer(pSend, &_pContext); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->SetStackWalkCurrentContext(vmThread, pSFIHandle, flag, pContext); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pContext); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method SetStackWalkCurrentContext - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL UnwindStackWalkFrame(StackWalkHandle pSFIHandle) -void DDUnpack::Unpack_UnwindStackWalkFrame(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - StackWalkHandle pSFIHandle; - ReadFromBuffer(pSend, pSFIHandle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->UnwindStackWalkFrame(pSFIHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method UnwindStackWalkFrame - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT CheckContext(VMPTR_Thread vmThread, const DT_CONTEXT * pContext) -void DDUnpack::Unpack_CheckContext(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - DT_CONTEXT _pContext; // storage - const DT_CONTEXT * pContext = &_pContext; - ReadFromBuffer(pSend, &_pContext); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->CheckContext(vmThread, pContext); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method CheckContext - -//--------------------------------------------------------------------- -// Unpacking stub for: -// IDacDbiInterface::FrameType GetStackWalkCurrentFrameInfo(StackWalkHandle pSFIHandle, DebuggerIPCE_STRData * pFrameData) -void DDUnpack::Unpack_GetStackWalkCurrentFrameInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - StackWalkHandle pSFIHandle; - ReadFromBuffer(pSend, pSFIHandle); - DebuggerIPCE_STRData _pFrameData; // storage - DebuggerIPCE_STRData * pFrameData = &_pFrameData; - ReadFromBuffer(pSend, &_pFrameData); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - IDacDbiInterface::FrameType _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetStackWalkCurrentFrameInfo(pSFIHandle, pFrameData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pFrameData); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetStackWalkCurrentFrameInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// ULONG32 GetCountOfInternalFrames(VMPTR_Thread vmThread) -void DDUnpack::Unpack_GetCountOfInternalFrames(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - ULONG32 _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetCountOfInternalFrames(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetCountOfInternalFrames - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void EnumerateInternalFrames(VMPTR_Thread vmThread, IDacDbiInterface::FP_INTERNAL_FRAME_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) -void DDUnpack::Unpack_EnumerateInternalFrames(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - // Extra stuff for callback handlers - m_pReal->EnumerateInternalFrames(vmThread, GeneralEnumerationCallback, pResult); - - } - EX_CATCH_HRESULT(hr); - - // Sentinel for callback list - DWORD dw = 2; // Stop - WriteToBuffer(pResult, dw); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnumerateInternalFrames - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsMatchingParentFrame(FramePointer fpToCheck, FramePointer fpParent) -void DDUnpack::Unpack_IsMatchingParentFrame(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - FramePointer fpToCheck; - ReadFromBuffer(pSend, fpToCheck); - FramePointer fpParent; - ReadFromBuffer(pSend, fpParent); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsMatchingParentFrame(fpToCheck, fpParent); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsMatchingParentFrame - -//--------------------------------------------------------------------- -// Unpacking stub for: -// ULONG32 GetStackParameterSize(CORDB_ADDRESS controlPC) -void DDUnpack::Unpack_GetStackParameterSize(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS controlPC; - ReadFromBuffer(pSend, controlPC); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - ULONG32 _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetStackParameterSize(controlPC); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetStackParameterSize - -//--------------------------------------------------------------------- -// Unpacking stub for: -// FramePointer GetFramePointer(StackWalkHandle pSFIHandle) -void DDUnpack::Unpack_GetFramePointer(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - StackWalkHandle pSFIHandle; - ReadFromBuffer(pSend, pSFIHandle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - FramePointer _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetFramePointer(pSFIHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetFramePointer - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsLeafFrame(VMPTR_Thread vmThread, const DT_CONTEXT * pContext) -void DDUnpack::Unpack_IsLeafFrame(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - DT_CONTEXT _pContext; // storage - const DT_CONTEXT * pContext = &_pContext; - ReadFromBuffer(pSend, &_pContext); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsLeafFrame(vmThread, pContext); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsLeafFrame - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetContext(VMPTR_Thread vmThread, DT_CONTEXT * pContextBuffer) -void DDUnpack::Unpack_GetContext(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - DT_CONTEXT _pContextBuffer; // storage - DT_CONTEXT * pContextBuffer = &_pContextBuffer; - ReadFromBuffer(pSend, &_pContextBuffer); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetContext(vmThread, pContextBuffer); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pContextBuffer); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetContext - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void ConvertContextToDebuggerRegDisplay(const DT_CONTEXT * pInContext, DebuggerREGDISPLAY * pOutDRD, BOOL fActive) -void DDUnpack::Unpack_ConvertContextToDebuggerRegDisplay(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - DT_CONTEXT _pInContext; // storage - const DT_CONTEXT * pInContext = &_pInContext; - ReadFromBuffer(pSend, &_pInContext); // serialize to storage - DebuggerREGDISPLAY _pOutDRD; // storage - DebuggerREGDISPLAY * pOutDRD = &_pOutDRD; - ReadFromBuffer(pSend, &_pOutDRD); // serialize to storage - BOOL fActive; - ReadFromBuffer(pSend, fActive); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->ConvertContextToDebuggerRegDisplay(pInContext, pOutDRD, fActive); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pOutDRD); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method ConvertContextToDebuggerRegDisplay - -//--------------------------------------------------------------------- -// Unpacking stub for: -// IDacDbiInterface::DynamicMethodType IsILStubOrLCGMethod(VMPTR_MethodDesc vmMethodDesc) -void DDUnpack::Unpack_IsILStubOrLCGMethod(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_MethodDesc vmMethodDesc; - ReadFromBuffer(pSend, vmMethodDesc); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - IDacDbiInterface::DynamicMethodType _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsILStubOrLCGMethod(vmMethodDesc); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsILStubOrLCGMethod - -//--------------------------------------------------------------------- -// Unpacking stub for: -// TargetBuffer GetVarArgSig(CORDB_ADDRESS VASigCookieAddr, CORDB_ADDRESS * pArgBase) -void DDUnpack::Unpack_GetVarArgSig(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS VASigCookieAddr; - ReadFromBuffer(pSend, VASigCookieAddr); - CORDB_ADDRESS _pArgBase; // storage - CORDB_ADDRESS * pArgBase = &_pArgBase; - // pArgBase does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - TargetBuffer _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetVarArgSig(VASigCookieAddr, pArgBase); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pArgBase); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetVarArgSig - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL RequiresAlign8(VMPTR_TypeHandle thExact) -void DDUnpack::Unpack_RequiresAlign8(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_TypeHandle thExact; - ReadFromBuffer(pSend, thExact); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->RequiresAlign8(thExact); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method RequiresAlign8 - -//--------------------------------------------------------------------- -// Unpacking stub for: -// GENERICS_TYPE_TOKEN ResolveExactGenericArgsToken(DWORD dwExactGenericArgsTokenIndex, GENERICS_TYPE_TOKEN rawToken) -void DDUnpack::Unpack_ResolveExactGenericArgsToken(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - DWORD dwExactGenericArgsTokenIndex; - ReadFromBuffer(pSend, dwExactGenericArgsTokenIndex); - GENERICS_TYPE_TOKEN rawToken; - ReadFromBuffer(pSend, rawToken); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - GENERICS_TYPE_TOKEN _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->ResolveExactGenericArgsToken(dwExactGenericArgsTokenIndex, rawToken); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method ResolveExactGenericArgsToken - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetILCodeAndSig(VMPTR_DomainFile vmDomainFile, mdToken functionToken, TargetBuffer * pCodeInfo, mdToken * pLocalSigToken) -void DDUnpack::Unpack_GetILCodeAndSig(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainFile vmDomainFile; - ReadFromBuffer(pSend, vmDomainFile); - mdToken functionToken; - ReadFromBuffer(pSend, functionToken); - TargetBuffer _pCodeInfo; // storage - TargetBuffer * pCodeInfo = &_pCodeInfo; - // pCodeInfo does not need to be copied on input - mdToken _pLocalSigToken; // storage - mdToken * pLocalSigToken = &_pLocalSigToken; - // pLocalSigToken does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetILCodeAndSig(vmDomainFile, functionToken, pCodeInfo, pLocalSigToken); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pCodeInfo); - WriteToBuffer(pResult, pLocalSigToken); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetILCodeAndSig - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetNativeCodeInfo(VMPTR_DomainFile vmDomainFile, mdToken functionToken, NativeCodeFunctionData * pCodeInfo) -void DDUnpack::Unpack_GetNativeCodeInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainFile vmDomainFile; - ReadFromBuffer(pSend, vmDomainFile); - mdToken functionToken; - ReadFromBuffer(pSend, functionToken); - NativeCodeFunctionData _pCodeInfo; // storage - NativeCodeFunctionData * pCodeInfo = &_pCodeInfo; - // pCodeInfo does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetNativeCodeInfo(vmDomainFile, functionToken, pCodeInfo); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pCodeInfo); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetNativeCodeInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetNativeCodeInfoForAddr(VMPTR_MethodDesc vmMethodDesc, CORDB_ADDRESS hotCodeStartAddr, NativeCodeFunctionData * pCodeInfo) -void DDUnpack::Unpack_GetNativeCodeInfoForAddr(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_MethodDesc vmMethodDesc; - ReadFromBuffer(pSend, vmMethodDesc); - CORDB_ADDRESS hotCodeStartAddr; - ReadFromBuffer(pSend, hotCodeStartAddr); - NativeCodeFunctionData _pCodeInfo; // storage - NativeCodeFunctionData * pCodeInfo = &_pCodeInfo; - ReadFromBuffer(pSend, &_pCodeInfo); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetNativeCodeInfoForAddr(vmMethodDesc, hotCodeStartAddr, pCodeInfo); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pCodeInfo); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetNativeCodeInfoForAddr - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetClassInfo(VMPTR_AppDomain vmAppDomain, VMPTR_Module vmModule, mdTypeDef metadataToken, VMPTR_TypeHandle thExact, VMPTR_TypeHandle thApprox, ClassInfo * pData) -void DDUnpack::Unpack_GetClassInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - VMPTR_Module vmModule; - ReadFromBuffer(pSend, vmModule); - mdTypeDef metadataToken; - ReadFromBuffer(pSend, metadataToken); - VMPTR_TypeHandle thExact; - ReadFromBuffer(pSend, thExact); - VMPTR_TypeHandle thApprox; - ReadFromBuffer(pSend, thApprox); - ClassInfo _pData; // storage - ClassInfo * pData = &_pData; - ReadFromBuffer(pSend, &_pData); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetClassInfo(vmAppDomain, vmModule, metadataToken, thExact, thApprox, pData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pData); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetClassInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetInstantiationFieldInfo(VMPTR_DomainFile vmDomainFile, mdTypeDef metadataToken, VMPTR_TypeHandle vmThExact, VMPTR_TypeHandle vmThApprox, DacDbiArrayList<FieldData> * pFieldList, SIZE_T * pObjectSize) -void DDUnpack::Unpack_GetInstantiationFieldInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_DomainFile vmDomainFile; - ReadFromBuffer(pSend, vmDomainFile); - mdTypeDef metadataToken; - ReadFromBuffer(pSend, metadataToken); - VMPTR_TypeHandle vmThExact; - ReadFromBuffer(pSend, vmThExact); - VMPTR_TypeHandle vmThApprox; - ReadFromBuffer(pSend, vmThApprox); - DacDbiArrayList<FieldData> _pFieldList; // storage - DacDbiArrayList<FieldData> * pFieldList = &_pFieldList; - // pFieldList does not need to be copied on input - SIZE_T _pObjectSize; // storage - SIZE_T * pObjectSize = &_pObjectSize; - // pObjectSize does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetInstantiationFieldInfo(vmDomainFile, metadataToken, vmThExact, vmThApprox, pFieldList, pObjectSize); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pFieldList); - WriteToBuffer(pResult, pObjectSize); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetInstantiationFieldInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void TypeHandleToExpandedTypeInfo(AreValueTypesBoxed boxed, VMPTR_AppDomain vmAppDomain, VMPTR_TypeHandle vmTypeHandle, DebuggerIPCE_ExpandedTypeData * pTypeInfo) -void DDUnpack::Unpack_TypeHandleToExpandedTypeInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - AreValueTypesBoxed boxed; - ReadFromBuffer(pSend, boxed); - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - VMPTR_TypeHandle vmTypeHandle; - ReadFromBuffer(pSend, vmTypeHandle); - DebuggerIPCE_ExpandedTypeData _pTypeInfo; // storage - DebuggerIPCE_ExpandedTypeData * pTypeInfo = &_pTypeInfo; - ReadFromBuffer(pSend, &_pTypeInfo); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->TypeHandleToExpandedTypeInfo(boxed, vmAppDomain, vmTypeHandle, pTypeInfo); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pTypeInfo); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method TypeHandleToExpandedTypeInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetObjectExpandedTypeInfo(AreValueTypesBoxed boxed, VMPTR_AppDomain vmAppDomain, CORDB_ADDRESS addr, DebuggerIPCE_ExpandedTypeData * pTypeInfo) -void DDUnpack::Unpack_GetObjectExpandedTypeInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - AreValueTypesBoxed boxed; - ReadFromBuffer(pSend, boxed); - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - CORDB_ADDRESS addr; - ReadFromBuffer(pSend, addr); - DebuggerIPCE_ExpandedTypeData _pTypeInfo; // storage - DebuggerIPCE_ExpandedTypeData * pTypeInfo = &_pTypeInfo; - // pTypeInfo does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetObjectExpandedTypeInfo(boxed, vmAppDomain, addr, pTypeInfo); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pTypeInfo); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetObjectExpandedTypeInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetObjectExpandedTypeInfoFromID(AreValueTypesBoxed boxed, VMPTR_AppDomain vmAppDomain, COR_TYPEID id, DebuggerIPCE_ExpandedTypeData * pTypeInfo) -void DDUnpack::Unpack_GetObjectExpandedTypeInfoFromID(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - AreValueTypesBoxed boxed; - ReadFromBuffer(pSend, boxed); - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - COR_TYPEID id; - ReadFromBuffer(pSend, id); - DebuggerIPCE_ExpandedTypeData _pTypeInfo; // storage - DebuggerIPCE_ExpandedTypeData * pTypeInfo = &_pTypeInfo; - // pTypeInfo does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetObjectExpandedTypeInfoFromID(boxed, vmAppDomain, id, pTypeInfo); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pTypeInfo); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetObjectExpandedTypeInfoFromID - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_TypeHandle GetApproxTypeHandle(TypeInfoList * pTypeData) -void DDUnpack::Unpack_GetApproxTypeHandle(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - TypeInfoList _pTypeData; // storage - TypeInfoList * pTypeData = &_pTypeData; - ReadFromBuffer(pSend, &_pTypeData); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_TypeHandle _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetApproxTypeHandle(pTypeData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pTypeData); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetApproxTypeHandle - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT GetExactTypeHandle(DebuggerIPCE_ExpandedTypeData * pTypeData, ArgInfoList * pArgInfo, VMPTR_TypeHandle & vmTypeHandle) -void DDUnpack::Unpack_GetExactTypeHandle(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - DebuggerIPCE_ExpandedTypeData _pTypeData; // storage - DebuggerIPCE_ExpandedTypeData * pTypeData = &_pTypeData; - ReadFromBuffer(pSend, &_pTypeData); // serialize to storage - ArgInfoList _pArgInfo; // storage - ArgInfoList * pArgInfo = &_pArgInfo; - ReadFromBuffer(pSend, &_pArgInfo); // serialize to storage - VMPTR_TypeHandle vmTypeHandle; - ReadFromBuffer(pSend, vmTypeHandle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetExactTypeHandle(pTypeData, pArgInfo, vmTypeHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pTypeData); - WriteToBuffer(pResult, pArgInfo); - WriteToBuffer(pResult, vmTypeHandle); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetExactTypeHandle - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetMethodDescParams(VMPTR_AppDomain vmAppDomain, VMPTR_MethodDesc vmMethodDesc, GENERICS_TYPE_TOKEN genericsToken, UINT32 * pcGenericClassTypeParams, TypeParamsList * pGenericTypeParams) -void DDUnpack::Unpack_GetMethodDescParams(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - VMPTR_MethodDesc vmMethodDesc; - ReadFromBuffer(pSend, vmMethodDesc); - GENERICS_TYPE_TOKEN genericsToken; - ReadFromBuffer(pSend, genericsToken); - UINT32 _pcGenericClassTypeParams; // storage - UINT32 * pcGenericClassTypeParams = &_pcGenericClassTypeParams; - // pcGenericClassTypeParams does not need to be copied on input - TypeParamsList _pGenericTypeParams; // storage - TypeParamsList * pGenericTypeParams = &_pGenericTypeParams; - // pGenericTypeParams does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetMethodDescParams(vmAppDomain, vmMethodDesc, genericsToken, pcGenericClassTypeParams, pGenericTypeParams); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pcGenericClassTypeParams); - WriteToBuffer(pResult, pGenericTypeParams); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetMethodDescParams - -//--------------------------------------------------------------------- -// Unpacking stub for: -// CORDB_ADDRESS GetThreadOrContextStaticAddress(VMPTR_FieldDesc vmField, VMPTR_Thread vmRuntimeThread) -void DDUnpack::Unpack_GetThreadOrContextStaticAddress(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_FieldDesc vmField; - ReadFromBuffer(pSend, vmField); - VMPTR_Thread vmRuntimeThread; - ReadFromBuffer(pSend, vmRuntimeThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - CORDB_ADDRESS _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetThreadOrContextStaticAddress(vmField, vmRuntimeThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetThreadOrContextStaticAddress - -//--------------------------------------------------------------------- -// Unpacking stub for: -// CORDB_ADDRESS GetCollectibleTypeStaticAddress(VMPTR_FieldDesc vmField, VMPTR_AppDomain vmAppDomain) -void DDUnpack::Unpack_GetCollectibleTypeStaticAddress(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_FieldDesc vmField; - ReadFromBuffer(pSend, vmField); - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - CORDB_ADDRESS _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetCollectibleTypeStaticAddress(vmField, vmAppDomain); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetCollectibleTypeStaticAddress - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetEnCHangingFieldInfo(const EnCHangingFieldInfo * pEnCFieldInfo, FieldData * pFieldData, BOOL * pfStatic) -void DDUnpack::Unpack_GetEnCHangingFieldInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - EnCHangingFieldInfo _pEnCFieldInfo; // storage - const EnCHangingFieldInfo * pEnCFieldInfo = &_pEnCFieldInfo; - ReadFromBuffer(pSend, &_pEnCFieldInfo); // serialize to storage - FieldData _pFieldData; // storage - FieldData * pFieldData = &_pFieldData; - // pFieldData does not need to be copied on input - BOOL _pfStatic; // storage - BOOL * pfStatic = &_pfStatic; - // pfStatic does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetEnCHangingFieldInfo(pEnCFieldInfo, pFieldData, pfStatic); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pFieldData); - WriteToBuffer(pResult, pfStatic); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetEnCHangingFieldInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetTypeHandleParams(VMPTR_AppDomain vmAppDomain, VMPTR_TypeHandle vmTypeHandle, TypeParamsList * pParams) -void DDUnpack::Unpack_GetTypeHandleParams(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - VMPTR_TypeHandle vmTypeHandle; - ReadFromBuffer(pSend, vmTypeHandle); - TypeParamsList _pParams; // storage - TypeParamsList * pParams = &_pParams; - // pParams does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetTypeHandleParams(vmAppDomain, vmTypeHandle, pParams); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pParams); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetTypeHandleParams - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetSimpleType(VMPTR_AppDomain vmAppDomain, CorElementType simpleType, mdTypeDef * pMetadataToken, VMPTR_Module * pVmModule, VMPTR_DomainFile * pVmDomainFile) -void DDUnpack::Unpack_GetSimpleType(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - CorElementType simpleType; - ReadFromBuffer(pSend, simpleType); - mdTypeDef _pMetadataToken; // storage - mdTypeDef * pMetadataToken = &_pMetadataToken; - // pMetadataToken does not need to be copied on input - VMPTR_Module _pVmModule; // storage - VMPTR_Module * pVmModule = &_pVmModule; - // pVmModule does not need to be copied on input - VMPTR_DomainFile _pVmDomainFile; // storage - VMPTR_DomainFile * pVmDomainFile = &_pVmDomainFile; - // pVmDomainFile does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetSimpleType(vmAppDomain, simpleType, pMetadataToken, pVmModule, pVmDomainFile); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pMetadataToken); - WriteToBuffer(pResult, pVmModule); - WriteToBuffer(pResult, pVmDomainFile); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetSimpleType - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsExceptionObject(VMPTR_Object vmObject) -void DDUnpack::Unpack_IsExceptionObject(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Object vmObject; - ReadFromBuffer(pSend, vmObject); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsExceptionObject(vmObject); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsExceptionObject - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList<DacExceptionCallStackData> & dacStackFrames) -void DDUnpack::Unpack_GetStackFramesFromException(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Object vmObject; - ReadFromBuffer(pSend, vmObject); - DacDbiArrayList<DacExceptionCallStackData> dacStackFrames; - ReadFromBuffer(pSend, dacStackFrames); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetStackFramesFromException(vmObject, dacStackFrames); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, dacStackFrames); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetStackFramesFromException - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsRcw(VMPTR_Object vmObject) -void DDUnpack::Unpack_IsRcw(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Object vmObject; - ReadFromBuffer(pSend, vmObject); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsRcw(vmObject); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsRcw - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetRcwCachedInterfaceTypes(VMPTR_Object vmObject, VMPTR_AppDomain vmAppDomain, BOOL bIInspectableOnly, DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pDacInterfaces) -void DDUnpack::Unpack_GetRcwCachedInterfaceTypes(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Object vmObject; - ReadFromBuffer(pSend, vmObject); - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - BOOL bIInspectableOnly; - ReadFromBuffer(pSend, bIInspectableOnly); - DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> _pDacInterfaces; // storage - DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pDacInterfaces = &_pDacInterfaces; - // pDacInterfaces does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetRcwCachedInterfaceTypes(vmObject, vmAppDomain, bIInspectableOnly, pDacInterfaces); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pDacInterfaces); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetRcwCachedInterfaceTypes - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetRcwCachedInterfacePointers(VMPTR_Object vmObject, BOOL bIInspectableOnly, DacDbiArrayList<CORDB_ADDRESS> * pDacItfPtrs) -void DDUnpack::Unpack_GetRcwCachedInterfacePointers(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Object vmObject; - ReadFromBuffer(pSend, vmObject); - BOOL bIInspectableOnly; - ReadFromBuffer(pSend, bIInspectableOnly); - DacDbiArrayList<CORDB_ADDRESS> _pDacItfPtrs; // storage - DacDbiArrayList<CORDB_ADDRESS> * pDacItfPtrs = &_pDacItfPtrs; - // pDacItfPtrs does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetRcwCachedInterfacePointers(vmObject, bIInspectableOnly, pDacItfPtrs); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pDacItfPtrs); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetRcwCachedInterfacePointers - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList<GUID> & iids, DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pTypes) -void DDUnpack::Unpack_GetCachedWinRTTypesForIIDs(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - DacDbiArrayList<GUID> iids; - ReadFromBuffer(pSend, iids); - DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> _pTypes; // storage - DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pTypes = &_pTypes; - // pTypes does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetCachedWinRTTypesForIIDs(vmAppDomain, iids, pTypes); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, iids); - WriteToBuffer(pResult, pTypes); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetCachedWinRTTypesForIIDs - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetCachedWinRTTypes(VMPTR_AppDomain vmAppDomain, DacDbiArrayList<GUID> * piids, DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pTypes) -void DDUnpack::Unpack_GetCachedWinRTTypes(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - DacDbiArrayList<GUID> _piids; // storage - DacDbiArrayList<GUID> * piids = &_piids; - // piids does not need to be copied on input - DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> _pTypes; // storage - DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pTypes = &_pTypes; - // pTypes does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetCachedWinRTTypes(vmAppDomain, piids, pTypes); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, piids); - WriteToBuffer(pResult, pTypes); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetCachedWinRTTypes - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetTypedByRefInfo(CORDB_ADDRESS pTypedByRef, VMPTR_AppDomain vmAppDomain, DebuggerIPCE_ObjectData * pObjectData) -void DDUnpack::Unpack_GetTypedByRefInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS pTypedByRef; - ReadFromBuffer(pSend, pTypedByRef); - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - DebuggerIPCE_ObjectData _pObjectData; // storage - DebuggerIPCE_ObjectData * pObjectData = &_pObjectData; - ReadFromBuffer(pSend, &_pObjectData); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetTypedByRefInfo(pTypedByRef, vmAppDomain, pObjectData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pObjectData); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetTypedByRefInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetStringData(CORDB_ADDRESS objectAddress, DebuggerIPCE_ObjectData * pObjectData) -void DDUnpack::Unpack_GetStringData(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS objectAddress; - ReadFromBuffer(pSend, objectAddress); - DebuggerIPCE_ObjectData _pObjectData; // storage - DebuggerIPCE_ObjectData * pObjectData = &_pObjectData; - ReadFromBuffer(pSend, &_pObjectData); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetStringData(objectAddress, pObjectData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pObjectData); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetStringData - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetArrayData(CORDB_ADDRESS objectAddress, DebuggerIPCE_ObjectData * pObjectData) -void DDUnpack::Unpack_GetArrayData(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS objectAddress; - ReadFromBuffer(pSend, objectAddress); - DebuggerIPCE_ObjectData _pObjectData; // storage - DebuggerIPCE_ObjectData * pObjectData = &_pObjectData; - ReadFromBuffer(pSend, &_pObjectData); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetArrayData(objectAddress, pObjectData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pObjectData); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetArrayData - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetBasicObjectInfo(CORDB_ADDRESS objectAddress, CorElementType type, VMPTR_AppDomain vmAppDomain, DebuggerIPCE_ObjectData * pObjectData) -void DDUnpack::Unpack_GetBasicObjectInfo(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS objectAddress; - ReadFromBuffer(pSend, objectAddress); - CorElementType type; - ReadFromBuffer(pSend, type); - VMPTR_AppDomain vmAppDomain; - ReadFromBuffer(pSend, vmAppDomain); - DebuggerIPCE_ObjectData _pObjectData; // storage - DebuggerIPCE_ObjectData * pObjectData = &_pObjectData; - ReadFromBuffer(pSend, &_pObjectData); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetBasicObjectInfo(objectAddress, type, vmAppDomain, pObjectData); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pObjectData); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetBasicObjectInfo - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void TestCrst(VMPTR_Crst vmCrst) -void DDUnpack::Unpack_TestCrst(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Crst vmCrst; - ReadFromBuffer(pSend, vmCrst); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->TestCrst(vmCrst); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method TestCrst - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void TestRWLock(VMPTR_SimpleRWLock vmRWLock) -void DDUnpack::Unpack_TestRWLock(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_SimpleRWLock vmRWLock; - ReadFromBuffer(pSend, vmRWLock); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->TestRWLock(vmRWLock); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method TestRWLock - -//--------------------------------------------------------------------- -// Unpacking stub for: -// CORDB_ADDRESS GetDebuggerControlBlockAddress() -void DDUnpack::Unpack_GetDebuggerControlBlockAddress(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - CORDB_ADDRESS _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetDebuggerControlBlockAddress(); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetDebuggerControlBlockAddress - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_Object GetObjectFromRefPtr(CORDB_ADDRESS ptr) -void DDUnpack::Unpack_GetObjectFromRefPtr(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS ptr; - ReadFromBuffer(pSend, ptr); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_Object _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetObjectFromRefPtr(ptr); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetObjectFromRefPtr - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_Object GetObject(CORDB_ADDRESS ptr) -void DDUnpack::Unpack_GetObject(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS ptr; - ReadFromBuffer(pSend, ptr); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_Object _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetObject(ptr); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetObject - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT EnableNGENPolicy(CorDebugNGENPolicy ePolicy) -void DDUnpack::Unpack_EnableNGENPolicy(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CorDebugNGENPolicy ePolicy; - ReadFromBuffer(pSend, ePolicy); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->EnableNGENPolicy(ePolicy); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnableNGENPolicy - -//--------------------------------------------------------------------- -// Unpacking stub for: -// VMPTR_OBJECTHANDLE GetVmObjectHandle(CORDB_ADDRESS handleAddress) -void DDUnpack::Unpack_GetVmObjectHandle(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS handleAddress; - ReadFromBuffer(pSend, handleAddress); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - VMPTR_OBJECTHANDLE _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetVmObjectHandle(handleAddress); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetVmObjectHandle - -//--------------------------------------------------------------------- -// Unpacking stub for: -// BOOL IsVmObjectHandleValid(VMPTR_OBJECTHANDLE vmHandle) -void DDUnpack::Unpack_IsVmObjectHandleValid(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_OBJECTHANDLE vmHandle; - ReadFromBuffer(pSend, vmHandle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - BOOL _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsVmObjectHandleValid(vmHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsVmObjectHandleValid - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT IsWinRTModule(VMPTR_Module vmModule, BOOL & isWinRT) -void DDUnpack::Unpack_IsWinRTModule(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Module vmModule; - ReadFromBuffer(pSend, vmModule); - BOOL isWinRT; - ReadFromBuffer(pSend, isWinRT); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsWinRTModule(vmModule, isWinRT); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, isWinRT); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsWinRTModule - -//--------------------------------------------------------------------- -// Unpacking stub for: -// ULONG GetAppDomainIdFromVmObjectHandle(VMPTR_OBJECTHANDLE vmHandle) -void DDUnpack::Unpack_GetAppDomainIdFromVmObjectHandle(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_OBJECTHANDLE vmHandle; - ReadFromBuffer(pSend, vmHandle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - ULONG _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetAppDomainIdFromVmObjectHandle(vmHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAppDomainIdFromVmObjectHandle - -//--------------------------------------------------------------------- -// Unpacking stub for: -// CORDB_ADDRESS GetHandleAddressFromVmHandle(VMPTR_OBJECTHANDLE vmHandle) -void DDUnpack::Unpack_GetHandleAddressFromVmHandle(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_OBJECTHANDLE vmHandle; - ReadFromBuffer(pSend, vmHandle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - CORDB_ADDRESS _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetHandleAddressFromVmHandle(vmHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetHandleAddressFromVmHandle - -//--------------------------------------------------------------------- -// Unpacking stub for: -// TargetBuffer GetObjectContents(VMPTR_Object obj) -void DDUnpack::Unpack_GetObjectContents(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Object obj; - ReadFromBuffer(pSend, obj); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - TargetBuffer _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetObjectContents(obj); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetObjectContents - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void EnumerateBlockingObjects(VMPTR_Thread vmThread, IDacDbiInterface::FP_BLOCKINGOBJECT_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) -void DDUnpack::Unpack_EnumerateBlockingObjects(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - // Extra stuff for callback handlers - m_pReal->EnumerateBlockingObjects(vmThread, GeneralEnumerationCallback, pResult); - - } - EX_CATCH_HRESULT(hr); - - // Sentinel for callback list - DWORD dw = 2; // Stop - WriteToBuffer(pResult, dw); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnumerateBlockingObjects - -//--------------------------------------------------------------------- -// Unpacking stub for: -// MonitorLockInfo GetThreadOwningMonitorLock(VMPTR_Object vmObject) -void DDUnpack::Unpack_GetThreadOwningMonitorLock(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Object vmObject; - ReadFromBuffer(pSend, vmObject); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - MonitorLockInfo _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetThreadOwningMonitorLock(vmObject); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetThreadOwningMonitorLock - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void EnumerateMonitorEventWaitList(VMPTR_Object vmObject, IDacDbiInterface::FP_THREAD_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) -void DDUnpack::Unpack_EnumerateMonitorEventWaitList(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Object vmObject; - ReadFromBuffer(pSend, vmObject); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - // Extra stuff for callback handlers - m_pReal->EnumerateMonitorEventWaitList(vmObject, GeneralEnumerationCallback, pResult); - - } - EX_CATCH_HRESULT(hr); - - // Sentinel for callback list - DWORD dw = 2; // Stop - WriteToBuffer(pResult, dw); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method EnumerateMonitorEventWaitList - -//--------------------------------------------------------------------- -// Unpacking stub for: -// CLR_DEBUGGING_PROCESS_FLAGS GetAttachStateFlags() -void DDUnpack::Unpack_GetAttachStateFlags(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - CLR_DEBUGGING_PROCESS_FLAGS _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetAttachStateFlags(); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAttachStateFlags - -//--------------------------------------------------------------------- -// Unpacking stub for: -// bool GetMetaDataFileInfoFromPEFile(VMPTR_PEFile vmPEFile, DWORD & dwTimeStamp, DWORD & dwImageSize, bool & isNGEN, IStringHolder * pStrFilename) -void DDUnpack::Unpack_GetMetaDataFileInfoFromPEFile(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_PEFile vmPEFile; - ReadFromBuffer(pSend, vmPEFile); - DWORD dwTimeStamp; - ReadFromBuffer(pSend, dwTimeStamp); - DWORD dwImageSize; - ReadFromBuffer(pSend, dwImageSize); - bool isNGEN; - ReadFromBuffer(pSend, isNGEN); - StringCopyHolder _pStrFilename; // storage - StringCopyHolder* pStrFilename = &_pStrFilename; - // pStrFilename does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - bool _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetMetaDataFileInfoFromPEFile(vmPEFile, dwTimeStamp, dwImageSize, isNGEN, pStrFilename); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, dwTimeStamp); - WriteToBuffer(pResult, dwImageSize); - WriteToBuffer(pResult, isNGEN); - WriteToBuffer(pResult, pStrFilename); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetMetaDataFileInfoFromPEFile - -//--------------------------------------------------------------------- -// Unpacking stub for: -// bool GetILImageInfoFromNgenPEFile(VMPTR_PEFile vmPEFile, DWORD & dwTimeStamp, DWORD & dwSize, IStringHolder * pStrFilename) -void DDUnpack::Unpack_GetILImageInfoFromNgenPEFile(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_PEFile vmPEFile; - ReadFromBuffer(pSend, vmPEFile); - DWORD dwTimeStamp; - ReadFromBuffer(pSend, dwTimeStamp); - DWORD dwSize; - ReadFromBuffer(pSend, dwSize); - StringCopyHolder _pStrFilename; // storage - StringCopyHolder* pStrFilename = &_pStrFilename; - // pStrFilename does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - bool _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetILImageInfoFromNgenPEFile(vmPEFile, dwTimeStamp, dwSize, pStrFilename); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, dwTimeStamp); - WriteToBuffer(pResult, dwSize); - WriteToBuffer(pResult, pStrFilename); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetILImageInfoFromNgenPEFile - -//--------------------------------------------------------------------- -// Unpacking stub for: -// bool IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread) -void DDUnpack::Unpack_IsThreadSuspendedOrHijacked(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - VMPTR_Thread vmThread; - ReadFromBuffer(pSend, vmThread); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - bool _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsThreadSuspendedOrHijacked(vmThread); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsThreadSuspendedOrHijacked - -//--------------------------------------------------------------------- -// Unpacking stub for: -// bool AreGCStructuresValid() -void DDUnpack::Unpack_AreGCStructuresValid(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - bool _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->AreGCStructuresValid(); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method AreGCStructuresValid - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT CreateHeapWalk(HeapWalkHandle * pHandle) -void DDUnpack::Unpack_CreateHeapWalk(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - HeapWalkHandle _pHandle; // storage - HeapWalkHandle * pHandle = &_pHandle; - // pHandle does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->CreateHeapWalk(pHandle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pHandle); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method CreateHeapWalk - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void DeleteHeapWalk(HeapWalkHandle handle) -void DDUnpack::Unpack_DeleteHeapWalk(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - HeapWalkHandle handle; - ReadFromBuffer(pSend, handle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->DeleteHeapWalk(handle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method DeleteHeapWalk - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT WalkHeap(HeapWalkHandle handle, ULONG count, COR_HEAPOBJECT * objects, ULONG * pFetched) -void DDUnpack::Unpack_WalkHeap(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - HeapWalkHandle handle; - ReadFromBuffer(pSend, handle); - ULONG count; - ReadFromBuffer(pSend, count); - COR_HEAPOBJECT _objects; // storage - COR_HEAPOBJECT * objects = &_objects; - // objects does not need to be copied on input - ULONG _pFetched; // storage - ULONG * pFetched = &_pFetched; - // pFetched does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->WalkHeap(handle, count, objects, pFetched); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, objects); - WriteToBuffer(pResult, pFetched); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method WalkHeap - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT GetHeapSegments(DacDbiArrayList<COR_SEGMENT> * pSegments) -void DDUnpack::Unpack_GetHeapSegments(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - DacDbiArrayList<COR_SEGMENT> _pSegments; // storage - DacDbiArrayList<COR_SEGMENT> * pSegments = &_pSegments; - // pSegments does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetHeapSegments(pSegments); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pSegments); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetHeapSegments - -//--------------------------------------------------------------------- -// Unpacking stub for: -// bool IsValidObject(CORDB_ADDRESS obj) -void DDUnpack::Unpack_IsValidObject(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS obj; - ReadFromBuffer(pSend, obj); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - bool _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->IsValidObject(obj); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method IsValidObject - -//--------------------------------------------------------------------- -// Unpacking stub for: -// bool GetAppDomainForObject(CORDB_ADDRESS obj, VMPTR_AppDomain * pApp, VMPTR_Module * pModule, VMPTR_DomainFile * pDomainFile) -void DDUnpack::Unpack_GetAppDomainForObject(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS obj; - ReadFromBuffer(pSend, obj); - VMPTR_AppDomain _pApp; // storage - VMPTR_AppDomain * pApp = &_pApp; - // pApp does not need to be copied on input - VMPTR_Module _pModule; // storage - VMPTR_Module * pModule = &_pModule; - // pModule does not need to be copied on input - VMPTR_DomainFile _pDomainFile; // storage - VMPTR_DomainFile * pDomainFile = &_pDomainFile; - // pDomainFile does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - bool _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetAppDomainForObject(obj, pApp, pModule, pDomainFile); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pApp); - WriteToBuffer(pResult, pModule); - WriteToBuffer(pResult, pDomainFile); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetAppDomainForObject - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT CreateRefWalk(RefWalkHandle * pHandle, BOOL walkStacks, BOOL walkFQ, UINT32 handleWalkMask) -void DDUnpack::Unpack_CreateRefWalk(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - RefWalkHandle _pHandle; // storage - RefWalkHandle * pHandle = &_pHandle; - // pHandle does not need to be copied on input - BOOL walkStacks; - ReadFromBuffer(pSend, walkStacks); - BOOL walkFQ; - ReadFromBuffer(pSend, walkFQ); - UINT32 handleWalkMask; - ReadFromBuffer(pSend, handleWalkMask); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->CreateRefWalk(pHandle, walkStacks, walkFQ, handleWalkMask); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pHandle); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method CreateRefWalk - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void DeleteRefWalk(RefWalkHandle handle) -void DDUnpack::Unpack_DeleteRefWalk(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - RefWalkHandle handle; - ReadFromBuffer(pSend, handle); - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->DeleteRefWalk(handle); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method DeleteRefWalk - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT WalkRefs(RefWalkHandle handle, ULONG count, DacGcReference * refs, ULONG * pFetched) -void DDUnpack::Unpack_WalkRefs(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - RefWalkHandle handle; - ReadFromBuffer(pSend, handle); - ULONG count; - ReadFromBuffer(pSend, count); - DacGcReference _refs; // storage - DacGcReference * refs = &_refs; - // refs does not need to be copied on input - ULONG _pFetched; // storage - ULONG * pFetched = &_pFetched; - // pFetched does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->WalkRefs(handle, count, refs, pFetched); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, refs); - WriteToBuffer(pResult, pFetched); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method WalkRefs - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT GetTypeID(CORDB_ADDRESS obj, COR_TYPEID * pType) -void DDUnpack::Unpack_GetTypeID(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - CORDB_ADDRESS obj; - ReadFromBuffer(pSend, obj); - COR_TYPEID _pType; // storage - COR_TYPEID * pType = &_pType; - ReadFromBuffer(pSend, &_pType); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetTypeID(obj, pType); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pType); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetTypeID - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT GetObjectFields(COR_TYPEID id, ULONG32 celt, COR_FIELD * layout, ULONG32 * pceltFetched) -void DDUnpack::Unpack_GetObjectFields(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - COR_TYPEID id; - ReadFromBuffer(pSend, id); - ULONG32 celt; - ReadFromBuffer(pSend, celt); - COR_FIELD _layout; // storage - COR_FIELD * layout = &_layout; - // layout does not need to be copied on input - ULONG32 _pceltFetched; // storage - ULONG32 * pceltFetched = &_pceltFetched; - // pceltFetched does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetObjectFields(id, celt, layout, pceltFetched); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, layout); - WriteToBuffer(pResult, pceltFetched); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetObjectFields - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT GetTypeLayout(COR_TYPEID id, COR_TYPE_LAYOUT * pLayout) -void DDUnpack::Unpack_GetTypeLayout(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - COR_TYPEID id; - ReadFromBuffer(pSend, id); - COR_TYPE_LAYOUT _pLayout; // storage - COR_TYPE_LAYOUT * pLayout = &_pLayout; - ReadFromBuffer(pSend, &_pLayout); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetTypeLayout(id, pLayout); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pLayout); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetTypeLayout - -//--------------------------------------------------------------------- -// Unpacking stub for: -// HRESULT GetArrayLayout(COR_TYPEID id, COR_ARRAY_LAYOUT * pLayout) -void DDUnpack::Unpack_GetArrayLayout(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - COR_TYPEID id; - ReadFromBuffer(pSend, id); - COR_ARRAY_LAYOUT _pLayout; // storage - COR_ARRAY_LAYOUT * pLayout = &_pLayout; - ReadFromBuffer(pSend, &_pLayout); // serialize to storage - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - HRESULT _retValue; // return result - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - _retValue = m_pReal->GetArrayLayout(id, pLayout); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pLayout); - WriteToBuffer(pResult, hr); // exception result - WriteToBuffer(pResult, _retValue); // copy back return result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetArrayLayout - -//--------------------------------------------------------------------- -// Unpacking stub for: -// void GetGCHeapInformation(COR_HEAPINFO * pHeapInfo) -void DDUnpack::Unpack_GetGCHeapInformation(ReadBuffer * pSend, WriteBuffer * pResult) -{ - - // Parameters - COR_HEAPINFO _pHeapInfo; // storage - COR_HEAPINFO * pHeapInfo = &_pHeapInfo; - // pHeapInfo does not need to be copied on input - _ASSERTE(pSend->IsAtEnd()); // ensure entire buffer is read - - // - // Make the actual call - // - HRESULT hr = S_OK; - EX_TRY - { - m_pReal->GetGCHeapInformation(pHeapInfo); // actual call - - } - EX_CATCH_HRESULT(hr); - // Marshal parameters back - WriteToBuffer(pResult, pHeapInfo); - WriteToBuffer(pResult, hr); // exception result - // Dtors for any DacDbi structures that we marshalled get run here. -} // end method GetGCHeapInformation - - -// -// Handler -// -void DDUnpack::HandleDDMessage(ReadBuffer * pSend, WriteBuffer * pResult) -{ - DD_MessageId id; - ReadFromBuffer(pSend, id); - - switch(id) - { - - case DDID_CheckDbiVersion: - Unpack_CheckDbiVersion(pSend, pResult); - break; - - case DDID_GetLocalInterfaceHashAndTimestamp: - Unpack_GetLocalInterfaceHashAndTimestamp(pSend, pResult); - break; - - case DDID_GetRemoteInterfaceHashAndTimestamp: - Unpack_GetRemoteInterfaceHashAndTimestamp(pSend, pResult); - break; - - case DDID_FlushCache: - Unpack_FlushCache(pSend, pResult); - break; - - case DDID_DacSetTargetConsistencyChecks: - Unpack_DacSetTargetConsistencyChecks(pSend, pResult); - break; - - case DDID_Destroy: - Unpack_Destroy(pSend, pResult); - break; - - case DDID_IsLeftSideInitialized: - Unpack_IsLeftSideInitialized(pSend, pResult); - break; - - case DDID_GetAppDomainFromId: - Unpack_GetAppDomainFromId(pSend, pResult); - break; - - case DDID_GetAppDomainId: - Unpack_GetAppDomainId(pSend, pResult); - break; - - case DDID_GetAppDomainObject: - Unpack_GetAppDomainObject(pSend, pResult); - break; - - case DDID_IsDefaultDomain: - Unpack_IsDefaultDomain(pSend, pResult); - break; - - case DDID_GetAssemblyFromDomainAssembly: - Unpack_GetAssemblyFromDomainAssembly(pSend, pResult); - break; - - case DDID_IsAssemblyFullyTrusted: - Unpack_IsAssemblyFullyTrusted(pSend, pResult); - break; - - case DDID_GetAppDomainFullName: - Unpack_GetAppDomainFullName(pSend, pResult); - break; - - case DDID_GetModuleSimpleName: - Unpack_GetModuleSimpleName(pSend, pResult); - break; - - case DDID_GetAssemblyPath: - Unpack_GetAssemblyPath(pSend, pResult); - break; - - case DDID_ResolveTypeReference: - Unpack_ResolveTypeReference(pSend, pResult); - break; - - case DDID_GetModulePath: - Unpack_GetModulePath(pSend, pResult); - break; - - case DDID_GetModuleNGenPath: - Unpack_GetModuleNGenPath(pSend, pResult); - break; - - case DDID_GetMetadata: - Unpack_GetMetadata(pSend, pResult); - break; - - case DDID_GetSymbolsBuffer: - Unpack_GetSymbolsBuffer(pSend, pResult); - break; - - case DDID_GetModuleData: - Unpack_GetModuleData(pSend, pResult); - break; - - case DDID_GetDomainFileData: - Unpack_GetDomainFileData(pSend, pResult); - break; - - case DDID_GetModuleForDomainFile: - Unpack_GetModuleForDomainFile(pSend, pResult); - break; - - case DDID_GetAddressType: - Unpack_GetAddressType(pSend, pResult); - break; - - case DDID_IsTransitionStub: - Unpack_IsTransitionStub(pSend, pResult); - break; - - case DDID_GetCompilerFlags: - Unpack_GetCompilerFlags(pSend, pResult); - break; - - case DDID_SetCompilerFlags: - Unpack_SetCompilerFlags(pSend, pResult); - break; - - case DDID_EnumerateAppDomains: - Unpack_EnumerateAppDomains(pSend, pResult); - break; - - case DDID_EnumerateAssembliesInAppDomain: - Unpack_EnumerateAssembliesInAppDomain(pSend, pResult); - break; - - case DDID_EnumerateModulesInAssembly: - Unpack_EnumerateModulesInAssembly(pSend, pResult); - break; - - case DDID_RequestSyncAtEvent: - Unpack_RequestSyncAtEvent(pSend, pResult); - break; - - case DDID_MarkDebuggerAttachPending: - Unpack_MarkDebuggerAttachPending(pSend, pResult); - break; - - case DDID_MarkDebuggerAttached: - Unpack_MarkDebuggerAttached(pSend, pResult); - break; - - case DDID_Hijack: - Unpack_Hijack(pSend, pResult); - break; - - case DDID_EnumerateConnections: - Unpack_EnumerateConnections(pSend, pResult); - break; - - case DDID_EnumerateThreads: - Unpack_EnumerateThreads(pSend, pResult); - break; - - case DDID_IsThreadMarkedDead: - Unpack_IsThreadMarkedDead(pSend, pResult); - break; - - case DDID_GetThreadHandle: - Unpack_GetThreadHandle(pSend, pResult); - break; - - case DDID_GetThreadObject: - Unpack_GetThreadObject(pSend, pResult); - break; - - case DDID_SetDebugState: - Unpack_SetDebugState(pSend, pResult); - break; - - case DDID_HasUnhandledException: - Unpack_HasUnhandledException(pSend, pResult); - break; - - case DDID_GetUserState: - Unpack_GetUserState(pSend, pResult); - break; - - case DDID_GetConnectionID: - Unpack_GetConnectionID(pSend, pResult); - break; - - case DDID_GetTaskID: - Unpack_GetTaskID(pSend, pResult); - break; - - case DDID_TryGetVolatileOSThreadID: - Unpack_TryGetVolatileOSThreadID(pSend, pResult); - break; - - case DDID_GetUniqueThreadID: - Unpack_GetUniqueThreadID(pSend, pResult); - break; - - case DDID_GetCurrentException: - Unpack_GetCurrentException(pSend, pResult); - break; - - case DDID_GetCurrentCustomDebuggerNotification: - Unpack_GetCurrentCustomDebuggerNotification(pSend, pResult); - break; - - case DDID_GetCurrentAppDomain: - Unpack_GetCurrentAppDomain(pSend, pResult); - break; - - case DDID_ResolveAssembly: - Unpack_ResolveAssembly(pSend, pResult); - break; - - case DDID_GetNativeCodeSequencePointsAndVarInfo: - Unpack_GetNativeCodeSequencePointsAndVarInfo(pSend, pResult); - break; - - case DDID_GetManagedStoppedContext: - Unpack_GetManagedStoppedContext(pSend, pResult); - break; - - case DDID_CreateStackWalk: - Unpack_CreateStackWalk(pSend, pResult); - break; - - case DDID_DeleteStackWalk: - Unpack_DeleteStackWalk(pSend, pResult); - break; - - case DDID_GetStackWalkCurrentContext: - Unpack_GetStackWalkCurrentContext(pSend, pResult); - break; - - case DDID_SetStackWalkCurrentContext: - Unpack_SetStackWalkCurrentContext(pSend, pResult); - break; - - case DDID_UnwindStackWalkFrame: - Unpack_UnwindStackWalkFrame(pSend, pResult); - break; - - case DDID_CheckContext: - Unpack_CheckContext(pSend, pResult); - break; - - case DDID_GetStackWalkCurrentFrameInfo: - Unpack_GetStackWalkCurrentFrameInfo(pSend, pResult); - break; - - case DDID_GetCountOfInternalFrames: - Unpack_GetCountOfInternalFrames(pSend, pResult); - break; - - case DDID_EnumerateInternalFrames: - Unpack_EnumerateInternalFrames(pSend, pResult); - break; - - case DDID_IsMatchingParentFrame: - Unpack_IsMatchingParentFrame(pSend, pResult); - break; - - case DDID_GetStackParameterSize: - Unpack_GetStackParameterSize(pSend, pResult); - break; - - case DDID_GetFramePointer: - Unpack_GetFramePointer(pSend, pResult); - break; - - case DDID_IsLeafFrame: - Unpack_IsLeafFrame(pSend, pResult); - break; - - case DDID_GetContext: - Unpack_GetContext(pSend, pResult); - break; - - case DDID_ConvertContextToDebuggerRegDisplay: - Unpack_ConvertContextToDebuggerRegDisplay(pSend, pResult); - break; - - case DDID_IsILStubOrLCGMethod: - Unpack_IsILStubOrLCGMethod(pSend, pResult); - break; - - case DDID_GetVarArgSig: - Unpack_GetVarArgSig(pSend, pResult); - break; - - case DDID_RequiresAlign8: - Unpack_RequiresAlign8(pSend, pResult); - break; - - case DDID_ResolveExactGenericArgsToken: - Unpack_ResolveExactGenericArgsToken(pSend, pResult); - break; - - case DDID_GetILCodeAndSig: - Unpack_GetILCodeAndSig(pSend, pResult); - break; - - case DDID_GetNativeCodeInfo: - Unpack_GetNativeCodeInfo(pSend, pResult); - break; - - case DDID_GetNativeCodeInfoForAddr: - Unpack_GetNativeCodeInfoForAddr(pSend, pResult); - break; - - case DDID_GetClassInfo: - Unpack_GetClassInfo(pSend, pResult); - break; - - case DDID_GetInstantiationFieldInfo: - Unpack_GetInstantiationFieldInfo(pSend, pResult); - break; - - case DDID_TypeHandleToExpandedTypeInfo: - Unpack_TypeHandleToExpandedTypeInfo(pSend, pResult); - break; - - case DDID_GetObjectExpandedTypeInfo: - Unpack_GetObjectExpandedTypeInfo(pSend, pResult); - break; - - case DDID_GetObjectExpandedTypeInfoFromID: - Unpack_GetObjectExpandedTypeInfoFromID(pSend, pResult); - break; - - case DDID_GetApproxTypeHandle: - Unpack_GetApproxTypeHandle(pSend, pResult); - break; - - case DDID_GetExactTypeHandle: - Unpack_GetExactTypeHandle(pSend, pResult); - break; - - case DDID_GetMethodDescParams: - Unpack_GetMethodDescParams(pSend, pResult); - break; - - case DDID_GetThreadOrContextStaticAddress: - Unpack_GetThreadOrContextStaticAddress(pSend, pResult); - break; - - case DDID_GetCollectibleTypeStaticAddress: - Unpack_GetCollectibleTypeStaticAddress(pSend, pResult); - break; - - case DDID_GetEnCHangingFieldInfo: - Unpack_GetEnCHangingFieldInfo(pSend, pResult); - break; - - case DDID_GetTypeHandleParams: - Unpack_GetTypeHandleParams(pSend, pResult); - break; - - case DDID_GetSimpleType: - Unpack_GetSimpleType(pSend, pResult); - break; - - case DDID_IsExceptionObject: - Unpack_IsExceptionObject(pSend, pResult); - break; - - case DDID_GetStackFramesFromException: - Unpack_GetStackFramesFromException(pSend, pResult); - break; - - case DDID_IsRcw: - Unpack_IsRcw(pSend, pResult); - break; - - case DDID_GetRcwCachedInterfaceTypes: - Unpack_GetRcwCachedInterfaceTypes(pSend, pResult); - break; - - case DDID_GetRcwCachedInterfacePointers: - Unpack_GetRcwCachedInterfacePointers(pSend, pResult); - break; - - case DDID_GetCachedWinRTTypesForIIDs: - Unpack_GetCachedWinRTTypesForIIDs(pSend, pResult); - break; - - case DDID_GetCachedWinRTTypes: - Unpack_GetCachedWinRTTypes(pSend, pResult); - break; - - case DDID_GetTypedByRefInfo: - Unpack_GetTypedByRefInfo(pSend, pResult); - break; - - case DDID_GetStringData: - Unpack_GetStringData(pSend, pResult); - break; - - case DDID_GetArrayData: - Unpack_GetArrayData(pSend, pResult); - break; - - case DDID_GetBasicObjectInfo: - Unpack_GetBasicObjectInfo(pSend, pResult); - break; - - case DDID_TestCrst: - Unpack_TestCrst(pSend, pResult); - break; - - case DDID_TestRWLock: - Unpack_TestRWLock(pSend, pResult); - break; - - case DDID_GetDebuggerControlBlockAddress: - Unpack_GetDebuggerControlBlockAddress(pSend, pResult); - break; - - case DDID_GetObjectFromRefPtr: - Unpack_GetObjectFromRefPtr(pSend, pResult); - break; - - case DDID_GetObject: - Unpack_GetObject(pSend, pResult); - break; - - case DDID_EnableNGENPolicy: - Unpack_EnableNGENPolicy(pSend, pResult); - break; - - case DDID_GetVmObjectHandle: - Unpack_GetVmObjectHandle(pSend, pResult); - break; - - case DDID_IsVmObjectHandleValid: - Unpack_IsVmObjectHandleValid(pSend, pResult); - break; - - case DDID_IsWinRTModule: - Unpack_IsWinRTModule(pSend, pResult); - break; - - case DDID_GetAppDomainIdFromVmObjectHandle: - Unpack_GetAppDomainIdFromVmObjectHandle(pSend, pResult); - break; - - case DDID_GetHandleAddressFromVmHandle: - Unpack_GetHandleAddressFromVmHandle(pSend, pResult); - break; - - case DDID_GetObjectContents: - Unpack_GetObjectContents(pSend, pResult); - break; - - case DDID_EnumerateBlockingObjects: - Unpack_EnumerateBlockingObjects(pSend, pResult); - break; - - case DDID_GetThreadOwningMonitorLock: - Unpack_GetThreadOwningMonitorLock(pSend, pResult); - break; - - case DDID_EnumerateMonitorEventWaitList: - Unpack_EnumerateMonitorEventWaitList(pSend, pResult); - break; - - case DDID_GetAttachStateFlags: - Unpack_GetAttachStateFlags(pSend, pResult); - break; - - case DDID_GetMetaDataFileInfoFromPEFile: - Unpack_GetMetaDataFileInfoFromPEFile(pSend, pResult); - break; - - case DDID_GetILImageInfoFromNgenPEFile: - Unpack_GetILImageInfoFromNgenPEFile(pSend, pResult); - break; - - case DDID_IsThreadSuspendedOrHijacked: - Unpack_IsThreadSuspendedOrHijacked(pSend, pResult); - break; - - case DDID_AreGCStructuresValid: - Unpack_AreGCStructuresValid(pSend, pResult); - break; - - case DDID_CreateHeapWalk: - Unpack_CreateHeapWalk(pSend, pResult); - break; - - case DDID_DeleteHeapWalk: - Unpack_DeleteHeapWalk(pSend, pResult); - break; - - case DDID_WalkHeap: - Unpack_WalkHeap(pSend, pResult); - break; - - case DDID_GetHeapSegments: - Unpack_GetHeapSegments(pSend, pResult); - break; - - case DDID_IsValidObject: - Unpack_IsValidObject(pSend, pResult); - break; - - case DDID_GetAppDomainForObject: - Unpack_GetAppDomainForObject(pSend, pResult); - break; - - case DDID_CreateRefWalk: - Unpack_CreateRefWalk(pSend, pResult); - break; - - case DDID_DeleteRefWalk: - Unpack_DeleteRefWalk(pSend, pResult); - break; - - case DDID_WalkRefs: - Unpack_WalkRefs(pSend, pResult); - break; - - case DDID_GetTypeID: - Unpack_GetTypeID(pSend, pResult); - break; - - case DDID_GetObjectFields: - Unpack_GetObjectFields(pSend, pResult); - break; - - case DDID_GetTypeLayout: - Unpack_GetTypeLayout(pSend, pResult); - break; - - case DDID_GetArrayLayout: - Unpack_GetArrayLayout(pSend, pResult); - break; - - case DDID_GetGCHeapInformation: - Unpack_GetGCHeapInformation(pSend, pResult); - break; - - - } // end switch -} // end HandleDDMessage method - -#endif //FEATURE_DBGIPC_TRANSPORT_VM - -// end of file diff --git a/src/debug/ee/ddunpack.h b/src/debug/ee/ddunpack.h deleted file mode 100644 index 23be521642..0000000000 --- a/src/debug/ee/ddunpack.h +++ /dev/null @@ -1,498 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// - -// Unpacker -// -// Lives on EE side of the fence -// -// Note that this file is generated by ndp\clr\src\Debug\tools\BuildDDMarshal\. -// Changes should be made to output\DDUnpack_template.h in that directory. -// - - -#ifndef _DDUNPACK_H_ -#define _DDUNPACK_H_ - -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - -#include "ddmarshalutil.h" -#include "ddshared.h" - - -// This technique is now misnamed, but I am still using it to lower code churn. -// When handing memory back and forth between DAC and DBI we use this (forDbi) new variant -// to ensure that everything goes in the correct heap. In DBI it resolves to new, and in DAC -// it resolves to calling into a special allocator that DBI passed over that ultimately also -// calls DBI new. A few types such as DacDbiArrayList get included on both sides of the DLL -// boundary and they assume there will be a (forDbi) new variant available to them. -// -// Now however we have a new in-proc consumer of DAC and again we need to pass memory blocks -// to it. The most straightforward technique is to consume DAC exactly how DBI does, thus mimicing -// DBI's new variant here so that all the types which straddle the boundary can continue using -// it. At some point we might want to change the naming to something more general... 'forDacCaller' -// perhaps. I don't consider the technique a workaround, just the naming is overly specific. - -#define forDbi (*(forDbiWorker *)NULL) - -// for dbi we just default to new, but we need to have these defined for both dac and dbi -inline void * operator new(size_t lenBytes, const forDbiWorker &) -{ - void * result = new BYTE[lenBytes]; - if (result == NULL) - { - ThrowOutOfMemory(); - } - return result; -} - -inline void * operator new[](size_t lenBytes, const forDbiWorker &) -{ - void * result = new BYTE[lenBytes]; - if (result == NULL) - { - ThrowOutOfMemory(); - } - return result; -} - -// Helper to delete memory used with the IDacDbiInterface::IAllocator interface. -template<class T> inline -void DeleteDbiMemory(T *p) -{ - delete p; -} - - -// Header for unpacking -// -class DDUnpack - { - protected: - IDacDbiInterface * m_pReal; - IDacDbiInterface::IAllocator * m_pAllocator; - public: - DDUnpack(IDacDbiInterface * pReal, IDacDbiInterface::IAllocator * pAllocator) - { - m_pReal = pReal; - m_pAllocator = pAllocator; - } - - // Main entry point - // This will then delegate to the proper unpacking stubs. - void HandleDDMessage(ReadBuffer * pSend, WriteBuffer * pResult); - - - // - // Stubs - // - -//--------------------------------------------------------------------- -// Unpacking stubs - // HRESULT CheckDbiVersion(const DbiVersion * pVersion) - void Unpack_CheckDbiVersion(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetLocalInterfaceHashAndTimestamp(DWORD & hash1, DWORD & hash2, DWORD & hash3, DWORD & hash4, DWORD & timestamp1, DWORD & timestamp2) - void Unpack_GetLocalInterfaceHashAndTimestamp(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetRemoteInterfaceHashAndTimestamp(DWORD & hash1, DWORD & hash2, DWORD & hash3, DWORD & hash4, DWORD & timestamp1, DWORD & timestamp2) - void Unpack_GetRemoteInterfaceHashAndTimestamp(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT FlushCache() - void Unpack_FlushCache(ReadBuffer * pSend, WriteBuffer * pResult); - - // void DacSetTargetConsistencyChecks(bool fEnableAsserts) - void Unpack_DacSetTargetConsistencyChecks(ReadBuffer * pSend, WriteBuffer * pResult); - - // void Destroy() - void Unpack_Destroy(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsLeftSideInitialized() - void Unpack_IsLeftSideInitialized(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_AppDomain GetAppDomainFromId(ULONG appdomainId) - void Unpack_GetAppDomainFromId(ReadBuffer * pSend, WriteBuffer * pResult); - - // ULONG GetAppDomainId(VMPTR_AppDomain vmAppDomain) - void Unpack_GetAppDomainId(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_OBJECTHANDLE GetAppDomainObject(VMPTR_AppDomain vmAppDomain) - void Unpack_GetAppDomainObject(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsDefaultDomain(VMPTR_AppDomain vmAppDomain) - void Unpack_IsDefaultDomain(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetAssemblyFromDomainAssembly(VMPTR_DomainAssembly vmDomainAssembly, VMPTR_Assembly * vmAssembly) - void Unpack_GetAssemblyFromDomainAssembly(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsAssemblyFullyTrusted(VMPTR_DomainAssembly vmDomainAssembly) - void Unpack_IsAssemblyFullyTrusted(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetAppDomainFullName(VMPTR_AppDomain vmAppDomain, IStringHolder * pStrName) - void Unpack_GetAppDomainFullName(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetModuleSimpleName(VMPTR_Module vmModule, IStringHolder * pStrFilename) - void Unpack_GetModuleSimpleName(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL GetAssemblyPath(VMPTR_Assembly vmAssembly, IStringHolder * pStrFilename) - void Unpack_GetAssemblyPath(ReadBuffer * pSend, WriteBuffer * pResult); - - // void ResolveTypeReference(const TypeRefData * pTypeRefInfo, TypeRefData * pTargetRefInfo) - void Unpack_ResolveTypeReference(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL GetModulePath(VMPTR_Module vmModule, IStringHolder * pStrFilename) - void Unpack_GetModulePath(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL GetModuleNGenPath(VMPTR_Module vmModule, IStringHolder * pStrFilename) - void Unpack_GetModuleNGenPath(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetMetadata(VMPTR_Module vmModule, TargetBuffer * pTargetBuffer) - void Unpack_GetMetadata(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetSymbolsBuffer(VMPTR_Module vmModule, TargetBuffer * pTargetBuffer, IDacDbiInterface::SymbolFormat * pSymbolFormat) - void Unpack_GetSymbolsBuffer(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetModuleData(VMPTR_Module vmModule, ModuleInfo * pData) - void Unpack_GetModuleData(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetDomainFileData(VMPTR_DomainFile vmDomainFile, DomainFileInfo * pData) - void Unpack_GetDomainFileData(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetModuleForDomainFile(VMPTR_DomainFile vmDomainFile, VMPTR_Module * pModule) - void Unpack_GetModuleForDomainFile(ReadBuffer * pSend, WriteBuffer * pResult); - - // IDacDbiInterface::AddressType GetAddressType(CORDB_ADDRESS address) - void Unpack_GetAddressType(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsTransitionStub(CORDB_ADDRESS address) - void Unpack_IsTransitionStub(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetCompilerFlags(VMPTR_DomainFile vmDomainFile, BOOL * pfAllowJITOpts, BOOL * pfEnableEnC) - void Unpack_GetCompilerFlags(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT SetCompilerFlags(VMPTR_DomainFile vmDomainFile, BOOL fAllowJitOpts, BOOL fEnableEnC) - void Unpack_SetCompilerFlags(ReadBuffer * pSend, WriteBuffer * pResult); - - // void EnumerateAppDomains(IDacDbiInterface::FP_APPDOMAIN_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) - void Unpack_EnumerateAppDomains(ReadBuffer * pSend, WriteBuffer * pResult); - - // void EnumerateAssembliesInAppDomain(VMPTR_AppDomain vmAppDomain, IDacDbiInterface::FP_ASSEMBLY_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) - void Unpack_EnumerateAssembliesInAppDomain(ReadBuffer * pSend, WriteBuffer * pResult); - - // void EnumerateModulesInAssembly(VMPTR_DomainAssembly vmAssembly, IDacDbiInterface::FP_MODULE_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) - void Unpack_EnumerateModulesInAssembly(ReadBuffer * pSend, WriteBuffer * pResult); - - // void RequestSyncAtEvent() - void Unpack_RequestSyncAtEvent(ReadBuffer * pSend, WriteBuffer * pResult); - - // void MarkDebuggerAttachPending() - void Unpack_MarkDebuggerAttachPending(ReadBuffer * pSend, WriteBuffer * pResult); - - // void MarkDebuggerAttached(BOOL fAttached) - void Unpack_MarkDebuggerAttached(ReadBuffer * pSend, WriteBuffer * pResult); - - // void Hijack(VMPTR_Thread vmThread, ULONG32 dwThreadId, const EXCEPTION_RECORD * pRecord, T_CONTEXT * pOriginalContext, ULONG32 cbSizeContext, EHijackReason::EHijackReason reason, void * pUserData, CORDB_ADDRESS * pRemoteContextAddr) - void Unpack_Hijack(ReadBuffer * pSend, WriteBuffer * pResult); - - // void EnumerateConnections(IDacDbiInterface::FP_CONNECTION_CALLBACK fpCallback, CALLBACK_DATA pUserData) - void Unpack_EnumerateConnections(ReadBuffer * pSend, WriteBuffer * pResult); - - // void EnumerateThreads(IDacDbiInterface::FP_THREAD_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) - void Unpack_EnumerateThreads(ReadBuffer * pSend, WriteBuffer * pResult); - - // bool IsThreadMarkedDead(VMPTR_Thread vmThread) - void Unpack_IsThreadMarkedDead(ReadBuffer * pSend, WriteBuffer * pResult); - - // HANDLE GetThreadHandle(VMPTR_Thread vmThread) - void Unpack_GetThreadHandle(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_OBJECTHANDLE GetThreadObject(VMPTR_Thread vmThread) - void Unpack_GetThreadObject(ReadBuffer * pSend, WriteBuffer * pResult); - - // void SetDebugState(VMPTR_Thread vmThread, CorDebugThreadState debugState) - void Unpack_SetDebugState(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL HasUnhandledException(VMPTR_Thread vmThread) - void Unpack_HasUnhandledException(ReadBuffer * pSend, WriteBuffer * pResult); - - // CorDebugUserState GetUserState(VMPTR_Thread vmThread) - void Unpack_GetUserState(ReadBuffer * pSend, WriteBuffer * pResult); - - // CONNID GetConnectionID(VMPTR_Thread vmThread) - void Unpack_GetConnectionID(ReadBuffer * pSend, WriteBuffer * pResult); - - // TASKID GetTaskID(VMPTR_Thread vmThread) - void Unpack_GetTaskID(ReadBuffer * pSend, WriteBuffer * pResult); - - // DWORD TryGetVolatileOSThreadID(VMPTR_Thread vmThread) - void Unpack_TryGetVolatileOSThreadID(ReadBuffer * pSend, WriteBuffer * pResult); - - // DWORD GetUniqueThreadID(VMPTR_Thread vmThread) - void Unpack_GetUniqueThreadID(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_OBJECTHANDLE GetCurrentException(VMPTR_Thread vmThread) - void Unpack_GetCurrentException(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_OBJECTHANDLE GetCurrentCustomDebuggerNotification(VMPTR_Thread vmThread) - void Unpack_GetCurrentCustomDebuggerNotification(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_AppDomain GetCurrentAppDomain(VMPTR_Thread vmThread) - void Unpack_GetCurrentAppDomain(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_DomainAssembly ResolveAssembly(VMPTR_DomainFile vmScope, mdToken tkAssemblyRef) - void Unpack_ResolveAssembly(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetNativeCodeSequencePointsAndVarInfo(VMPTR_MethodDesc vmMethodDesc, CORDB_ADDRESS startAddress, BOOL fCodeAvailabe, NativeVarData * pNativeVarData, SequencePoints * pSequencePoints) - void Unpack_GetNativeCodeSequencePointsAndVarInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_CONTEXT GetManagedStoppedContext(VMPTR_Thread vmThread) - void Unpack_GetManagedStoppedContext(ReadBuffer * pSend, WriteBuffer * pResult); - - // void CreateStackWalk(VMPTR_Thread vmThread, DT_CONTEXT * pInternalContextBuffer, StackWalkHandle * ppSFIHandle) - void Unpack_CreateStackWalk(ReadBuffer * pSend, WriteBuffer * pResult); - - // void DeleteStackWalk(StackWalkHandle ppSFIHandle) - void Unpack_DeleteStackWalk(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetStackWalkCurrentContext(StackWalkHandle pSFIHandle, DT_CONTEXT * pContext) - void Unpack_GetStackWalkCurrentContext(ReadBuffer * pSend, WriteBuffer * pResult); - - // void SetStackWalkCurrentContext(VMPTR_Thread vmThread, StackWalkHandle pSFIHandle, CorDebugSetContextFlag flag, DT_CONTEXT * pContext) - void Unpack_SetStackWalkCurrentContext(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL UnwindStackWalkFrame(StackWalkHandle pSFIHandle) - void Unpack_UnwindStackWalkFrame(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT CheckContext(VMPTR_Thread vmThread, const DT_CONTEXT * pContext) - void Unpack_CheckContext(ReadBuffer * pSend, WriteBuffer * pResult); - - // IDacDbiInterface::FrameType GetStackWalkCurrentFrameInfo(StackWalkHandle pSFIHandle, DebuggerIPCE_STRData * pFrameData) - void Unpack_GetStackWalkCurrentFrameInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // ULONG32 GetCountOfInternalFrames(VMPTR_Thread vmThread) - void Unpack_GetCountOfInternalFrames(ReadBuffer * pSend, WriteBuffer * pResult); - - // void EnumerateInternalFrames(VMPTR_Thread vmThread, IDacDbiInterface::FP_INTERNAL_FRAME_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) - void Unpack_EnumerateInternalFrames(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsMatchingParentFrame(FramePointer fpToCheck, FramePointer fpParent) - void Unpack_IsMatchingParentFrame(ReadBuffer * pSend, WriteBuffer * pResult); - - // ULONG32 GetStackParameterSize(CORDB_ADDRESS controlPC) - void Unpack_GetStackParameterSize(ReadBuffer * pSend, WriteBuffer * pResult); - - // FramePointer GetFramePointer(StackWalkHandle pSFIHandle) - void Unpack_GetFramePointer(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsLeafFrame(VMPTR_Thread vmThread, const DT_CONTEXT * pContext) - void Unpack_IsLeafFrame(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetContext(VMPTR_Thread vmThread, DT_CONTEXT * pContextBuffer) - void Unpack_GetContext(ReadBuffer * pSend, WriteBuffer * pResult); - - // void ConvertContextToDebuggerRegDisplay(const DT_CONTEXT * pInContext, DebuggerREGDISPLAY * pOutDRD, BOOL fActive) - void Unpack_ConvertContextToDebuggerRegDisplay(ReadBuffer * pSend, WriteBuffer * pResult); - - // IDacDbiInterface::DynamicMethodType IsILStubOrLCGMethod(VMPTR_MethodDesc vmMethodDesc) - void Unpack_IsILStubOrLCGMethod(ReadBuffer * pSend, WriteBuffer * pResult); - - // TargetBuffer GetVarArgSig(CORDB_ADDRESS VASigCookieAddr, CORDB_ADDRESS * pArgBase) - void Unpack_GetVarArgSig(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL RequiresAlign8(VMPTR_TypeHandle thExact) - void Unpack_RequiresAlign8(ReadBuffer * pSend, WriteBuffer * pResult); - - // GENERICS_TYPE_TOKEN ResolveExactGenericArgsToken(DWORD dwExactGenericArgsTokenIndex, GENERICS_TYPE_TOKEN rawToken) - void Unpack_ResolveExactGenericArgsToken(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetILCodeAndSig(VMPTR_DomainFile vmDomainFile, mdToken functionToken, TargetBuffer * pCodeInfo, mdToken * pLocalSigToken) - void Unpack_GetILCodeAndSig(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetNativeCodeInfo(VMPTR_DomainFile vmDomainFile, mdToken functionToken, NativeCodeFunctionData * pCodeInfo) - void Unpack_GetNativeCodeInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetNativeCodeInfoForAddr(VMPTR_MethodDesc vmMethodDesc, CORDB_ADDRESS hotCodeStartAddr, NativeCodeFunctionData * pCodeInfo) - void Unpack_GetNativeCodeInfoForAddr(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetClassInfo(VMPTR_AppDomain vmAppDomain, VMPTR_Module vmModule, mdTypeDef metadataToken, VMPTR_TypeHandle thExact, VMPTR_TypeHandle thApprox, ClassInfo * pData) - void Unpack_GetClassInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetInstantiationFieldInfo(VMPTR_DomainFile vmDomainFile, mdTypeDef metadataToken, VMPTR_TypeHandle vmThExact, VMPTR_TypeHandle vmThApprox, DacDbiArrayList<FieldData> * pFieldList, SIZE_T * pObjectSize) - void Unpack_GetInstantiationFieldInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // void TypeHandleToExpandedTypeInfo(AreValueTypesBoxed boxed, VMPTR_AppDomain vmAppDomain, VMPTR_TypeHandle vmTypeHandle, DebuggerIPCE_ExpandedTypeData * pTypeInfo) - void Unpack_TypeHandleToExpandedTypeInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetObjectExpandedTypeInfo(AreValueTypesBoxed boxed, VMPTR_AppDomain vmAppDomain, CORDB_ADDRESS addr, DebuggerIPCE_ExpandedTypeData * pTypeInfo) - void Unpack_GetObjectExpandedTypeInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetObjectExpandedTypeInfoFromID(AreValueTypesBoxed boxed, VMPTR_AppDomain vmAppDomain, COR_TYPEID id, DebuggerIPCE_ExpandedTypeData * pTypeInfo) - void Unpack_GetObjectExpandedTypeInfoFromID(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_TypeHandle GetApproxTypeHandle(TypeInfoList * pTypeData) - void Unpack_GetApproxTypeHandle(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT GetExactTypeHandle(DebuggerIPCE_ExpandedTypeData * pTypeData, ArgInfoList * pArgInfo, VMPTR_TypeHandle & vmTypeHandle) - void Unpack_GetExactTypeHandle(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetMethodDescParams(VMPTR_AppDomain vmAppDomain, VMPTR_MethodDesc vmMethodDesc, GENERICS_TYPE_TOKEN genericsToken, UINT32 * pcGenericClassTypeParams, TypeParamsList * pGenericTypeParams) - void Unpack_GetMethodDescParams(ReadBuffer * pSend, WriteBuffer * pResult); - - // CORDB_ADDRESS GetThreadOrContextStaticAddress(VMPTR_FieldDesc vmField, VMPTR_Thread vmRuntimeThread) - void Unpack_GetThreadOrContextStaticAddress(ReadBuffer * pSend, WriteBuffer * pResult); - - // CORDB_ADDRESS GetCollectibleTypeStaticAddress(VMPTR_FieldDesc vmField, VMPTR_AppDomain vmAppDomain) - void Unpack_GetCollectibleTypeStaticAddress(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetEnCHangingFieldInfo(const EnCHangingFieldInfo * pEnCFieldInfo, FieldData * pFieldData, BOOL * pfStatic) - void Unpack_GetEnCHangingFieldInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetTypeHandleParams(VMPTR_AppDomain vmAppDomain, VMPTR_TypeHandle vmTypeHandle, TypeParamsList * pParams) - void Unpack_GetTypeHandleParams(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetSimpleType(VMPTR_AppDomain vmAppDomain, CorElementType simpleType, mdTypeDef * pMetadataToken, VMPTR_Module * pVmModule, VMPTR_DomainFile * pVmDomainFile) - void Unpack_GetSimpleType(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsExceptionObject(VMPTR_Object vmObject) - void Unpack_IsExceptionObject(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList<DacExceptionCallStackData> & dacStackFrames) - void Unpack_GetStackFramesFromException(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsRcw(VMPTR_Object vmObject) - void Unpack_IsRcw(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetRcwCachedInterfaceTypes(VMPTR_Object vmObject, VMPTR_AppDomain vmAppDomain, BOOL bIInspectableOnly, DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pDacInterfaces) - void Unpack_GetRcwCachedInterfaceTypes(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetRcwCachedInterfacePointers(VMPTR_Object vmObject, BOOL bIInspectableOnly, DacDbiArrayList<CORDB_ADDRESS> * pDacItfPtrs) - void Unpack_GetRcwCachedInterfacePointers(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList<GUID> & iids, DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pTypes) - void Unpack_GetCachedWinRTTypesForIIDs(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetCachedWinRTTypes(VMPTR_AppDomain vmAppDomain, DacDbiArrayList<GUID> * piids, DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pTypes) - void Unpack_GetCachedWinRTTypes(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetTypedByRefInfo(CORDB_ADDRESS pTypedByRef, VMPTR_AppDomain vmAppDomain, DebuggerIPCE_ObjectData * pObjectData) - void Unpack_GetTypedByRefInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetStringData(CORDB_ADDRESS objectAddress, DebuggerIPCE_ObjectData * pObjectData) - void Unpack_GetStringData(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetArrayData(CORDB_ADDRESS objectAddress, DebuggerIPCE_ObjectData * pObjectData) - void Unpack_GetArrayData(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetBasicObjectInfo(CORDB_ADDRESS objectAddress, CorElementType type, VMPTR_AppDomain vmAppDomain, DebuggerIPCE_ObjectData * pObjectData) - void Unpack_GetBasicObjectInfo(ReadBuffer * pSend, WriteBuffer * pResult); - - // void TestCrst(VMPTR_Crst vmCrst) - void Unpack_TestCrst(ReadBuffer * pSend, WriteBuffer * pResult); - - // void TestRWLock(VMPTR_SimpleRWLock vmRWLock) - void Unpack_TestRWLock(ReadBuffer * pSend, WriteBuffer * pResult); - - // CORDB_ADDRESS GetDebuggerControlBlockAddress() - void Unpack_GetDebuggerControlBlockAddress(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_Object GetObjectFromRefPtr(CORDB_ADDRESS ptr) - void Unpack_GetObjectFromRefPtr(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_Object GetObject(CORDB_ADDRESS ptr) - void Unpack_GetObject(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT EnableNGENPolicy(CorDebugNGENPolicy ePolicy) - void Unpack_EnableNGENPolicy(ReadBuffer * pSend, WriteBuffer * pResult); - - // VMPTR_OBJECTHANDLE GetVmObjectHandle(CORDB_ADDRESS handleAddress) - void Unpack_GetVmObjectHandle(ReadBuffer * pSend, WriteBuffer * pResult); - - // BOOL IsVmObjectHandleValid(VMPTR_OBJECTHANDLE vmHandle) - void Unpack_IsVmObjectHandleValid(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT IsWinRTModule(VMPTR_Module vmModule, BOOL & isWinRT) - void Unpack_IsWinRTModule(ReadBuffer * pSend, WriteBuffer * pResult); - - // ULONG GetAppDomainIdFromVmObjectHandle(VMPTR_OBJECTHANDLE vmHandle) - void Unpack_GetAppDomainIdFromVmObjectHandle(ReadBuffer * pSend, WriteBuffer * pResult); - - // CORDB_ADDRESS GetHandleAddressFromVmHandle(VMPTR_OBJECTHANDLE vmHandle) - void Unpack_GetHandleAddressFromVmHandle(ReadBuffer * pSend, WriteBuffer * pResult); - - // TargetBuffer GetObjectContents(VMPTR_Object obj) - void Unpack_GetObjectContents(ReadBuffer * pSend, WriteBuffer * pResult); - - // void EnumerateBlockingObjects(VMPTR_Thread vmThread, IDacDbiInterface::FP_BLOCKINGOBJECT_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) - void Unpack_EnumerateBlockingObjects(ReadBuffer * pSend, WriteBuffer * pResult); - - // MonitorLockInfo GetThreadOwningMonitorLock(VMPTR_Object vmObject) - void Unpack_GetThreadOwningMonitorLock(ReadBuffer * pSend, WriteBuffer * pResult); - - // void EnumerateMonitorEventWaitList(VMPTR_Object vmObject, IDacDbiInterface::FP_THREAD_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData) - void Unpack_EnumerateMonitorEventWaitList(ReadBuffer * pSend, WriteBuffer * pResult); - - // CLR_DEBUGGING_PROCESS_FLAGS GetAttachStateFlags() - void Unpack_GetAttachStateFlags(ReadBuffer * pSend, WriteBuffer * pResult); - - // bool GetMetaDataFileInfoFromPEFile(VMPTR_PEFile vmPEFile, DWORD & dwTimeStamp, DWORD & dwImageSize, bool & isNGEN, IStringHolder * pStrFilename) - void Unpack_GetMetaDataFileInfoFromPEFile(ReadBuffer * pSend, WriteBuffer * pResult); - - // bool GetILImageInfoFromNgenPEFile(VMPTR_PEFile vmPEFile, DWORD & dwTimeStamp, DWORD & dwSize, IStringHolder * pStrFilename) - void Unpack_GetILImageInfoFromNgenPEFile(ReadBuffer * pSend, WriteBuffer * pResult); - - // bool IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread) - void Unpack_IsThreadSuspendedOrHijacked(ReadBuffer * pSend, WriteBuffer * pResult); - - // bool AreGCStructuresValid() - void Unpack_AreGCStructuresValid(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT CreateHeapWalk(HeapWalkHandle * pHandle) - void Unpack_CreateHeapWalk(ReadBuffer * pSend, WriteBuffer * pResult); - - // void DeleteHeapWalk(HeapWalkHandle handle) - void Unpack_DeleteHeapWalk(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT WalkHeap(HeapWalkHandle handle, ULONG count, COR_HEAPOBJECT * objects, ULONG * pFetched) - void Unpack_WalkHeap(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT GetHeapSegments(DacDbiArrayList<COR_SEGMENT> * pSegments) - void Unpack_GetHeapSegments(ReadBuffer * pSend, WriteBuffer * pResult); - - // bool IsValidObject(CORDB_ADDRESS obj) - void Unpack_IsValidObject(ReadBuffer * pSend, WriteBuffer * pResult); - - // bool GetAppDomainForObject(CORDB_ADDRESS obj, VMPTR_AppDomain * pApp, VMPTR_Module * pModule, VMPTR_DomainFile * pDomainFile) - void Unpack_GetAppDomainForObject(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT CreateRefWalk(RefWalkHandle * pHandle, BOOL walkStacks, BOOL walkFQ, UINT32 handleWalkMask) - void Unpack_CreateRefWalk(ReadBuffer * pSend, WriteBuffer * pResult); - - // void DeleteRefWalk(RefWalkHandle handle) - void Unpack_DeleteRefWalk(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT WalkRefs(RefWalkHandle handle, ULONG count, DacGcReference * refs, ULONG * pFetched) - void Unpack_WalkRefs(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT GetTypeID(CORDB_ADDRESS obj, COR_TYPEID * pType) - void Unpack_GetTypeID(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT GetObjectFields(COR_TYPEID id, ULONG32 celt, COR_FIELD * layout, ULONG32 * pceltFetched) - void Unpack_GetObjectFields(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT GetTypeLayout(COR_TYPEID id, COR_TYPE_LAYOUT * pLayout) - void Unpack_GetTypeLayout(ReadBuffer * pSend, WriteBuffer * pResult); - - // HRESULT GetArrayLayout(COR_TYPEID id, COR_ARRAY_LAYOUT * pLayout) - void Unpack_GetArrayLayout(ReadBuffer * pSend, WriteBuffer * pResult); - - // void GetGCHeapInformation(COR_HEAPINFO * pHeapInfo) - void Unpack_GetGCHeapInformation(ReadBuffer * pSend, WriteBuffer * pResult); - - }; - -#endif // _DDUNPACK_H_ - -#endif //FEATURE_DBGIPC_TRANSPORT_VM - -// end of file diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp index f95e49b3f0..582a3954a9 100644 --- a/src/debug/ee/debugger.cpp +++ b/src/debug/ee/debugger.cpp @@ -38,8 +38,6 @@ #include "../../vm/excep.h" #if defined(FEATURE_DBGIPC_TRANSPORT_VM) #include "dbgtransportsession.h" -#include "dbgtransportproxy.h" -#include "dbgsecureconnection.h" #endif // FEATURE_DBGIPC_TRANSPORT_VM @@ -1729,11 +1727,7 @@ void Debugger::RaiseStartupNotification() // listening, and we will fail. However, we still want to initialize the variable above. BOOL fRaiseStartupNotification = TRUE; #if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(useTransport) - { - fRaiseStartupNotification = (CORDebuggerAttached() ? TRUE : FALSE); - } + fRaiseStartupNotification = (CORDebuggerAttached() ? TRUE : FALSE); #endif if (fRaiseStartupNotification) { @@ -1766,67 +1760,58 @@ void Debugger::RaiseStartupNotification() void Debugger::SendRawEvent(const DebuggerIPCEvent * pManagedEvent) { #if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(useTransport) - { - HRESULT hr = g_pDbgTransport->SendDebugEvent(const_cast<DebuggerIPCEvent *>(pManagedEvent)); + HRESULT hr = g_pDbgTransport->SendDebugEvent(const_cast<DebuggerIPCEvent *>(pManagedEvent)); - if (FAILED(hr)) - { - _ASSERTE(!"Failed to send debugger event"); + if (FAILED(hr)) + { + _ASSERTE(!"Failed to send debugger event"); - STRESS_LOG1(LF_CORDB, LL_INFO1000, "D::SendIPCEvent Error on Send with 0x%x\n", hr); - UnrecoverableError(hr, - 0, - FILE_DEBUG, - LINE_DEBUG, - false); + STRESS_LOG1(LF_CORDB, LL_INFO1000, "D::SendIPCEvent Error on Send with 0x%x\n", hr); + UnrecoverableError(hr, + 0, + FILE_DEBUG, + LINE_DEBUG, + false); - // @dbgtodo Mac - what can we do here? - } + // @dbgtodo Mac - what can we do here? } - else +#else + // We get to send an array of ULONG_PTRs as data with the notification. + // The debugger can then use ReadProcessMemory to read through this array. + ULONG_PTR rgData [] = { + CLRDBG_EXCEPTION_DATA_CHECKSUM, + (ULONG_PTR) g_pMSCorEE, + (ULONG_PTR) pManagedEvent + }; + + // If no debugger attached, then don't bother raising a 1st-chance exception because nobody will sniff it. + // @dbgtodo iDNA: in iDNA case, the recorder may sniff it. + if (!IsDebuggerPresent()) { -#endif - // We get to send an array of ULONG_PTRs as data with the notification. - // The debugger can then use ReadProcessMemory to read through this array. - ULONG_PTR rgData [] = { - CLRDBG_EXCEPTION_DATA_CHECKSUM, - (ULONG_PTR) g_pMSCorEE, - (ULONG_PTR) pManagedEvent - }; - - // If no debugger attached, then don't bother raising a 1st-chance exception because nobody will sniff it. - // @dbgtodo iDNA: in iDNA case, the recorder may sniff it. - if (!IsDebuggerPresent()) - { - return; - } - - // - // Physically send the event via an OS Exception. We're using exceptions as a notification - // mechanism on top of the OS native debugging pipeline. - // @dbgtodo cross-plat - this needs to be cross-plat. - // - EX_TRY - { - const DWORD dwFlags = 0; // continuable (eg, Debugger can continue GH) - RaiseException(CLRDBG_NOTIFICATION_EXCEPTION_CODE, dwFlags, NumItems(rgData), rgData); + return; + } - // If debugger continues "GH" (DBG_CONTINUE), then we land here. - // This is the expected path for a well-behaved ICorDebug debugger. - } - EX_CATCH - { - // If no debugger is attached, or if the debugger continues "GN" (DBG_EXCEPTION_NOT_HANDLED), then we land here. - // A naive (not-ICorDebug aware) native-debugger won't handle the exception and so land us here. - // We may also get here if a debugger detaches at the Exception notification - // (and thus implicitly continues GN). - } - EX_END_CATCH(SwallowAllExceptions); + // + // Physically send the event via an OS Exception. We're using exceptions as a notification + // mechanism on top of the OS native debugging pipeline. + // @dbgtodo cross-plat - this needs to be cross-plat. + // + EX_TRY + { + const DWORD dwFlags = 0; // continuable (eg, Debugger can continue GH) + RaiseException(CLRDBG_NOTIFICATION_EXCEPTION_CODE, dwFlags, NumItems(rgData), rgData); -#ifdef FEATURE_DBGIPC_TRANSPORT_VM + // If debugger continues "GH" (DBG_CONTINUE), then we land here. + // This is the expected path for a well-behaved ICorDebug debugger. + } + EX_CATCH + { + // If no debugger is attached, or if the debugger continues "GN" (DBG_EXCEPTION_NOT_HANDLED), then we land here. + // A naive (not-ICorDebug aware) native-debugger won't handle the exception and so land us here. + // We may also get here if a debugger detaches at the Exception notification + // (and thus implicitly continues GN). } + EX_END_CATCH(SwallowAllExceptions); #endif // FEATURE_DBGIPC_TRANSPORT_VM } @@ -1992,15 +1977,9 @@ HRESULT Debugger::Startup(void) // Iff the debug pack is installed, then go through the telesto debugging pipeline. LOG((LF_CORDB, LL_INFO10, "Debugging service is enabled because debug pack is installed or Watson support is enabled)\n")); -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) - { -#endif - // This may block while an attach occurs. - NotifyDebuggerOfTelestoStartup(); -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + // This may block while an attach occurs. + NotifyDebuggerOfTelestoStartup(); #endif } else @@ -2102,86 +2081,32 @@ HRESULT Debugger::Startup(void) _ASSERTE(SUCCEEDED(hr)); // throws on error #if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(useTransport) - { - // The in-process DAC for Mac is lazily initialized when we get the first DDMessage. - // We check whether the DAC and the runtime has matching versions when we do the initialization, and - // we'll fail if the versions don't match. That's why we don't want to do the initialization here because - // even if we have the wrong version of DAC, managed apps can still run. We just can't debug it. - - // Create transport control block and initialize it. - g_pDbgTransport = new DbgTransportSession(); - hr = g_pDbgTransport->Init(m_pRCThread->GetDCB(), m_pAppDomainCB, &m_inProcDac); - if (FAILED(hr)) - ThrowHR(hr); - - // Create interface to talk to debugger proxy and initialize it. - DbgTransportProxy *pProxy = new DbgTransportProxy(); - hr = pProxy->Init(g_pDbgTransport->GetPort()); - if (FAILED(hr)) - ThrowHR(hr); - - // Contact the debugger proxy process for this machine. This has several purposes: - // 1) Register this runtime instance as available for debugging. - // 2) Check whether a debugger is already waiting to attach to us. - // 3) Publish the port number we expect debugging requests to target. - // The following call blocks until we receive a reply from the proxy or time out. - DbgProxyResult result = pProxy->RegisterWithProxy(); - switch (result) - { - case RequestTimedOut: - // The proxy doesn't appear to be there, we're not debuggable as a result. - // To be careful (and avoid malicious types trying to connect to us even when the proxy is not up) - // neuter the transport so that it won't accept any connections. Ideally we'd just shutdown the - // debugger subsystem entirely, but this appears to be somewhat complex at this late stage. - g_pDbgTransport->Neuter(); - break; - case RequestSuccessful: - // We registered with the proxy successfully. No debugger was interested in - // us just yet. - break; - case PendingDebuggerAttach: - // We registered with the proxy and found that a debugger was registered for - // an early attach. - - // Mark this process as launched by the debugger and the debugger as attached. - g_CORDebuggerControlFlags |= DBCF_GENERATE_DEBUG_CODE; - MarkDebuggerAttachedInternal(); - - LazyInit(); - DebuggerController::Initialize(); - break; - default: - _ASSERTE(!"Unknown result code from DbgTransportSession::RegisterWithProxy()"); - } - - // The debugger no longer needs to talk with the proxy. - pProxy->Shutdown(); - delete pProxy; - } + // Create transport session and initialize it. + g_pDbgTransport = new DbgTransportSession(); + hr = g_pDbgTransport->Init(m_pRCThread->GetDCB(), m_pAppDomainCB); + if (FAILED(hr)) + ThrowHR(hr); + + bool waitForAttach = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgWaitForDebuggerAttach) != 0; + if (waitForAttach) + { + // Mark this process as launched by the debugger and the debugger as attached. + g_CORDebuggerControlFlags |= DBCF_GENERATE_DEBUG_CODE; + MarkDebuggerAttachedInternal(); + + LazyInit(); + DebuggerController::Initialize(); + } #endif // FEATURE_DBGIPC_TRANSPORT_VM RaiseStartupNotification(); // Also initialize the AppDomainEnumerationIPCBlock -#if defined(FEATURE_IPCMAN) -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(useTransport) - { - m_pAppDomainCB = new (nothrow) AppDomainEnumerationIPCBlock(); - } - else - { -#endif - m_pAppDomainCB = g_pIPCManagerInterface->GetAppDomainBlock(); -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - } -#endif -#else // FEATURE_IPCMAN +#if !defined(FEATURE_IPCMAN) || defined(FEATURE_DBGIPC_TRANSPORT_VM) m_pAppDomainCB = new (nothrow) AppDomainEnumerationIPCBlock(); -#endif // FEATURE_IPCMAN +#else + m_pAppDomainCB = g_pIPCManagerInterface->GetAppDomainBlock(); +#endif if (m_pAppDomainCB == NULL) { @@ -5551,19 +5476,13 @@ void Debugger::TrapAllRuntimeThreads() } CONTRACTL_END; -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + // Only sync if RS requested it. + if (!m_RSRequestedSync) { -#endif - // Only sync if RS requested it. - if (!m_RSRequestedSync) - { - return; - } - m_RSRequestedSync = FALSE; -#ifdef FEATURE_DBGIPC_TRANSPORT_VM + return; } + m_RSRequestedSync = FALSE; #endif // If we're doing shutdown, then don't bother trying to communicate w/ the RS. diff --git a/src/debug/ee/debugger.h b/src/debug/ee/debugger.h index 41ff93d16f..6f71b5c74a 100644 --- a/src/debug/ee/debugger.h +++ b/src/debug/ee/debugger.h @@ -49,7 +49,6 @@ #include "dllimportcallback.h" #include "canary.h" -#include "inprocdac.h" #undef ASSERT #define CRASH(x) _ASSERTE(!x) @@ -836,17 +835,9 @@ private: DebuggerIPCEvent * GetRCThreadReceiveBuffer() { #if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(useTransport) - { - return reinterpret_cast<DebuggerIPCEvent *>(&m_receiveBuffer[0]); - } - else - { -#endif // FEATURE_DBGIPC_TRANSPORT_VM - return reinterpret_cast<DebuggerIPCEvent *>(&m_pDCB->m_receiveBuffer[0]); -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } + return reinterpret_cast<DebuggerIPCEvent *>(&m_receiveBuffer[0]); +#else + return reinterpret_cast<DebuggerIPCEvent *>(&m_pDCB->m_receiveBuffer[0]); #endif } @@ -855,17 +846,9 @@ private: DebuggerIPCEvent * GetRCThreadSendBuffer() { #if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(useTransport) - { - return reinterpret_cast<DebuggerIPCEvent *>(&m_sendBuffer[0]); - } - else - { -#endif // FEATURE_DBGIPC_TRANSPORT_VM - return reinterpret_cast<DebuggerIPCEvent *>(&m_pDCB->m_sendBuffer[0]); -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } + return reinterpret_cast<DebuggerIPCEvent *>(&m_sendBuffer[0]); +#else // FEATURE_DBGIPC_TRANSPORT_VM + return reinterpret_cast<DebuggerIPCEvent *>(&m_pDCB->m_sendBuffer[0]); #endif // FEATURE_DBGIPC_TRANSPORT_VM } @@ -2805,11 +2788,6 @@ private: PTR_DebuggerLazyInit m_pLazyData; -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - InProcDac m_inProcDac; -#endif // FEATURE_DBGIPC_TRANSPORT_VM - - // A list of all defines that affect layout of MD types typedef enum _Target_Defines diff --git a/src/debug/ee/inprocdac.cpp b/src/debug/ee/inprocdac.cpp deleted file mode 100644 index e451cf08bb..0000000000 --- a/src/debug/ee/inprocdac.cpp +++ /dev/null @@ -1,432 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// -//***************************************************************************** -// File: InProcDac.cpp -// - -// -// -// -//***************************************************************************** - -#include "stdafx.h" - -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - -#include "inprocdac.h" -#include "dacdbiinterface.h" -#include "cordebug.h" -#include "metadata.h" - -InProcDac::InProcDac() : - m_pDacDbi(NULL), - m_pUnpacker(NULL) -{ -} - -InProcDac::~InProcDac() -{ - Cleanup(); -} - -// -// Debugger::InitializeDAC -// -// DAC is used in-process on the Mac and ARM devices. -// This is similar to CordbProcess::CreateDacDbiInterface on Windows. -// @dbgtodo : try and share some of this code with the RS equivalent? -// -void InProcDac::Initialize() -{ - CONTRACTL - { - THROWS; - } - CONTRACTL_END; - - // don't double-init - _ASSERTE(m_pDataTarget == NULL); - _ASSERTE(m_pDacDbi == NULL); - _ASSERTE(m_pUnpacker == NULL); - - HRESULT hrStatus = S_OK; - HModuleHolder hDacDll; - - // - // Load the access DLL from the same directory as the the current CLR DLL. - // - WCHAR wszRuntimePath[MAX_PATH]; // base directory of the runtime (including trailing /) - WCHAR wszAccessDllPath[MAX_PATH]; // full path to the DAC Dll - - if (!WszGetModuleFileName(GetCLRModule(), wszRuntimePath, NumItems(wszRuntimePath))) - { - ThrowLastError(); - } - - const char pathSep = '\\'; - - // remove CLR filename - PWSTR pPathTail = wcsrchr(wszRuntimePath, pathSep); - if (!pPathTail) - { - ThrowHR(E_INVALIDARG); - } - pPathTail[1] = '\0'; - - // In the case where this function is called multiple times, save the module handle to the DAC shared - // library so that we won't try to free and load it multiple times. - if (m_hDacModule == NULL) - { - if (wcscpy_s(wszAccessDllPath, _countof(wszAccessDllPath), wszRuntimePath) || - wcscat_s(wszAccessDllPath, _countof(wszAccessDllPath), MAKEDLLNAME_W(MAIN_DAC_MODULE_NAME_W))) - { - ThrowHR(E_INVALIDARG); - } - - hDacDll.Assign(WszLoadLibrary(wszAccessDllPath)); - if (!hDacDll) - { - CONSISTENCY_CHECK_MSGF(false,("Unable to find DAC dll: %s", wszAccessDllPath)); - - DWORD dwLastError = GetLastError(); - if (dwLastError == ERROR_MOD_NOT_FOUND) - { - // Give a more specific error in the case where we can't find the DAC dll. - ThrowHR(CORDBG_E_DEBUG_COMPONENT_MISSING); - } - else - { - ThrowWin32(dwLastError); - } - } - - // Succeeded. Now copy out. - m_hDacModule.Assign(hDacDll); - hDacDll.SuppressRelease(); - } - - // Create the data target - ReleaseHolder<InProcDataTarget> pDataTarget = new InProcDataTarget(); - - // - // Get the access interface, passing our callback interfaces (data target, and metadata lookup) - // - - IDacDbiInterface::IMetaDataLookup * pMetaDataLookup = this; - IDacDbiInterface::IAllocator * pAllocator = this; - - // Get the CLR instance ID - the base address of the CLR module - CORDB_ADDRESS clrInstanceId = reinterpret_cast<CORDB_ADDRESS>(GetCLRModule()); - - typedef HRESULT (STDAPICALLTYPE * PFN_DacDbiInterfaceInstance)( - ICorDebugDataTarget *, - CORDB_ADDRESS, - IDacDbiInterface::IAllocator *, - IDacDbiInterface::IMetaDataLookup *, - IDacDbiInterface **); - - IDacDbiInterface* pInterfacePtr = NULL; - PFN_DacDbiInterfaceInstance pfnEntry = (PFN_DacDbiInterfaceInstance) - GetProcAddress(m_hDacModule, "DacDbiInterfaceInstance"); - - if (!pfnEntry) - { - ThrowLastError(); - } - - hrStatus = pfnEntry(pDataTarget, clrInstanceId, - pAllocator, pMetaDataLookup, &pInterfacePtr); - IfFailThrow(hrStatus); - - // We now have a resource, pInterfacePtr, that needs to be freed. - - m_pDacDbi = pInterfacePtr; - m_pDataTarget = pDataTarget.Extract(); - - // Enable DAC target consistency checking - we're in-proc and so better always be consistent - m_pDacDbi->DacSetTargetConsistencyChecks( true ); - m_pUnpacker = new DDUnpack(pInterfacePtr, pAllocator); // throws -} - -void InProcDac::Cleanup() -{ - CONTRACTL - { - NOTHROW; // backout code. - } - CONTRACTL_END; - - if (m_pDacDbi != NULL) - { - m_pDacDbi->Destroy(); - m_pDacDbi = NULL; - } - - if(m_pUnpacker != NULL) - { - delete m_pUnpacker; - m_pUnpacker = NULL; - } - - if (m_pDataTarget != NULL) - { - m_pDataTarget.Clear(); - } - - // Note that once we release this handle, the DAC module can be unloaded and all calls - // into DAC could be invalid. - if (m_hDacModule != NULL) - { - m_hDacModule.Clear(); - } -} - -HRESULT InProcDac::DoRequest(ReadBuffer * pSend, WriteBuffer * pResult) -{ - HRESULT hr = S_OK; - - // Lazily initialize the DacDbiMarshalStub. - if (m_pDacDbi == NULL) - { - EX_TRY - { - Initialize(); - } - EX_CATCH_HRESULT(hr); - IfFailRet(hr); - } - - _ASSERTE(m_pDacDbi != NULL); - - /* - * @dbgtodo : We have to make sure to call Flush whenever runtime data structures may have changed. - * Eg: - * - after every IPC event - * - whenever we suspend the process - * For now we rely on the RS to tell us when to flush, just like the Windows runtime. It's a little riskier - * in this case because the target is actually running code. Since the cost of copying locally is fairly - * low, it is probably best to just flush at the beginning and/or end of all DD requests (i.e. here). - * Flushing more that necessary may be best for performance. - * Note however that this could in theory expose lateng bugs where we've been getting away with bleeding - * DAC state across DD calls on Windows. - */ - EX_TRY - { - m_pUnpacker->HandleDDMessage(pSend, pResult); - } - EX_CATCH_HRESULT(hr); - return hr; -} - -#ifndef DACCESS_COMPILE -IMDInternalImport * InProcDac::LookupMetaData(VMPTR_PEFile addressPEFile, bool &isILMetaDataForNGENImage) -{ - isILMetaDataForNGENImage = false; - PEFile* peFile = addressPEFile.GetRawPtr(); - return peFile->GetPersistentMDImport(); -} -#endif -//*************************************************************** -// InProcDataTarget implementation -//*************************************************************** - -// -// InProcDataTarget ctor -// -// Instantiate an InProcDataTarget -// -InProcDac::InProcDataTarget::InProcDataTarget() : - m_ref(0) -{ -} - -// -// InProcDataTarget dtor -// -// -InProcDac::InProcDataTarget::~InProcDataTarget() -{ -} - -// Standard impl of IUnknown::QueryInterface -HRESULT STDMETHODCALLTYPE -InProcDac::InProcDataTarget::QueryInterface( - REFIID InterfaceId, - PVOID* pInterface) -{ - if (InterfaceId == IID_IUnknown) - { - *pInterface = static_cast<IUnknown *>(static_cast<ICorDebugDataTarget *>(this)); - } - else if (InterfaceId == IID_ICorDebugDataTarget) - { - *pInterface = static_cast<ICorDebugDataTarget *>(this); - } - else if (InterfaceId == IID_ICorDebugMutableDataTarget) - { - *pInterface = static_cast<ICorDebugMutableDataTarget *>(this); - } - else - { - *pInterface = NULL; - return E_NOINTERFACE; - } - - AddRef(); - return S_OK; -} - -// Standard impl of IUnknown::AddRef -ULONG STDMETHODCALLTYPE -InProcDac::InProcDataTarget::AddRef() -{ - LONG ref = InterlockedIncrement(&m_ref); - return ref; -} - -// Standard impl of IUnknown::Release -ULONG STDMETHODCALLTYPE -InProcDac::InProcDataTarget::Release() -{ - LONG ref = InterlockedDecrement(&m_ref); - if (ref == 0) - { - delete this; - } - return ref; -} - -// impl of interface method ICorDebugDataTarget::GetPlatform -HRESULT STDMETHODCALLTYPE -InProcDac::InProcDataTarget::GetPlatform( - CorDebugPlatform * pPlatform) -{ -#if defined(_TARGET_X86_) - *pPlatform = CORDB_PLATFORM_WINDOWS_X86; -#elif defined(_TARGET_AMD64_) - *pPlatform = CORDB_PLATFORM_WINDOWS_AMD64; -#elif defined(_TARGET_ARM_) - *pPlatform = CORDB_PLATFORM_WINDOWS_ARM; -#else -#error Unknown Processor. -#endif // platform - - return S_OK; -} - -// impl of interface method ICorDebugDataTarget::ReadVirtual -HRESULT STDMETHODCALLTYPE -InProcDac::InProcDataTarget::ReadVirtual( - CORDB_ADDRESS address, - PBYTE pBuffer, - ULONG32 cbRequestSize, - ULONG32 * pcbRead) -{ - void * pSrc = reinterpret_cast<void*>(address); - memcpy(pBuffer, pSrc, cbRequestSize); - if (pcbRead != NULL) - { - *pcbRead = cbRequestSize; - } - return S_OK; -} - -// impl of interface method ICorDebugMutableDataTarget::WriteVirtual -HRESULT STDMETHODCALLTYPE -InProcDac::InProcDataTarget::WriteVirtual( - CORDB_ADDRESS address, - const BYTE * pBuffer, - ULONG32 cbRequestSize) -{ - void * pDst = reinterpret_cast<void*>(address); - memcpy(pDst, pBuffer, cbRequestSize); - return S_OK; -} - - -// impl of interface method ICorDebugDataTarget::GetThreadContext -HRESULT STDMETHODCALLTYPE -InProcDac::InProcDataTarget::GetThreadContext( - DWORD dwThreadID, - ULONG32 contextFlags, - ULONG32 contextSize, - PBYTE pContext) -{ - if (contextSize < sizeof(CONTEXT)) - { - return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - - HandleHolder hThread = ::OpenThread(THREAD_GET_CONTEXT, FALSE, dwThreadID); - if (hThread == NULL) - { - return HRESULT_FROM_GetLastError(); - } - - // This assumes pContext is appropriately aligned. - CONTEXT * pCtx = reinterpret_cast<CONTEXT*>(pContext); - pCtx->ContextFlags = contextFlags; - if (!::GetThreadContext(hThread, pCtx)) - { - return HRESULT_FROM_GetLastError(); - } - - return S_OK; -} - -// impl of interface method ICorDebugMutableDataTarget::SetThreadContext -HRESULT STDMETHODCALLTYPE -InProcDac::InProcDataTarget::SetThreadContext( - DWORD dwThreadID, - ULONG32 contextSize, - const BYTE * pContext) -{ - if (contextSize < sizeof(CONTEXT)) - { - return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); - } - - HandleHolder hThread = ::OpenThread(THREAD_SET_CONTEXT, FALSE, dwThreadID); - if (hThread == NULL) - { - return HRESULT_FROM_GetLastError(); - } - - // This assumes pContext is appropriately aligned. - const CONTEXT * pCtx = reinterpret_cast<const CONTEXT*>(pContext); - if (!::SetThreadContext(hThread,pCtx)) - { - return HRESULT_FROM_GetLastError(); - } - - return S_OK; -} - -// implementation of ICorDebugMutableDataTarget::ContinueStatusChanged -HRESULT STDMETHODCALLTYPE -InProcDac::InProcDataTarget::ContinueStatusChanged( - DWORD dwThreadId, - CORDB_CONTINUE_STATUS continueStatus) -{ - return E_NOTIMPL; -} - -#ifndef DACCESS_COMPILE - -// Trivial implementation for IDacDbiInterface::IAllocator methods -void * InProcDac::Alloc(SIZE_T lenBytes) -{ - return new BYTE[lenBytes]; -} - -void InProcDac::Free(void * p) -{ - BYTE* pB = static_cast<BYTE*>(p); - delete[] pB; -} - -#endif //!DACCESS_COMPILE - -#endif //FEATURE_DBGIPC_TRANSPORT_VM diff --git a/src/debug/ee/inprocdac.h b/src/debug/ee/inprocdac.h deleted file mode 100644 index 408159d12a..0000000000 --- a/src/debug/ee/inprocdac.h +++ /dev/null @@ -1,157 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// -//***************************************************************************** -// File: InProcDac.h -// - -// -//***************************************************************************** - -#ifndef _INPROCDAC_H -#define _INPROCDAC_H - -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) -#include "dacdbiinterface.h" -#include "cordebug.h" -#include "xcordebug.h" - -#ifndef DACCESS_COMPILE -#include "ddunpack.h" -#endif - -class IDacDbiMarshalStub; -class ReadBuffer; -class WriteBuffer; - -// -// InProcDac is a helper class used by the Debugger class to make DAC and -// the IDacDbiInterface available from within process. -// This is done on the Macintosh because we don't have OS support for our -// normal out-of-process access (eg. VM read as non-root user). -// -// Note that we don't ever actually use this in DACCESS_COMPILE builds - it's -// implementation is compiled into just mscorwks, but the callbacks (data target -// and IMetaDataLookup) are called from mscordacwks. We need the declaration -// visible in DACCESS_COMPILE builds because a field of this type is contained -// by-value in the Debugger class, and so we need the correct size for field -// layout. -// -class InProcDac - : private IDacDbiInterface::IMetaDataLookup, - private IDacDbiInterface::IAllocator -{ -public: - InProcDac() DAC_EMPTY(); - ~InProcDac() DAC_EMPTY(); - - void Initialize(); - void Cleanup(); - - // This takes a marshalled version of a DD interface request - HRESULT DoRequest(ReadBuffer * pSend, WriteBuffer * pResult); - -private: - - // IMetaDataLookup methods - virtual IMDInternalImport * LookupMetaData(VMPTR_PEFile addressPEFile, bool &isILMetaDataForNGENImage); - - // - // IAllocator interfaces - // - virtual void * Alloc(SIZE_T lenBytes) DAC_EMPTY_RET(NULL); - - virtual void Free(void * p) DAC_EMPTY(); - - class InProcDataTarget : - public ICorDebugMutableDataTarget - { - public: - InProcDataTarget(); - virtual ~InProcDataTarget(); - - // IUnknown. - virtual HRESULT STDMETHODCALLTYPE QueryInterface( - REFIID riid, - void** ppInterface); - - virtual ULONG STDMETHODCALLTYPE AddRef(); - - virtual ULONG STDMETHODCALLTYPE Release(); - - // ICorDebugMutableDataTarget. - virtual HRESULT STDMETHODCALLTYPE GetPlatform( - CorDebugPlatform *pPlatform); - - virtual HRESULT STDMETHODCALLTYPE ReadVirtual( - CORDB_ADDRESS address, - PBYTE pBuffer, - ULONG32 request, - ULONG32 *pcbRead); - - virtual HRESULT STDMETHODCALLTYPE WriteVirtual( - CORDB_ADDRESS address, - const BYTE * pBuffer, - ULONG32 request); - - virtual HRESULT STDMETHODCALLTYPE GetThreadContext( - DWORD dwThreadID, - ULONG32 contextFlags, - ULONG32 contextSize, - PBYTE context); - - virtual HRESULT STDMETHODCALLTYPE SetThreadContext( - DWORD dwThreadID, - ULONG32 contextSize, - const BYTE * context); - - virtual HRESULT STDMETHODCALLTYPE ContinueStatusChanged( - DWORD dwThreadId, - CORDB_CONTINUE_STATUS continueStatus); - - private: - LONG m_ref; // Reference count. - }; - - - -private: - // - // InProcDac Fields - // - ReleaseHolder<InProcDataTarget> m_pDataTarget; - HModuleHolder m_hDacModule; -#ifndef DACCESS_COMPILE - IDacDbiInterface * m_pDacDbi; - DDUnpack * m_pUnpacker; -#else - VOID * m_pDacDbi; - VOID * m_pUnpacker; -#endif -}; - - -#ifdef DACCESS_COMPILE -// This method is a funny case for DAC and DacCop. InProcDac isn't used in DACCESS_COMPILE builds at all -// (inprocdac.cpp isn't compiled in DAC builds), but we need the declaration since an instance -// of it is contained by-value in the Debugger class (need to know the right size so field layout -// matches the target). The LookupMetadata function is called from DAC, and so DacCop searches -// for all implementations of it in mscordacwks.dll and find this one (the real one is either in -// mscordbi.dll or coreclr which DacCop doesn't analyze). We need an implementation of virtual -// methods for the DACCESS_COMPILE build, but rather than use the usual DAC_EMPTY macros we'll -// use this explicit implementation here to avoid a DacCop violation. -inline IMDInternalImport * InProcDac::LookupMetaData(VMPTR_PEFile addressPEFile, bool &isILMetaDataForNGENImage) -{ - SUPPORTS_DAC; // not really - but we should never be called - _ASSERTE_MSG(false, "This implementation should never be called in DAC builds"); - DacError(E_UNEXPECTED); - return NULL; -} -#endif // DACCESS_COMPILE - - - -#endif // FEATURE_DBGIPC_TRANSPORT_VM - -#endif //_INPROCDAC_H diff --git a/src/debug/ee/rcthread.cpp b/src/debug/ee/rcthread.cpp index 7e6f1ae304..896db99884 100644 --- a/src/debug/ee/rcthread.cpp +++ b/src/debug/ee/rcthread.cpp @@ -305,27 +305,21 @@ HRESULT DebuggerIPCControlBlock::Init( m_bHostingInFiber = true; } -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + // Copy RSEA and RSER into the control block. + if (!m_rightSideEventAvailable.SetLocal(hRsea)) { -#endif - // Copy RSEA and RSER into the control block. - if (!m_rightSideEventAvailable.SetLocal(hRsea)) - { - ThrowLastError(); - } + ThrowLastError(); + } - if (!m_rightSideEventRead.SetLocal(hRser)) - { - ThrowLastError(); - } + if (!m_rightSideEventRead.SetLocal(hRser)) + { + ThrowLastError(); + } - if (!m_leftSideUnmanagedWaitEvent.SetLocal(hLsuwe)) - { - ThrowLastError(); - } -#ifdef FEATURE_DBGIPC_TRANSPORT_VM + if (!m_leftSideUnmanagedWaitEvent.SetLocal(hLsuwe)) + { + ThrowLastError(); } #endif // !FEATURE_DBGIPC_TRANSPORT_VM @@ -420,78 +414,71 @@ HRESULT DebuggerRCThread::Init(void) HRESULT hr; #if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) + + if (m_pDCB) { -#endif - IPCHostSecurityAttributeHolder sa(GetCurrentProcessId()); + hr = m_pDCB->Init(NULL, NULL, NULL, NULL, NULL); + _ASSERTE(SUCCEEDED(hr)); // throws on error. + } +#else //FEATURE_DBGIPC_TRANSPORT_VM - // Create the events that the thread will need to receive events - // from the out of process piece on the right side. - // We will not fail out if CreateEvent fails for RSEA or RSER. Because - // the worst case is that debugger cannot attach to debuggee. - // - HandleHolder rightSideEventAvailable(WszCreateEvent(sa.GetHostSA(), (BOOL) kAutoResetEvent, FALSE, NULL)); + IPCHostSecurityAttributeHolder sa(GetCurrentProcessId()); - // Security fix: - // We need to check the last error to see if the event was precreated or not - // If so, we need to release the handle right now. - // - dwStatus = GetLastError(); - if (dwStatus == ERROR_ALREADY_EXISTS) - { - // clean up the handle now - rightSideEventAvailable.Clear(); - } + // Create the events that the thread will need to receive events + // from the out of process piece on the right side. + // We will not fail out if CreateEvent fails for RSEA or RSER. Because + // the worst case is that debugger cannot attach to debuggee. + // + HandleHolder rightSideEventAvailable(WszCreateEvent(sa.GetHostSA(), (BOOL) kAutoResetEvent, FALSE, NULL)); - HandleHolder rightSideEventRead(WszCreateEvent(sa.GetHostSA(), (BOOL) kAutoResetEvent, FALSE, NULL)); + // Security fix: + // We need to check the last error to see if the event was precreated or not + // If so, we need to release the handle right now. + // + dwStatus = GetLastError(); + if (dwStatus == ERROR_ALREADY_EXISTS) + { + // clean up the handle now + rightSideEventAvailable.Clear(); + } - // Security fix: - // We need to check the last error to see if the event was precreated or not - // If so, we need to release the handle right now. - // - dwStatus = GetLastError(); - if (dwStatus == ERROR_ALREADY_EXISTS) - { - // clean up the handle now - rightSideEventRead.Clear(); - } + HandleHolder rightSideEventRead(WszCreateEvent(sa.GetHostSA(), (BOOL) kAutoResetEvent, FALSE, NULL)); + // Security fix: + // We need to check the last error to see if the event was precreated or not + // If so, we need to release the handle right now. + // + dwStatus = GetLastError(); + if (dwStatus == ERROR_ALREADY_EXISTS) + { + // clean up the handle now + rightSideEventRead.Clear(); + } - HandleHolder leftSideUnmanagedWaitEvent(CreateWin32EventOrThrow(NULL, kManualResetEvent, FALSE)); - // Copy RSEA and RSER into the control block only if shared memory is created without error. - if (m_pDCB) - { - // Since Init() gets ownership of handles as soon as it's called, we can - // release our ownership now. - rightSideEventAvailable.SuppressRelease(); - rightSideEventRead.SuppressRelease(); - leftSideUnmanagedWaitEvent.SuppressRelease(); - - // NOTE: initialization of the debugger control block occurs partly on the left side and partly on - // the right side. This initialization occurs in parallel, so it's unsafe to make assumptions about - // the order in which the fields will be initialized. - hr = m_pDCB->Init(rightSideEventAvailable, - rightSideEventRead, - NULL, - NULL, - leftSideUnmanagedWaitEvent); - - _ASSERTE(SUCCEEDED(hr)); // throws on error. - } + HandleHolder leftSideUnmanagedWaitEvent(CreateWin32EventOrThrow(NULL, kManualResetEvent, FALSE)); -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } - else + // Copy RSEA and RSER into the control block only if shared memory is created without error. + if (m_pDCB) { - if (m_pDCB) - { - hr = m_pDCB->Init(NULL, NULL, NULL, NULL, NULL); - _ASSERTE(SUCCEEDED(hr)); // throws on error. - } + // Since Init() gets ownership of handles as soon as it's called, we can + // release our ownership now. + rightSideEventAvailable.SuppressRelease(); + rightSideEventRead.SuppressRelease(); + leftSideUnmanagedWaitEvent.SuppressRelease(); + + // NOTE: initialization of the debugger control block occurs partly on the left side and partly on + // the right side. This initialization occurs in parallel, so it's unsafe to make assumptions about + // the order in which the fields will be initialized. + hr = m_pDCB->Init(rightSideEventAvailable, + rightSideEventRead, + NULL, + NULL, + leftSideUnmanagedWaitEvent); + + _ASSERTE(SUCCEEDED(hr)); // throws on error. } -#endif +#endif //FEATURE_DBGIPC_TRANSPORT_VM if(m_pDCB) { @@ -751,7 +738,7 @@ HRESULT DebuggerRCThread::SetupRuntimeOffsets(DebuggerIPCControlBlock * pDebugge #if !defined(FEATURE_CORESYSTEM) // Grab the address of RaiseException in kernel32 because we have to play some games with exceptions // that are generated there (just another reason why mixed mode debugging is shady). See bug 476768. - HMODULE hModule = WszGetModuleHandle(W("kernel32.dll")); + HMODULE hModule = WszGetModuleHandle(W("kernel32.dll")); _ASSERTE(hModule != NULL); PREFAST_ASSUME(hModule != NULL); pDebuggerRuntimeOffsets->m_raiseExceptionAddr = GetProcAddress(hModule, "RaiseException"); @@ -1060,14 +1047,8 @@ void DebuggerRCThread::RightSideDetach(void) { _ASSERTE( m_fDetachRightSide == false ); m_fDetachRightSide = true; -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) - { -#endif - CloseIPCHandles(); -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + CloseIPCHandles(); #endif // !FEATURE_DBGIPC_TRANSPORT_VM } @@ -1127,53 +1108,40 @@ bool DebuggerRCThread::HandleRSEA() LOG((LF_CORDB,LL_INFO10000, "RSEA from out of process (right side)\n")); DebuggerIPCEvent * e; -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) - { -#endif - // Make room for any Right Side event on the stack. - BYTE buffer[CorDBIPC_BUFFER_SIZE]; - e = (DebuggerIPCEvent *) buffer; +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + // Make room for any Right Side event on the stack. + BYTE buffer[CorDBIPC_BUFFER_SIZE]; + e = (DebuggerIPCEvent *) buffer; - // If the RSEA is signaled, then handle the event from the Right Side. - memcpy(e, GetIPCEventReceiveBuffer(), CorDBIPC_BUFFER_SIZE); -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } - else - { - // Be sure to fetch the event into the official receive buffer since some event handlers assume it's there - // regardless of the the event buffer pointer passed to them. - e = GetIPCEventReceiveBuffer(); - g_pDbgTransport->GetNextEvent(e, CorDBIPC_BUFFER_SIZE); - } + // If the RSEA is signaled, then handle the event from the Right Side. + memcpy(e, GetIPCEventReceiveBuffer(), CorDBIPC_BUFFER_SIZE); +#else + // Be sure to fetch the event into the official receive buffer since some event handlers assume it's there + // regardless of the the event buffer pointer passed to them. + e = GetIPCEventReceiveBuffer(); + g_pDbgTransport->GetNextEvent(e, CorDBIPC_BUFFER_SIZE); #endif // !FEATURE_DBGIPC_TRANSPOPRT -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - if(!useTransport) - { -#endif - // If no reply is required, then let the Right Side go since we've got a copy of the event now. - _ASSERTE(!e->asyncSend || !e->replyRequired); +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + // If no reply is required, then let the Right Side go since we've got a copy of the event now. + _ASSERTE(!e->asyncSend || !e->replyRequired); - if (!e->replyRequired && !e->asyncSend) - { - LOG((LF_CORDB, LL_INFO1000, "DRCT::ML: no reply required, letting Right Side go.\n")); + if (!e->replyRequired && !e->asyncSend) + { + LOG((LF_CORDB, LL_INFO1000, "DRCT::ML: no reply required, letting Right Side go.\n")); - BOOL succ = SetEvent(m_pDCB->m_rightSideEventRead); + BOOL succ = SetEvent(m_pDCB->m_rightSideEventRead); - if (!succ) - CORDBDebuggerSetUnrecoverableWin32Error(m_debugger, 0, true); - } + if (!succ) + CORDBDebuggerSetUnrecoverableWin32Error(m_debugger, 0, true); + } #ifdef LOGGING - else if (e->asyncSend) - LOG((LF_CORDB, LL_INFO1000, "DRCT::ML: async send.\n")); - else - LOG((LF_CORDB, LL_INFO1000, "DRCT::ML: reply required, holding Right Side...\n")); + else if (e->asyncSend) + LOG((LF_CORDB, LL_INFO1000, "DRCT::ML: async send.\n")); + else + LOG((LF_CORDB, LL_INFO1000, "DRCT::ML: reply required, holding Right Side...\n")); #endif -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } -#endif // FEATURE_DBGIPC_TRANSPORT_VM +#endif // !FEATURE_DBGIPC_TRANSPORT_VM // Pass the event to the debugger for handling. Returns true if the event was a Continue event and we can // stop looking for stragglers. We wrap this whole thing in an exception handler to help us debug faults. @@ -1227,18 +1195,10 @@ void DebuggerRCThread::MainLoop() DWORD dwWaitTimeout = INFINITE; rghWaitSet[DRCT_CONTROL_EVENT] = m_threadControlEvent; rghWaitSet[DRCT_FAVORAVAIL] = GetFavorAvailableEvent(); -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) - { -#endif // !FEATURE_DBGIPC_TRANSPORT_VM - rghWaitSet[DRCT_RSEA] = m_pDCB->m_rightSideEventAvailable; -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } - else - { - rghWaitSet[DRCT_RSEA] = g_pDbgTransport->GetIPCEventReadyEvent(); - } +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + rghWaitSet[DRCT_RSEA] = m_pDCB->m_rightSideEventAvailable; +#else + rghWaitSet[DRCT_RSEA] = g_pDbgTransport->GetIPCEventReadyEvent(); #endif // !FEATURE_DBGIPC_TRANSPORT_VM CONTRACT_VIOLATION(ThrowsViolation);// HndCreateHandle throws, and this loop is not backstopped by any EH @@ -1251,38 +1211,28 @@ void DebuggerRCThread::MainLoop() { LOG((LF_CORDB, LL_INFO1000, "DRCT::ML: waiting for event.\n")); -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + // If there is a debugger attached, wait on its handle, too... + if ((cWaitCount == DRCT_COUNT_INITIAL) && + m_pDCB->m_rightSideProcessHandle.ImportToLocalProcess() != NULL) { -#endif // FEATURE_DBGIPC_TRANSPORT_VM - // If there is a debugger attached, wait on its handle, too... - if ((cWaitCount == DRCT_COUNT_INITIAL) && - m_pDCB->m_rightSideProcessHandle.ImportToLocalProcess() != NULL) - { - _ASSERTE((cWaitCount + 1) == DRCT_COUNT_FINAL); - rghWaitSet[DRCT_DEBUGGER_EVENT] = m_pDCB->m_rightSideProcessHandle; - cWaitCount = DRCT_COUNT_FINAL; - } -#ifdef FEATURE_DBGIPC_TRANSPORT_VM + _ASSERTE((cWaitCount + 1) == DRCT_COUNT_FINAL); + rghWaitSet[DRCT_DEBUGGER_EVENT] = m_pDCB->m_rightSideProcessHandle; + cWaitCount = DRCT_COUNT_FINAL; } -#endif // FEATURE_DBGIPC_TRANSPORT_VM +#endif // !FEATURE_DBGIPC_TRANSPORT_VM + if (m_fDetachRightSide) { m_fDetachRightSide = false; -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - if(!useTransport) - { -#endif - _ASSERTE(cWaitCount == DRCT_COUNT_FINAL); - _ASSERTE((cWaitCount - 1) == DRCT_COUNT_INITIAL); +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + _ASSERTE(cWaitCount == DRCT_COUNT_FINAL); + _ASSERTE((cWaitCount - 1) == DRCT_COUNT_INITIAL); - rghWaitSet[DRCT_DEBUGGER_EVENT] = NULL; - cWaitCount = DRCT_COUNT_INITIAL; -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - } + rghWaitSet[DRCT_DEBUGGER_EVENT] = NULL; + cWaitCount = DRCT_COUNT_INITIAL; #endif // !FEATURE_DBGIPC_TRANSPORT_VM } @@ -1491,18 +1441,10 @@ void DebuggerRCThread::TemporaryHelperThreadMainLoop() DWORD dwWaitTimeout = INFINITE; rghWaitSet[DRCT_CONTROL_EVENT] = m_threadControlEvent; rghWaitSet[DRCT_FAVORAVAIL] = GetFavorAvailableEvent(); -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) - { -#endif - rghWaitSet[DRCT_RSEA] = m_pDCB->m_rightSideEventAvailable; -#ifdef FEATURE_DBGIPC_TRANSPORT_VM - } - else - { - rghWaitSet[DRCT_RSEA] = g_pDbgTransport->GetIPCEventReadyEvent(); - } +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + rghWaitSet[DRCT_RSEA] = m_pDCB->m_rightSideEventAvailable; +#else //FEATURE_DBGIPC_TRANSPORT_VM + rghWaitSet[DRCT_RSEA] = g_pDbgTransport->GetIPCEventReadyEvent(); #endif // !FEATURE_DBGIPC_TRANSPORT_VM CONTRACT_VIOLATION(ThrowsViolation);// HndCreateHandle throws, and this loop is not backstopped by any EH @@ -2153,31 +2095,23 @@ HRESULT DebuggerRCThread::SendIPCReply() IPCENames::GetName(event->type))); #endif -#if defined(FEATURE_DBGIPC_TRANSPORT_VM) - DWORD useTransport = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_DbgUseTransport); - if(!useTransport) +#if !defined(FEATURE_DBGIPC_TRANSPORT_VM) + BOOL succ = SetEvent(m_pDCB->m_rightSideEventRead); + if (!succ) { -#endif - BOOL succ = SetEvent(m_pDCB->m_rightSideEventRead); - if (!succ) - { - hr = CORDBDebuggerSetUnrecoverableWin32Error(m_debugger, 0, false); - } -#ifdef FEATURE_DBGIPC_TRANSPORT_VM + hr = CORDBDebuggerSetUnrecoverableWin32Error(m_debugger, 0, false); } - else +#else // !FEATURE_DBGIPC_TRANSPORT_VM + hr = g_pDbgTransport->SendEvent(GetIPCEventReceiveBuffer()); + if (FAILED(hr)) { - hr = g_pDbgTransport->SendEvent(GetIPCEventReceiveBuffer()); - if (FAILED(hr)) - { - m_debugger->UnrecoverableError(hr, - 0, - __FILE__, - __LINE__, - false); - } + m_debugger->UnrecoverableError(hr, + 0, + __FILE__, + __LINE__, + false); } -#endif // FEATURE_DBGIPC_TRANSPORT_VM +#endif // !FEATURE_DBGIPC_TRANSPORT_VM return hr; } |