private CloneParentOperation ( |
||
new_thread | ||
Результат |
CommandResult CloneParentOperation(SingleSteppingEngine new_thread)
{
if (parent.current_state == ProcessState.SingleThreaded) {
current_state = ProcessState.SingleThreaded;
return new ThreadCommandResult (new_thread.Thread);
}
if (parent.current_state != ProcessState.Running)
throw new InternalError ();
current_state = ProcessState.Running;
if ((parent.current_operation.ThreadingModel & ThreadingModel.ThreadingMode) == ThreadingModel.Global)
current_operation = parent.current_operation;
else if ((parent.current_operation.ThreadingModel & ThreadingModel.ThreadingMode) == ThreadingModel.Process)
current_operation = new ProcessCommandResult (this, parent.current_operation.ThreadingModel);
else
throw new InternalError ();
return current_operation;
}
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); }