summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-29 04:06:55 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-29 04:06:55 +0000
commitfc3f027d33e71b490b293f074e7761b8b76c8096 (patch)
tree260314010e75ee4507c2b6858b63d2cc305dd712
parent2e84c827506202350ce3c5b2c602867ac449d2b4 (diff)
downloadbcm5719-llvm-fc3f027d33e71b490b293f074e7761b8b76c8096.tar.gz
bcm5719-llvm-fc3f027d33e71b490b293f074e7761b8b76c8096.zip
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. llvm-svn: 132280
-rw-r--r--lldb/include/lldb/API/SBDebugger.h6
-rw-r--r--lldb/include/lldb/Core/Debugger.h6
-rw-r--r--lldb/lldb.xcodeproj/project.pbxproj4
-rw-r--r--lldb/source/API/SBDebugger.cpp14
-rw-r--r--lldb/source/Core/Debugger.cpp13
-rw-r--r--lldb/tools/driver/Driver.cpp3
6 files changed, 43 insertions, 3 deletions
diff --git a/lldb/include/lldb/API/SBDebugger.h b/lldb/include/lldb/API/SBDebugger.h
index 8100f74cf84..8ac320aaf92 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -205,6 +205,12 @@ public:
void
SetScriptLanguage (lldb::ScriptLanguage script_lang);
+ bool
+ GetCloseInputOnEOF () const;
+
+ void
+ SetCloseInputOnEOF (bool b);
+
private:
#ifndef SWIG
diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index 6d1e5214153..433732d32ab 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -415,6 +415,12 @@ public:
static int
TestDebuggerRefCount ();
+ bool
+ GetCloseInputOnEOF () const;
+
+ void
+ SetCloseInputOnEOF (bool b);
+
protected:
static void
diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj
index b5075f594be..8655554eaf7 100644
--- a/lldb/lldb.xcodeproj/project.pbxproj
+++ b/lldb/lldb.xcodeproj/project.pbxproj
@@ -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;
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index c494c594a50..33f9760e107 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -861,3 +861,17 @@ SBDebugger::SetCurrentPlatform (const char *platform_name)
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);
+}
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 8c5ebe27a5d..6cbc92ed3aa 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -233,7 +233,6 @@ Debugger::Debugger () :
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 @@ Debugger::~Debugger ()
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();
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index 6c52890ca04..d4bb7b5e2a3 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -91,6 +91,9 @@ Driver::Driver () :
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 *) "";
OpenPOWER on IntegriCloud