[Lldb-commits] [lldb] r130907 - /lldb/trunk/source/Commands/CommandObjectTarget.cpp

Jim Ingham jingham at apple.com
Wed May 4 18:03:36 PDT 2011


Author: jingham
Date: Wed May  4 20:03:36 2011
New Revision: 130907

URL: http://llvm.org/viewvc/llvm-project?rev=130907&view=rev
Log:
Fix the "target stop-hook add" input reader so that it won't say the stop hook was added if the input was interrupted.

Modified:
    lldb/trunk/source/Commands/CommandObjectTarget.cpp

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=130907&r1=130906&r2=130907&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Wed May  4 20:03:36 2011
@@ -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;
         }
 





More information about the lldb-commits mailing list