protected override sealed unsafe int OnDestroyConnection( void * @this, void *pProcess, uint dwConnectionId) => OnDestroyConnection( ComFactory.Create <CorDebugProcess>(pProcess), dwConnectionId);
protected override sealed unsafe int OnCreateConnection( void * @this, void *pProcess, uint dwConnectionId, char *pConnName) => OnCreateConnection( ComFactory.Create <CorDebugProcess>(pProcess), dwConnectionId, UnsafeOps.WCharToSpan(pConnName));
protected override sealed unsafe int OnBreakpoint( void * @this, void *pAppDomain, void *pThread, void *pBreakpoint) => OnBreakpoint( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), ComFactory.Create <CorDebugBreakpoint>(pBreakpoint));
protected override sealed unsafe int OnDebuggerError( void * @this, void *pProcess, int errorHR, uint errorCode) => OnDebuggerError( ComFactory.Create <CorDebugProcess>(pProcess), errorHR, errorCode);
protected override sealed unsafe int OnFunctionRemapComplete( void * @this, void *pAppDomain, void *pThread, void *pFunction) => OnFunctionRemapComplete( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), ComFactory.Create <CorDebugFunction>(pFunction));
protected override sealed unsafe int OnEvalException( void * @this, void *pAppDomain, void *pThread, void *pEval) => OnEvalException( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), ComFactory.Create <CorDebugEval>(pEval));
protected override sealed unsafe int OnException( void * @this, void *pAppDomain, void *pThread, bool unhandled) => OnException( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), unhandled);
protected override sealed unsafe int OnUpdateModuleSymbols( void * @this, void *pAppDomain, void *pModule, void *pSymbolStream) => OnUpdateModuleSymbols( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugModule>(pModule), new IntPtr(pSymbolStream));
protected override sealed unsafe int OnMDANotification( void * @this, void *pController, void *pThread, void *pMDA) => OnMDANotification( ComFactory.Create <CorDebugController>(pController), ComFactory.Create <CorDebugThread>(pThread), ComFactory.Create <CorDebugMDA>(pMDA));
protected override sealed unsafe int OnEditAndContinueRemap( void * @this, void *pAppDomain, void *pThread, void *pFunction, bool fAccurate) => OnEditAndContinueRemap( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), ComFactory.Create <CorDebugFunction>(pFunction), fAccurate);
protected override sealed unsafe int OnExceptionUnwind( void * @this, void *pAppDomain, void *pThread, int dwEventType, uint dwFlags) => OnExceptionUnwind( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), (CorDebugExceptionUnwindCallbackType)dwEventType, dwFlags);
protected override sealed unsafe int OnStepComplete( void * @this, void *pAppDomain, void *pThread, void *pStepper, int reason) => OnStepComplete( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), ComFactory.Create <CorDebugStepper>(pStepper), (CorDebugStepReason)reason);
protected override sealed unsafe int OnFunctionRemapOpportunity( void * @this, void *pAppDomain, void *pThread, void *pOldFunction, void *pNewFunction, uint oldILOffset) => OnFunctionRemapOpportunity( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), ComFactory.Create <CorDebugFunction>(pOldFunction), ComFactory.Create <CorDebugFunction>(pNewFunction), oldILOffset);
protected override sealed unsafe int OnLogMessage( void * @this, void *pAppDomain, void *pThread, int lLevel, char *pLogSwitchName, char *pMessage) => OnLogMessage( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), lLevel, UnsafeOps.WCharToSpan(pLogSwitchName), UnsafeOps.WCharToSpan(pMessage));
protected override sealed unsafe int OnLogSwitch( void * @this, void *pAppDomain, void *pThread, int lLevel, uint ulReason, char *pLogSwitchName, char *pParentName) => OnLogSwitch( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), lLevel, ulReason, UnsafeOps.WCharToSpan(pLogSwitchName), UnsafeOps.WCharToSpan(pParentName));
protected override sealed unsafe int OnException2( void * @this, void *pAppDomain, void *pThread, void *pFrame, uint nOffset, int dwEventType, uint dwFlags) => OnException2( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread), ComFactory.Create <CorDebugFrame>(pFrame), nOffset, (CorDebugExceptionCallbackType)dwEventType, dwFlags);
public static unsafe DebugEngine Attach(int processId) { if (processId == Process.GetCurrentProcess().Id) { throw new ArgumentException( "Cannot debug the current process.", nameof(processId)); } Process process = Process.GetProcessById(processId); IntPtr hModule = GetClrModule(process); void ** ppCordb = default; MscordbiShim.CreateCordbObject( iDebuggerVersion: 5, unchecked ((uint)processId), hModule.ToPointer(), &ppCordb); if (ppCordb == default) { throw new InvalidOperationException(); } var engine = new DebugEngine { _callbacks = new LoggerManagedCallbacks(), CorDebug = ComFactory.Create <CorDebug>(ppCordb), }; engine.CorDebug.Initialize().MaybeThrowHr(); engine.CorDebug.SetManagedHandler(engine._callbacks.CallbacksPointer).MaybeThrowHr(); engine.CorDebug.DebugActiveProcess( unchecked ((uint)processId), win32Attach: false, out engine._process) .MaybeThrowHr(); engine._callbacks.Control = engine.CorProcess; return(engine); }
protected override sealed unsafe int OnExitAppDomain(void * @this, void *pProcess, void *pAppDomain) => OnExitAppDomain( ComFactory.Create <CorDebugProcess>(pProcess), ComFactory.Create <CorDebugAppDomain>(pAppDomain));
protected override sealed unsafe int OnExitThread(void * @this, void *pAppDomain, void *thread) => OnExitThread( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(thread));
protected override sealed unsafe int OnExitProcess(void * @this, void *pProcess) => OnExitProcess(ComFactory.Create <CorDebugProcess>(pProcess));
protected override sealed unsafe int OnUnloadModule(void * @this, void *pAppDomain, void *pModule) => OnUnloadModule( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugModule>(pModule));
protected override sealed unsafe int OnUnloadClass(void * @this, void *pAppDomain, void *c) => OnUnloadClass( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugClass>(c));
protected override sealed unsafe int OnUnloadAssembly(void * @this, void *pAppDomain, void *pAssembly) => OnUnloadAssembly( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugAssembly>(pAssembly));
protected override sealed unsafe int OnControlCTrap(void * @this, void *pProcess) => OnControlCTrap(ComFactory.Create <CorDebugProcess>(pProcess));
protected override sealed unsafe int OnNameChange(void * @this, void *pAppDomain, void *pThread) => OnNameChange( ComFactory.Create <CorDebugAppDomain>(pAppDomain), ComFactory.Create <CorDebugThread>(pThread));