summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/API/SBCommandInterpreter.h6
-rw-r--r--lldb/include/lldb/Interpreter/CommandInterpreter.h3
-rw-r--r--lldb/scripts/Python/interface/SBCommandInterpreter.i6
-rw-r--r--lldb/source/API/SBCommandInterpreter.cpp16
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp7
-rw-r--r--lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp12
6 files changed, 45 insertions, 5 deletions
diff --git a/lldb/include/lldb/API/SBCommandInterpreter.h b/lldb/include/lldb/API/SBCommandInterpreter.h
index a81269a5574..78d7564e4d1 100644
--- a/lldb/include/lldb/API/SBCommandInterpreter.h
+++ b/lldb/include/lldb/API/SBCommandInterpreter.h
@@ -219,6 +219,12 @@ public:
const char *
GetIOHandlerControlSequence(char ch);
+ bool
+ GetPromptOnQuit();
+
+ void
+ SetPromptOnQuit(bool b);
+
protected:
lldb_private::CommandInterpreter &
diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h
index 20b6ff95be8..4e1cd0d7d5c 100644
--- a/lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -625,6 +625,9 @@ public:
bool
GetPromptOnQuit () const;
+ void
+ SetPromptOnQuit (bool b);
+
bool
GetStopCmdSourceOnError () const;
diff --git a/lldb/scripts/Python/interface/SBCommandInterpreter.i b/lldb/scripts/Python/interface/SBCommandInterpreter.i
index dfa3ce600bf..91904c5fd21 100644
--- a/lldb/scripts/Python/interface/SBCommandInterpreter.i
+++ b/lldb/scripts/Python/interface/SBCommandInterpreter.i
@@ -150,6 +150,12 @@ public:
GetIOHandlerControlSequence(char ch);
bool
+ GetPromptOnQuit();
+
+ void
+ SetPromptOnQuit(bool b);
+
+ bool
CommandExists (const char *cmd);
bool
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index 42f6e51c792..0f234ec6c69 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -447,6 +447,21 @@ SBCommandInterpreter::GetDebugger ()
return sb_debugger;
}
+bool
+SBCommandInterpreter::GetPromptOnQuit()
+{
+ if (m_opaque_ptr)
+ return m_opaque_ptr->GetPromptOnQuit();
+ return false;
+}
+
+void
+SBCommandInterpreter::SetPromptOnQuit (bool b)
+{
+ if (m_opaque_ptr)
+ m_opaque_ptr->SetPromptOnQuit(b);
+}
+
CommandInterpreter *
SBCommandInterpreter::get ()
{
@@ -850,4 +865,3 @@ SBCommand::AddCommand (const char* name, lldb::SBCommandPluginInterface *impl, c
return lldb::SBCommand(new_command_sp);
return lldb::SBCommand();
}
-
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index eaa21adc139..a203d50ce40 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -149,6 +149,13 @@ CommandInterpreter::GetPromptOnQuit () const
return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr, idx, g_properties[idx].default_uint_value != 0);
}
+void
+CommandInterpreter::SetPromptOnQuit (bool b)
+{
+ const uint32_t idx = ePropertyPromptOnQuit;
+ m_collection_sp->SetPropertyAtIndexAsBoolean (nullptr, idx, b);
+}
+
bool
CommandInterpreter::GetStopCmdSourceOnError () const
{
diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp b/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp
index 9f8a6446055..c16035a6f93 100644
--- a/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp
+++ b/lldb/tools/lldb-mi/MICmnLLDBDebugger.cpp
@@ -233,11 +233,15 @@ bool
CMICmnLLDBDebugger::InitSBDebugger(void)
{
m_lldbDebugger = lldb::SBDebugger::Create(false);
- if (m_lldbDebugger.IsValid())
- return MIstatus::success;
+ if (!m_lldbDebugger.IsValid())
+ {
+ SetErrorDescription(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER));
+ return MIstatus::failure;
+ }
- SetErrorDescription(MIRSRC(IDS_LLDBDEBUGGER_ERR_INVALIDDEBUGGER));
- return MIstatus::failure;
+ m_lldbDebugger.GetCommandInterpreter().SetPromptOnQuit(false);
+
+ return MIstatus::success;
}
//++ ------------------------------------------------------------------------------------
OpenPOWER on IntegriCloud