예제 #1
0
파일: DnThread.cs 프로젝트: xi4oyu/dnSpy
 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
파일: Debugger.cs 프로젝트: pashav15/pashav
        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
파일: DnThread.cs 프로젝트: xi4oyu/dnSpy
 /// <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
파일: DnEval.cs 프로젝트: pashav15/pashav
 public ThreadInfo(CorThread thread)
 {
     Thread = thread;
     State  = thread.State;
 }