[Lldb-commits] [lldb] r132280 - in /lldb/trunk: include/lldb/API/SBDebugger.h include/lldb/Core/Debugger.h lldb.xcodeproj/project.pbxproj source/API/SBDebugger.cpp source/Core/Debugger.cpp tools/driver/Driver.cpp

Greg Clayton gclayton at apple.com
Sat May 28 21:06:55 PDT 2011


Author: gclayton
Date: Sat May 28 23:06:55 2011
New Revision: 132280

URL: http://llvm.org/viewvc/llvm-project?rev=132280&view=rev
Log:
Don't have the debugger default to ignoring EOF. This is only what the driver
(or anything running in a terminal) wants. Not what a UI (Xcode) would want 
where it creates a debugger per debug window. The current code had an infinite
loop after a debug session ended. 


Modified:
    lldb/trunk/include/lldb/API/SBDebugger.h
    lldb/trunk/include/lldb/Core/Debugger.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/API/SBDebugger.cpp
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/include/lldb/API/SBDebugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=132280&r1=132279&r2=132280&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBDebugger.h (original)
+++ lldb/trunk/include/lldb/API/SBDebugger.h Sat May 28 23:06:55 2011
@@ -205,6 +205,12 @@
     void
     SetScriptLanguage (lldb::ScriptLanguage script_lang);
 
+    bool
+    GetCloseInputOnEOF () const;
+    
+    void
+    SetCloseInputOnEOF (bool b);
+
 private:
 
 #ifndef SWIG

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=132280&r1=132279&r2=132280&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Sat May 28 23:06:55 2011
@@ -415,6 +415,12 @@
     static int
     TestDebuggerRefCount ();
 
+    bool
+    GetCloseInputOnEOF () const;
+    
+    void
+    SetCloseInputOnEOF (bool b);
+
 protected:
 
     static void

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=132280&r1=132279&r2=132280&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Sat May 28 23:06:55 2011
@@ -3509,7 +3509,7 @@
 		2689FFD613353D7A00698AC0 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				COPY_PHASE_STRIP = YES;
+				COPY_PHASE_STRIP = NO;
 				CURRENT_PROJECT_VERSION = 57;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DYLIB_CURRENT_VERSION = 57;
@@ -3549,7 +3549,7 @@
 		2689FFD713353D7A00698AC0 /* BuildAndIntegration */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				COPY_PHASE_STRIP = YES;
+				COPY_PHASE_STRIP = NO;
 				CURRENT_PROJECT_VERSION = 57;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DYLIB_CURRENT_VERSION = 57;

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=132280&r1=132279&r2=132280&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Sat May 28 23:06:55 2011
@@ -861,3 +861,17 @@
     return sb_error;
 }
 
+bool
+SBDebugger::GetCloseInputOnEOF () const
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->GetCloseInputOnEOF ();
+    return false;
+}
+
+void
+SBDebugger::SetCloseInputOnEOF (bool b)
+{
+    if (m_opaque_sp)
+        m_opaque_sp->SetCloseInputOnEOF (b);
+}

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=132280&r1=132279&r2=132280&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Sat May 28 23:06:55 2011
@@ -233,7 +233,6 @@
     m_input_readers (),
     m_input_reader_data ()
 {
-    m_input_comm.SetCloseOnEOF(false);
     m_command_interpreter_ap->Initialize ();
     // Always add our default platform to the platform list
     PlatformSP default_platform_sp (Platform::GetDefaultPlatform());
@@ -256,6 +255,18 @@
 
 
 bool
+Debugger::GetCloseInputOnEOF () const
+{
+    return m_input_comm.GetCloseOnEOF();
+}
+
+void
+Debugger::SetCloseInputOnEOF (bool b)
+{
+    m_input_comm.SetCloseOnEOF(b);
+}
+
+bool
 Debugger::GetAsyncExecution ()
 {
     return !m_command_interpreter_ap->GetSynchronous();

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=132280&r1=132279&r2=132280&view=diff
==============================================================================
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Sat May 28 23:06:55 2011
@@ -91,6 +91,9 @@
     m_option_data (),
     m_waiting_for_command (false)
 {
+    // We want to be able to handle CTRL+D in the terminal to have it terminate
+    // certain input
+    m_debugger.SetCloseInputOnEOF (false);
     g_debugger_name = (char *) m_debugger.GetInstanceName();
     if (g_debugger_name == NULL)
         g_debugger_name = (char *) "";





More information about the lldb-commits mailing list