Debugger CLI: Wait for TeamDebugger thread to die before exit()

This commit is contained in:
Ingo Weinhold
2012-07-29 00:28:56 +02:00
parent e51854a127
commit 726d557c9e
+10 -4
View File
@@ -594,14 +594,20 @@ CliDebugger::Run(const Options& options)
if (!get_debugged_program(options, programInfo))
return false;
if (start_team_debugger(programInfo.team, &settingsManager, this,
programInfo.thread, programInfo.stopInMain, userInterface)
== NULL) {
TeamDebugger* teamDebugger = start_team_debugger(programInfo.team,
&settingsManager, this, programInfo.thread, programInfo.stopInMain,
userInterface);
if (teamDebugger == NULL)
return false;
}
thread_id teamDebuggerThread = teamDebugger->Thread();
// run the input loop
userInterface->Run();
// wait for the team debugger thread to terminate
wait_for_thread(teamDebuggerThread, NULL);
return true;
}