Exemple #1
0
        internal void ChildForked(Inferior inferior, int pid)
        {
            Process new_process = new Process(this, pid);

            new_process.ProcessStart.StopInMain = false;

            Inferior new_inferior = Inferior.CreateInferior(
                manager, new_process, new_process.ProcessStart);

            new_inferior.InitializeThread(pid);

            if (!manager.Debugger.Configuration.FollowFork)
            {
                new_inferior.DetachAfterFork();
                return;
            }

            SingleSteppingEngine new_thread = new SingleSteppingEngine(
                manager, new_process, new_inferior, pid);

            Report.Debug(DebugFlags.Threads, "Child forked: {0} {1}", pid, new_thread);

            new_process.main_thread = new_thread;

            manager.Debugger.OnProcessCreatedEvent(new_process);
            new_process.OnThreadCreatedEvent(new_thread);

            CommandResult result = new_process.CloneParentOperation(new_thread);

            new_thread.StartForkedChild(result);
        }