Esempio n. 1
0
        public void ExitThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread)
        {
            // ICorDebugThread is still not dead and can be used for some operations
            if (process.Threads.Contains(pThread))
            {
                EnterCallback(PausedReason.Other, "ExitThread " + pThread.GetID(), pThread);

                process.Threads[pThread].NotifyExited();
            }
            else
            {
                EnterCallback(PausedReason.Other, "ExitThread " + pThread.GetID(), process.CorProcess);

                // .NET 4.0 - It seems that the API is reporting exits of threads without announcing their creation.
                // TODO: Remove in next .NET 4.0 beta and investigate
                process.TraceMessage("ERROR: Thread does not exist " + pThread.GetID());
            }

            try
            {
                ExitCallback();
            }
            catch (COMException e)
            {
                // For some reason this sometimes happens in .NET 1.1
                process.TraceMessage("Continue failed in ExitThread callback: " + e.Message);
            }
        }
 public CorDebugThread(ICorDebugThread _thread)
 {
     m_corThread = _thread;
     uint id;
     m_corThread.GetID(out id);
     ID = id;
 }
        public void CreateThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread)
        {
            // We can not use pThread since it has not been added yet
            // and we continue from this callback anyway
            EnterCallback("CreateThread " + pThread.GetID(), pAppDomain);

            Thread thread = new Thread(process, pThread);

            process.threads.Add(thread);

            ExitCallback();
        }
Esempio n. 4
0
        public void CreateThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread)
        {
            // We can not use pThread since it has not been added yet
            // and we continue from this callback anyway
            EnterCallback(PausedReason.Other, "CreateThread " + pThread.GetID(), pAppDomain);

            Thread thread = new Thread(process, pThread);

            process.Threads.Add(thread);

            thread.CorThread.SetDebugState(process.NewThreadState);

            ExitCallback();
        }
Esempio n. 5
0
		public void ExitThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread)
		{
			Thread thread = process.GetThread(pThread);
			
			// ICorDebugThread is still not dead and can be used for some operations
			if (thread != null) {
				EnterCallback("ExitThread " + pThread.GetID(), pThread);
				
				thread.NotifyExited();
			} else {
				EnterCallback("ExitThread " + pThread.GetID(), process.CorProcess);
				
				// .NET 4.0 - It seems that the API is reporting exits of threads without announcing their creation.
				// TODO: Remove in next .NET 4.0 beta and investigate
				process.TraceMessage("ERROR: Thread does not exist " + pThread.GetID());
			}
			
			try {
				ExitCallback();
			} catch (COMException e) {
				// For some reason this sometimes happens in .NET 1.1
				process.TraceMessage("Continue failed in ExitThread callback: " + e.Message);
			}
		}
Esempio n. 6
0
		public void CreateThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread)
		{
			// We can not use pThread since it has not been added yet
			// and we continue from this callback anyway
			EnterCallback("CreateThread " + pThread.GetID(), pAppDomain);
			
			Thread thread = new Thread(process, pThread);
			process.threads.Add(thread);
			
			ExitCallback();
		}
Esempio n. 7
0
 internal Thread(Process process, ICorDebugThread corThread)
 {
     this.process   = process;
     this.corThread = corThread;
     this.id        = CorThread.GetID();
 }
Esempio n. 8
0
 void _UpdateActiveThread(ICorDebugThread thread)
 {
     if (null == thread)
     {
         int i33 = 33;
     }
     else
     {
         lock (dbgproc)
         {
             //dbgproc.idbgthd = thread;
             thread.GetID(out dbgproc.ActiveThreadID);
             //thread.GetActiveFrame(out dbgproc.idbgfrm);
         }
     }
 }
Esempio n. 9
0
		public void CreateThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread)
		{
			// We can not use pThread since it has not been added yet
			// and we continue from this callback anyway
			EnterCallback(PausedReason.Other, "CreateThread " + pThread.GetID(), pAppDomain);
			
			Thread thread = new Thread(process, pThread);
			process.Threads.Add(thread);
			
			thread.CorThread.SetDebugState(process.NewThreadState);
			
			ExitCallback();
		}
 public CorThread(ICorDebugThread thread)
 {
     corThread = thread;
     corThread.GetID(out id);
     //corThread.G
 }