/// <summary> /// Runs some heuristics to determine whether the OS thread for this thread is /// present in the dump. Since the EE notifies us of EE Threads which may still /// exist, but for which the OS thread has exited, it is quite possible /// to encounter dumps with an EE Thread, but no corresponding OS thread. /// </summary> /// <returns>Boolean indicating whether the OS thread for this thread is /// present in the dump</returns> private bool IsOSThreadPresentInDump() { // Don't call if we're not dump debugging Debug.Assert(m_threadMgr.m_process.DumpReader != null); try { // Since we're debugging a dump, the CLR must be new enough // to support ICorDebugThread2 (and then some). ICorDebugThread2 th2 = m_corThread.Raw as ICorDebugThread2; Debug.Assert(th2 != null); uint osThreadID; th2.GetVolatileOSThreadID(out osThreadID); if (osThreadID == 0) { return(false); } if (m_threadMgr.m_process.DumpReader.GetThread((int)osThreadID) == null) { return(false); } } catch { // It's reasonable for the above to throw exceptions simply // because the OS thread is not present in the dump. For example, some // of the above calls go through mscordbi, and then back into our // DumpReader, which returns errors if it can't find the requested data. return(false); } return(true); }
public CorActiveFunction[] GetActiveFunctions() { ICorDebugThread2 m_th2 = (ICorDebugThread2)m_th; UInt32 pcFunctions; m_th2.GetActiveFunctions(0, out pcFunctions, null); COR_ACTIVE_FUNCTION[] afunctions = new COR_ACTIVE_FUNCTION[pcFunctions]; m_th2.GetActiveFunctions(pcFunctions, out pcFunctions, afunctions); CorActiveFunction[] caf = new CorActiveFunction[pcFunctions]; for (int i = 0; i < pcFunctions; ++i) { caf[i] = new CorActiveFunction((int)afunctions[i].ilOffset, new CorFunction((ICorDebugFunction)afunctions[i].pFunction), afunctions[i].pModule == null?null:new CorModule(afunctions[i].pModule) ); } return(caf); }
/** * Intercept the current exception. */ public void InterceptCurrentException(CorFrame frame) { ICorDebugThread2 m_th2 = (ICorDebugThread2)m_th; m_th2.InterceptCurrentException(frame.m_frame); }
int ICorDebugProcess2.GetThreadForTaskID( ulong taskid, out ICorDebugThread2 ppThread ) { ppThread = null; return Utility.COM_HResults.E_NOTIMPL; }