internal CorStackWalkEx(ICorDebugStackWalk stackwalk, CorThread thread) : base(stackwalk, thread) { m_internalFrameIndex = 0; m_internalFrames = thread.GetActiveInternalFrames(); m_bEndOfStackFrame = false; }
public CorBacktrace (CorThread thread, CorDebuggerSession session): base (session.ObjectAdapter) { this.session = session; this.thread = thread; threadId = thread.Id; frames = new List<CorFrame> (GetFrames (thread)); evalTimestamp = CorDebuggerSession.EvaluationTimestamp; }
void CheckTimestamp ( ) { if (evalTimestamp != CorDebuggerSession.EvaluationTimestamp) { thread = null; frame = null; corEval = null; } }
/** * Are there managed callbacks queued up for the requested thread? */ public bool HasQueuedCallbacks (CorThread managedThread) { int queued = 0; m_controller.HasQueuedCallbacks( (managedThread==null)?null:managedThread.GetInterface(), out queued ); return !(queued == 0); }
/** * Are there managed callbacks queued up for the requested thread? */ public bool HasQueuedCallbacks(CorThread managedThread) { int queued = 0; m_controller.HasQueuedCallbacks((managedThread == null)?null:managedThread.GetInterface(), out queued ); return(!(queued == 0)); }
internal static IEnumerable<CorFrame> GetFrames (CorThread thread) { foreach (CorChain chain in thread.Chains) { if (!chain.IsManaged) continue; foreach (CorFrame frame in chain.Frames) yield return frame; } }
public void Step(CorThread thread) { _activeThread = thread; var stepper = createStepper(); var mod = _activeThread.ActiveFrame.Function.Module; if (hasSymbolReader(mod)) stepIn(mod, stepper); else stepOut(stepper); }
// // IEnumerator interface // public bool MoveNext() { ICorDebugThread[] a = new ICorDebugThread[1]; uint c = 0; int r = m_enum.Next ((uint) a.Length, a, out c); if (r==0 && c==1) // S_OK && we got 1 new element m_th = new CorThread (a[0]); else m_th = null; return m_th != null; }
// // IEnumerator interface // public bool MoveNext() { ICorDebugThread[] a = new ICorDebugThread[1]; uint c = 0; int r = m_enum.Next((uint)a.Length, a, out c); if (r == 0 && c == 1) // S_OK && we got 1 new element { m_th = new CorThread(a[0]); } else { m_th = null; } return(m_th != null); }
//constructors /// <summary> /// Initialze the StackTrace Class and create all the FrameInfo objects /// </summary> /// <param name="proc">The thread to get the stack trace of</param> internal ThreadInfo(CorThread thread, ProcessInfo procInfo) { if (thread == null) { throw new ArgumentNullException("thread"); } if (procInfo == null) { throw new ArgumentNullException("procInfo"); } this.thread = thread; metaImportHash = new Dictionary<string, CorMetadataImport>(); frameStack = new List<FrameInfo>(); threadId = thread.Id; processInfo = procInfo; //get the general thread information object generalThreadInfo = procInfo.GeneralThreads[threadId]; }
public void Stopped(DllDebugger debugger, CorThread thread) { Console.ForegroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.Green; Console.Out.Write("Thread [{0}]", thread.Id); Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.Red; Console.Out.Write(" (ct=Continue, stov=Step Over, stin=Step In, trc=Stack Trace, det=Detach): "); Console.ForegroundColor = ConsoleColor.Green; var line = Console.In.ReadLine(); var transcribed = line.ToLower(); if (transcribed.Contains("ct")) return; if (transcribed.Contains("stov")) debugger.StepOver(thread); else if (transcribed.Contains("stin")) debugger.StepInto(thread); else if (transcribed.Contains("trc")) debugger.ShowStackTrace(thread); else if (transcribed.Contains("locals")) debugger.ShowLocals(thread); else if (transcribed.Contains("br")) SetBreakpoint(transcribed, debugger); else if (transcribed.Contains("det")) debugger.Detach(); else Stopped(debugger, thread); }
/// <summary> /// Returns a list of threads waiting for the monitor event associated with this object /// </summary> /// <returns>The list of waiting threads. The first thread in the list will be released on the /// next call to Monitor.Pulse, and each succesive call will release the next thread in the list</returns> public CorThread[] GetMonitorEventWaitList() { if (m_heapVal as ICorDebugHeapValue3 == null) { throw new NotSupportedException(); } ICorDebugThreadEnum rawThreadEnum; (m_heapVal as ICorDebugHeapValue3).GetMonitorEventWaitList(out rawThreadEnum); uint threadCount; rawThreadEnum.GetCount(out threadCount); ICorDebugThread[] rawThreads = new ICorDebugThread[threadCount]; uint countReceived; rawThreadEnum.Next(threadCount, rawThreads, out countReceived); Debug.Assert(countReceived == threadCount); CorThread[] threads = new CorThread[threadCount]; for (int i = 0; i < threadCount; i++) { threads[i] = new CorThread(rawThreads[i]); } return(threads); }
public CorFunctionRemapOpportunityEventArgs(CorAppDomain appDomain, CorThread thread, CorFunction oldFunction, CorFunction newFunction, int oldILoffset ) : base(appDomain, thread) { m_oldFunction = oldFunction; m_newFunction = newFunction; m_oldILoffset = oldILoffset; }
public CorFunctionRemapOpportunityEventArgs(CorAppDomain appDomain, CorThread thread, CorFunction oldFunction, CorFunction newFunction, int oldILoffset, ManagedCallbackType callbackType ) : base(appDomain, thread, callbackType) { m_oldFunction = oldFunction; m_newFunction = newFunction; m_oldILoffset = oldILoffset; }
public CorBreakpointSetErrorEventArgs(CorAppDomain appDomain, CorThread thread, CorBreakpoint breakpoint, int errorCode) : base(appDomain, thread) { m_breakpoint = breakpoint; m_errorCode = errorCode; }
public CorBreakpointSetErrorEventArgs(CorAppDomain appDomain, CorThread thread, CorBreakpoint breakpoint, int errorCode, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_breakpoint = breakpoint; m_errorCode = errorCode; }
public CorMDAEventArgs(CorMDA mda, CorThread thread, CorProcess proc, ManagedCallbackType callbackType) : base(proc, callbackType) { m_mda = mda; Thread = thread; //m_proc = proc; }
public CorEditAndContinueRemapEventArgs(CorAppDomain appDomain, CorThread thread, CorFunction managedFunction, int accurate, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_managedFunction = managedFunction; m_accurate = accurate; }
public CorLogSwitchEventArgs(CorAppDomain appDomain, CorThread thread, int level, int reason, string logSwitchName, string parentName, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_level = level; m_reason = reason; m_logSwitchName = logSwitchName; m_parentName = parentName; }
internal CorStackWalk(ICorDebugStackWalk stackwalk, CorThread thread) : base(stackwalk) { m_th = thread; m_sw = stackwalk; }
public CorStepCompleteEventArgs(CorAppDomain appDomain, CorThread thread, CorStepper stepper, CorDebugStepReason stepReason) : base(appDomain, thread) { m_stepper = stepper; m_stepReason = stepReason; }
public void SetAllThreadsDebugState(CorDebugThreadState state, CorThread exceptThis) { m_controller.SetAllThreadsDebugState(state, exceptThis != null ? exceptThis.GetInterface() : null); }
public CorBreakpointEventArgs(CorAppDomain appDomain, CorThread thread, CorBreakpoint managedBreakpoint) : base(appDomain, thread) { m_break = managedBreakpoint; }
public CorThreadEventArgs(CorAppDomain appDomain, CorThread thread) : base(appDomain != null ? appDomain : thread.AppDomain) { Thread = thread; }
public CorExceptionUnwind2EventArgs(CorAppDomain appDomain, CorThread thread, CorDebugExceptionUnwindCallbackType eventType, int flags, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_eventType = eventType; m_flags = flags; }
public CorFunctionRemapCompleteEventArgs(CorAppDomain appDomain, CorThread thread, CorFunction managedFunction ) : base(appDomain, thread) { m_managedFunction = managedFunction; }
// Thread may be null. public CorMDAEventArgs(CorMDA mda, CorThread thread, CorProcess proc) : base(proc) { m_mda = mda; Thread = thread; //m_proc = proc; }
public CorFunctionRemapCompleteEventArgs(CorAppDomain appDomain, CorThread thread, CorFunction managedFunction, ManagedCallbackType callbackType ) : base(appDomain, thread, callbackType) { m_managedFunction = managedFunction; }
public void Reset() { m_enum.Reset(); m_th = null; }
public CorException2EventArgs(CorAppDomain appDomain, CorThread thread, CorFrame frame, int offset, CorDebugExceptionCallbackType eventType, int flags, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_frame = frame; m_offset = offset; m_eventType = eventType; m_flags = flags; }
public CorExceptionEventArgs(CorAppDomain appDomain, CorThread thread, bool unhandled, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_unhandled = unhandled; }
public CorThreadEventArgs(CorAppDomain appDomain, CorThread thread, ManagedCallbackType callbackType) : base(appDomain != null ? appDomain : thread.AppDomain, callbackType) { Thread = thread; }
public CorEvalEventArgs(CorAppDomain appDomain, CorThread thread, CorEval eval) : base(appDomain, thread) { m_eval = eval; }
public CorBreakpointEventArgs(CorAppDomain appDomain, CorThread thread, CorBreakpoint managedBreakpoint, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_break = managedBreakpoint; }
public CorEvalEventArgs(CorAppDomain appDomain, CorThread thread, CorEval eval, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_eval = eval; }
public CorStepCompleteEventArgs(CorAppDomain appDomain, CorThread thread, CorStepper stepper, CorDebugStepReason stepReason, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_stepper = stepper; m_stepReason = stepReason; }
public CorLogMessageEventArgs(CorAppDomain appDomain, CorThread thread, int level, string logSwitchName, string message, ManagedCallbackType callbackType) : base(appDomain, thread, callbackType) { m_level = level; m_logSwitchName = logSwitchName; m_message = message; }