예제 #1
0
        public void ThreadCreatedEvent(Results evnt)
        {
            int    tid     = evnt.FindInt("id");
            string groupId = evnt.FindString("group-id");
            int    pid     = _process.PidByInferior(groupId);

            foreach (var p in _threadStates)
            {
                if (p.Value.Newpid == pid)
                {
                    p.Value.Newtid = tid;
                }
            }
        }
예제 #2
0
 internal void SendThreadEvents(object sender, EventArgs e)
 {
     if (_debugger.Engine.ProgramCreateEventSent)
     {
         List <DebuggedThread> deadThreads;
         List <DebuggedThread> newThreads;
         lock (_threadList)
         {
             deadThreads  = _deadThreads;
             _deadThreads = null;
             newThreads   = _newThreads;
             _newThreads  = null;
         }
         if (newThreads != null)
         {
             if (newThreads.Count == _threadList.Count)
             {
                 // These are the first threads. Send a processInfoUpdateEvent too.
                 AD7ProcessInfoUpdatedEvent.Send(_debugger.Engine, _debugger.LaunchOptions.ExePath, (uint)_debugger.PidByInferior("i1"));
             }
             foreach (var newt in newThreads)
             {
                 if (!newt.ChildThread)
                 {
                     _callback.OnThreadStart(newt);
                 }
             }
         }
         if (deadThreads != null)
         {
             foreach (var dead in deadThreads)
             {
                 if (!dead.ChildThread)
                 {
                     // Send the destroy event outside the lock
                     _callback.OnThreadExit(dead, 0);
                 }
             }
         }
     }
 }