Fix the "target stop-hook add" input reader so that it won't say the stop hook was added if the input was interrupted.

llvm-svn: 130907
This commit is contained in:
Jim Ingham 2011-05-05 01:03:36 +00:00
parent 330a5b42a5
commit c60695a765
1 changed files with 6 additions and 1 deletions

View File

@ -3077,6 +3077,7 @@ public:
{
File &out_file = reader.GetDebugger().GetOutputFile();
Target::StopHook *new_stop_hook = ((Target::StopHook *) baton);
static bool got_interrupted;
switch (notification)
{
@ -3085,6 +3086,7 @@ public:
if (reader.GetPrompt())
out_file.Printf ("%s", reader.GetPrompt());
out_file.Flush();
got_interrupted = false;
break;
case eInputReaderDeactivate:
@ -3096,6 +3098,7 @@ public:
out_file.Printf ("%s", reader.GetPrompt());
out_file.Flush();
}
got_interrupted = false;
break;
case eInputReaderAsynchronousOutputWritten:
@ -3125,6 +3128,7 @@ public:
reader.SetIsDone (true);
}
got_interrupted = true;
break;
case eInputReaderEndOfFile:
@ -3132,7 +3136,8 @@ public:
break;
case eInputReaderDone:
out_file.Printf ("Stop hook #%d added.\n", new_stop_hook->GetID());
if (!got_interrupted)
out_file.Printf ("Stop hook #%d added.\n", new_stop_hook->GetID());
break;
}