Exemplo n.º 1
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int uniqueId, int uniqueIdProcess)
 {
     Process         = ownerProcess;
     CorThread       = new CorThread(thread);
     UniqueId        = uniqueId;
     UniqueIdProcess = uniqueIdProcess;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
Exemplo n.º 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);
        }
Exemplo n.º 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);
 }
Exemplo n.º 8
0
 public bool Equals(CorThread other) => !ReferenceEquals(other, null) && RawObject == other.RawObject;
Exemplo n.º 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);
Exemplo n.º 10
0
 public ThreadInfos(CorThread thread, bool suspendOtherThreads)
 {
     this.thread = thread;
     this.list   = GetThreadInfos(thread);
     this.suspendOtherThreads = suspendOtherThreads;
 }
Exemplo n.º 11
0
 public ThreadInfo(CorThread thread)
 {
     this.Thread = thread;
     this.State  = thread.State;
 }
Exemplo n.º 12
0
 internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int incrementedId)
 {
     this.ownerProcess  = ownerProcess;
     this.thread        = new CorThread(thread);
     this.incrementedId = incrementedId;
 }
Exemplo n.º 13
0
 public bool Equals(CorThread other)
 {
     return(!ReferenceEquals(other, null) &&
            RawObject == other.RawObject);
 }
Exemplo n.º 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);
Exemplo n.º 15
0
 public ThreadInfo(CorThread thread)
 {
     Thread = thread;
     State  = thread.State;
 }