summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2015-10-19 23:11:07 +0000
committerSean Callanan <scallanan@apple.com>2015-10-19 23:11:07 +0000
commit6681041d70e28e4563a5b04d41b75629e2492fc5 (patch)
treee75bd664994ead48d5b604acb1dd3b8af378d8cf /lldb/source/Interpreter/CommandInterpreter.cpp
parentcc25301092534288a3b81a020c3a3095763ca1d4 (diff)
downloadbcm5719-llvm-6681041d70e28e4563a5b04d41b75629e2492fc5.tar.gz
bcm5719-llvm-6681041d70e28e4563a5b04d41b75629e2492fc5.zip
Added the concept of a Read-Eval-Print-Loop to LLDB.
A REPL takes over the command line and typically treats input as source code. REPLs can also do code completion. The REPL class allows its subclasses to implement the language-specific functionality without having to know about the IOHandler-specific internals. Also added a PluginManager-based way of getting to a REPL given a language and a target. Also brought in some utility code and expression options that are useful for REPLs, such as line offsets for expressions, ANSI terminal coloring of errors, and a few IOHandler convenience functions. llvm-svn: 250753
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 498a63e86ad..b7cc607e807 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -85,6 +85,7 @@ g_properties[] =
{ "expand-regex-aliases", OptionValue::eTypeBoolean, true, false, nullptr, nullptr, "If true, regular expression alias commands will show the expanded command that will be executed. This can be used to debug new regular expression alias commands." },
{ "prompt-on-quit", OptionValue::eTypeBoolean, true, true, nullptr, nullptr, "If true, LLDB will prompt you before quitting if there are any live processes being debugged. If false, LLDB will quit without asking in any case." },
{ "stop-command-source-on-error", OptionValue::eTypeBoolean, true, true, nullptr, nullptr, "If true, LLDB will stop running a 'command source' script upon encountering an error." },
+ { "space-repl-prompts", OptionValue::eTypeBoolean, true, false, nullptr, nullptr, "If true, blank lines will be printed between between REPL submissions." },
{ nullptr , OptionValue::eTypeInvalid, true, 0 , nullptr, nullptr, nullptr }
};
@@ -92,7 +93,8 @@ enum
{
ePropertyExpandRegexAliases = 0,
ePropertyPromptOnQuit = 1,
- ePropertyStopCmdSourceOnError = 2
+ ePropertyStopCmdSourceOnError = 2,
+ eSpaceReplPrompts = 3
};
ConstString &
@@ -167,6 +169,13 @@ CommandInterpreter::GetStopCmdSourceOnError () const
return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr, idx, g_properties[idx].default_uint_value != 0);
}
+bool
+CommandInterpreter::GetSpaceReplPrompts () const
+{
+ const uint32_t idx = eSpaceReplPrompts;
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr, idx, g_properties[idx].default_uint_value != 0);
+}
+
void
CommandInterpreter::Initialize ()
{
OpenPOWER on IntegriCloud