public CreateThread ( int pid, bool do_attach ) : |
||
pid | int | |
do_attach | bool | |
return |
public Inferior CreateThread(int pid, bool do_attach)
{
Inferior inferior = new Inferior (
thread_manager, process, start, breakpoint_manager,
error_handler, address_domain);
inferior.child_pid = pid;
inferior.signal_info = signal_info;
inferior.has_signals = has_signals;
inferior.target_info = target_info;
inferior.exe = exe;
inferior.arch = inferior.process.Architecture;
if (do_attach)
inferior.Attach (pid);
else
inferior.InitializeThread (pid);
return inferior;
}
internal void ThreadCreated(Inferior inferior, int pid, bool do_attach, bool resume_thread) { Inferior new_inferior = inferior.CreateThread (pid, do_attach); SingleSteppingEngine new_thread = new SingleSteppingEngine (manager, this, new_inferior, pid); Report.Debug (DebugFlags.Threads, "Thread created: {0} {1} {2}", pid, new_thread, do_attach); if (mono_manager != null) mono_manager.ThreadCreated (new_thread); if (!do_attach && !is_execed) get_thread_info (inferior, new_thread); OnThreadCreatedEvent (new_thread); if (resume_thread) { CommandResult result = current_operation != null ? current_operation : new ThreadCommandResult (new_thread.Thread); new_thread.StartThread (result); } else { new_thread.StartSuspended (); } }