[Lldb-commits] [lldb] r121884 - /lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp

Caroline Tice ctice at apple.com
Wed Dec 15 11:51:12 PST 2010


Author: ctice
Date: Wed Dec 15 13:51:12 2010
New Revision: 121884

URL: http://llvm.org/viewvc/llvm-project?rev=121884&view=rev
Log:
Add termination instructions when entering the interactive script interpreter.


Modified:
    lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp

Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=121884&r1=121883&r2=121884&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Wed Dec 15 13:51:12 2010
@@ -330,11 +330,20 @@
     if (baton == NULL)
         return 0;
 
+    FILE *out_fh = reader.GetDebugger().GetOutputFileHandle ();
+    if (out_fh == NULL)
+        out_fh = stdout;
+
     ScriptInterpreterPython *script_interpreter = (ScriptInterpreterPython *) baton;            
     switch (notification)
     {
     case eInputReaderActivate:
         {
+            if (out_fh)
+            {
+                ::fprintf (out_fh, "Python Interactive Interpreter. To exit Python, type 'quit()' or 'exit()'.\n");
+                ::fprintf (out_fh, "Do NOT use Ctrl-D (EOF) to exit, as that will cause the lldb debugger to hang.\n");
+            }
             // Save terminal settings if we can
             int input_fd;
             FILE *input_fh = reader.GetDebugger().GetInputFileHandle();





More information about the lldb-commits mailing list