Fix the "target stop-hook add" input reader so that it won't say the stop hook was added if the input was interrupted.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130907 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectTarget.cpp b/source/Commands/CommandObjectTarget.cpp
index 5913bf1..1399fb0 100644
--- a/source/Commands/CommandObjectTarget.cpp
+++ b/source/Commands/CommandObjectTarget.cpp
@@ -3077,6 +3077,7 @@
{
File &out_file = reader.GetDebugger().GetOutputFile();
Target::StopHook *new_stop_hook = ((Target::StopHook *) baton);
+ static bool got_interrupted;
switch (notification)
{
@@ -3085,6 +3086,7 @@
if (reader.GetPrompt())
out_file.Printf ("%s", reader.GetPrompt());
out_file.Flush();
+ got_interrupted = false;
break;
case eInputReaderDeactivate:
@@ -3096,6 +3098,7 @@
out_file.Printf ("%s", reader.GetPrompt());
out_file.Flush();
}
+ got_interrupted = false;
break;
case eInputReaderAsynchronousOutputWritten:
@@ -3125,6 +3128,7 @@
reader.SetIsDone (true);
}
+ got_interrupted = true;
break;
case eInputReaderEndOfFile:
@@ -3132,7 +3136,8 @@
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;
}