Exemplo n.º 1
0
 internal CorStackWalkEx(ICorDebugStackWalk stackwalk, CorThread thread)
     : base(stackwalk, thread)
 {
     m_internalFrameIndex = 0;
     m_internalFrames     = thread.GetActiveInternalFrames();
     m_bEndOfStackFrame   = false;
 }
Exemplo n.º 2
0
		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;
		}
Exemplo n.º 3
0
		void CheckTimestamp ( )
		{
			if (evalTimestamp != CorDebuggerSession.EvaluationTimestamp) {
				thread = null;
				frame = null;
				corEval = null;
			}
		}
Exemplo n.º 4
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);
 }
Exemplo n.º 5
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));
        }
Exemplo n.º 6
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;
			}
		}
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
 //
 // 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;
 }
Exemplo n.º 9
0
        //
        // 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);
        }
Exemplo n.º 10
0
        //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];
        }
Exemplo n.º 11
0
 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);
 }
Exemplo n.º 12
0
        /// <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);
        }
Exemplo n.º 13
0
 public CorFunctionRemapOpportunityEventArgs(CorAppDomain appDomain,
                                    CorThread thread,
                                    CorFunction oldFunction,
                                    CorFunction newFunction,
                                    int oldILoffset
                                    )
     : base(appDomain, thread)
 {
     m_oldFunction = oldFunction;
     m_newFunction = newFunction;
     m_oldILoffset = oldILoffset;
 }
Exemplo n.º 14
0
 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;
 }
Exemplo n.º 15
0
 public CorBreakpointSetErrorEventArgs(CorAppDomain appDomain,
                                 CorThread thread,
                                 CorBreakpoint breakpoint,
                                 int errorCode)
     : base(appDomain, thread)
 {
     m_breakpoint = breakpoint;
     m_errorCode = errorCode;
 }
Exemplo n.º 16
0
 public CorBreakpointSetErrorEventArgs(CorAppDomain appDomain,
                                 CorThread thread,
                                 CorBreakpoint breakpoint,
                                 int errorCode,
                                 ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_breakpoint = breakpoint;
     m_errorCode = errorCode;
 }
Exemplo n.º 17
0
 public CorMDAEventArgs(CorMDA mda, CorThread thread, CorProcess proc,
     ManagedCallbackType callbackType)
     : base(proc, callbackType)
 {
     m_mda = mda;
     Thread = thread;
     //m_proc = proc;
 }
Exemplo n.º 18
0
 public CorEditAndContinueRemapEventArgs(CorAppDomain appDomain,
                                 CorThread thread,
                                 CorFunction managedFunction,
                                 int accurate,
                                 ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_managedFunction = managedFunction;
     m_accurate = accurate;
 }
Exemplo n.º 19
0
 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;
 }
Exemplo n.º 20
0
 internal CorStackWalk(ICorDebugStackWalk stackwalk, CorThread thread)
     : base(stackwalk)
 {
     m_th = thread;
     m_sw = stackwalk;
 }
Exemplo n.º 21
0
 public CorStepCompleteEventArgs(CorAppDomain appDomain, CorThread thread,
                                  CorStepper stepper, CorDebugStepReason stepReason)
     : base(appDomain, thread)
 {
     m_stepper = stepper;
     m_stepReason = stepReason;
 }
Exemplo n.º 22
0
 public void SetAllThreadsDebugState(CorDebugThreadState state, CorThread exceptThis)
 {
     m_controller.SetAllThreadsDebugState(state, exceptThis != null ? exceptThis.GetInterface() : null);
 }
Exemplo n.º 23
0
 public CorBreakpointEventArgs(CorAppDomain appDomain,
                                CorThread thread,
                                CorBreakpoint managedBreakpoint)
     : base(appDomain, thread)
 {
     m_break = managedBreakpoint;
 }
Exemplo n.º 24
0
 public CorThreadEventArgs(CorAppDomain appDomain, CorThread thread)
     : base(appDomain != null ? appDomain : thread.AppDomain)
 {
     Thread = thread;
 }
Exemplo n.º 25
0
 public CorExceptionUnwind2EventArgs(CorAppDomain appDomain, CorThread thread,
                                     CorDebugExceptionUnwindCallbackType eventType,
                                     int flags,
                                     ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_eventType = eventType;
     m_flags = flags;
 }
Exemplo n.º 26
0
 public CorFunctionRemapCompleteEventArgs(CorAppDomain appDomain,
                                    CorThread thread,
                                    CorFunction managedFunction
                                    )
     : base(appDomain, thread)
 {
     m_managedFunction = managedFunction;
 }
Exemplo n.º 27
0
 // Thread may be null.
 public CorMDAEventArgs(CorMDA mda, CorThread thread, CorProcess proc)
     : base(proc)
 {
     m_mda = mda;
     Thread = thread;
     //m_proc = proc;
 }
Exemplo n.º 28
0
 public CorFunctionRemapCompleteEventArgs(CorAppDomain appDomain,
                                    CorThread thread,
                                    CorFunction managedFunction,
                                    ManagedCallbackType callbackType
                                    )
     : base(appDomain, thread, callbackType)
 {
     m_managedFunction = managedFunction;
 }
Exemplo n.º 29
0
 public void Reset()
 {
     m_enum.Reset();
     m_th = null;
 }
Exemplo n.º 30
0
 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;
 }
Exemplo n.º 31
0
 public CorExceptionEventArgs(CorAppDomain appDomain,
                               CorThread thread,
                               bool unhandled,
                               ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_unhandled = unhandled;
 }
Exemplo n.º 32
0
 public CorThreadEventArgs(CorAppDomain appDomain, CorThread thread,
     ManagedCallbackType callbackType)
     : base(appDomain != null ? appDomain : thread.AppDomain, callbackType)
 {
     Thread = thread;
 }
Exemplo n.º 33
0
 public CorEvalEventArgs(CorAppDomain appDomain, CorThread thread,
                          CorEval eval)
     : base(appDomain, thread)
 {
     m_eval = eval;
 }
Exemplo n.º 34
0
 public CorBreakpointEventArgs(CorAppDomain appDomain,
                                CorThread thread,
                                CorBreakpoint managedBreakpoint,
                                ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_break = managedBreakpoint;
 }
Exemplo n.º 35
0
 public CorEvalEventArgs(CorAppDomain appDomain, CorThread thread,
                          CorEval eval, ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_eval = eval;
 }
Exemplo n.º 36
0
 public CorStepCompleteEventArgs(CorAppDomain appDomain, CorThread thread,
                                  CorStepper stepper, CorDebugStepReason stepReason,
                                  ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_stepper = stepper;
     m_stepReason = stepReason;
 }
Exemplo n.º 37
0
 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;
 }