Turn off 'quit' confirmation in lldb-mi

Summary:
# Turn off interpreter.prompt-on-quit on startup (MI)
# Add CommandInterpreter::SetPromptOnQuit
# Add SBCommandInterpreter::GetPromptOnQuit/SetPromptOnQuit

All tests pass on OS X.

Test Plan:
```
-file-exec-and-symbols ~/p/hello
-break-insert -f main
-exec-run
-interpreter-exec console quit
```

Reviewers: abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: lldb-commits, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D8444

llvm-svn: 233034
This commit is contained in:
Ilia K 2015-03-23 22:45:13 +00:00
parent 481f4146cd
commit acf28bea84
6 changed files with 45 additions and 5 deletions

View File

@ -219,6 +219,12 @@ public:
const char *
GetIOHandlerControlSequence(char ch);
bool
GetPromptOnQuit();
void
SetPromptOnQuit(bool b);
protected:
lldb_private::CommandInterpreter &

View File

@ -625,6 +625,9 @@ public:
bool
GetPromptOnQuit () const;
void
SetPromptOnQuit (bool b);
bool
GetStopCmdSourceOnError () const;

View File

@ -149,6 +149,12 @@ public:
const char *
GetIOHandlerControlSequence(char ch);
bool
GetPromptOnQuit();
void
SetPromptOnQuit(bool b);
bool
CommandExists (const char *cmd);

View File

@ -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();
}

View File

@ -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
{

View File

@ -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;
}
//++ ------------------------------------------------------------------------------------