Пример #1
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess)
 {
     Process         = ownerProcess;
     CorThread       = new CorThread(thread);
     UniqueId        = uniqueId;
     UniqueIdProcess = uniqueIdProcess;
 }
Пример #2
0
        /// <summary>
        /// true if any managed callbacks are currently queued for the specified thread
        /// </summary>
        /// <param name="thread">Thread or null to check all threads</param>
        /// <returns></returns>
        public bool HasQueuedCallbacks(CorThread thread)
        {
            int queued;
            int hr = obj.HasQueuedCallbacks(thread == null ? null : thread.RawObject, out queued);

            return(hr >= 0 && queued != 0);
        }
Пример #3
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess)
 {
     this.ownerProcess    = ownerProcess;
     this.thread          = new CorThread(thread);
     this.uniqueId        = uniqueId;
     this.uniqueIdProcess = uniqueIdProcess;
 }
Пример #4
0
        public void SetThread(CorThread thread)
        {
            if (thread == null)
            {
                throw new InvalidOperationException();
            }

            ICorDebugEval ce;
            int           hr = thread.RawObject.CreateEval(out ce);

            if (hr < 0 || ce == null)
            {
                throw new EvalException(hr, string.Format("Could not create an evaluator, HR=0x{0:X8}", hr));
            }
            this.thread = thread;
            this.eval   = new CorEval(ce);
        }
Пример #5
0
            static List <ThreadInfo> GetThreadInfos(CorThread thread)
            {
                var process = thread.Process;
                var list    = new List <ThreadInfo>();

                if (process == null)
                {
                    list.Add(new ThreadInfo(thread));
                    return(list);
                }

                foreach (var t in process.Threads)
                {
                    list.Add(new ThreadInfo(t));
                }

                return(list);
            }
Пример #6
0
        internal IDebuggerThread FindThreadUI(DBG.CorThread thread)
        {
            dispatcher.VerifyAccess();
            var dbg = theDebugger.Debugger;

            if (dbg == null)
            {
                return(null);
            }
            foreach (var p in dbg.Processes)
            {
                foreach (var t in p.Threads)
                {
                    if (t.CorThread == thread)
                    {
                        return(new DebuggerThread(this, t));
                    }
                }
            }
            return(null);
        }
Пример #7
0
 /// <summary>
 /// Sets the debug state of all managed threads
 /// </summary>
 /// <param name="state">New state</param>
 /// <param name="thread">Thread to exempt from the new state or null</param>
 public void SetAllThreadsDebugState(CorDebugThreadState state, CorThread thread = null)
 {
     int hr = obj.SetAllThreadsDebugState(state, thread == null ? null : thread.RawObject);
 }
Пример #8
0
 public bool Equals(CorThread other) => !ReferenceEquals(other, null) && RawObject == other.RawObject;
Пример #9
0
 /// <summary>
 /// Gets all frames in all chains
 /// </summary>
 /// <param name="frames">Frames buffer</param>
 /// <returns></returns>
 public IEnumerable <CorFrame> GetAllFrames(ICorDebugFrame[] frames) => CorThread.GetAllFrames(frames);
Пример #10
0
 public ThreadInfos(CorThread thread, bool suspendOtherThreads)
 {
     this.thread = thread;
     this.list   = GetThreadInfos(thread);
     this.suspendOtherThreads = suspendOtherThreads;
 }
Пример #11
0
 public ThreadInfo(CorThread thread)
 {
     this.Thread = thread;
     this.State  = thread.State;
 }
Пример #12
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int incrementedId)
 {
     this.ownerProcess  = ownerProcess;
     this.thread        = new CorThread(thread);
     this.incrementedId = incrementedId;
 }
Пример #13
0
 public bool Equals(CorThread other)
 {
     return(!ReferenceEquals(other, null) &&
            RawObject == other.RawObject);
 }
Пример #14
0
 /// <summary>
 /// Sets the debug state of all managed threads
 /// </summary>
 /// <param name="state">New state</param>
 /// <param name="thread">Thread to exempt from the new state or null</param>
 public void SetAllThreadsDebugState(CorDebugThreadState state, CorThread thread = null) =>
 obj.SetAllThreadsDebugState(state, thread?.RawObject);
Пример #15
0
 public ThreadInfo(CorThread thread)
 {
     Thread = thread;
     State  = thread.State;
 }