<rdar://problem/12022079>
Added a new "interpreter" properties to encapsulate any properties for the command interpreter. Right now this contains only "expand-regex-aliases", so you can now enable (disabled by default) the echoing of the command that a regular expression alias expands to:
(lldb) b main
Breakpoint created: 1: name = 'main', locations = 1
Note that the expanded regular expression command wasn't shown by default. You can enable it if you want to:
(lldb) settings set interpreter.expand-regex-aliases true
(lldb) b main
breakpoint set --name 'main'
Breakpoint created: 1: name = 'main', locations = 1
Also enabled auto completion for enumeration option values (OptionValueEnumeration) and for boolean option values (OptionValueBoolean).
Fixed auto completion for settings names when nothing has been type (it should show all settings).
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162418 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/CommandInterpreter.cpp b/source/Interpreter/CommandInterpreter.cpp
index 05384e4..6ae9793 100644
--- a/source/Interpreter/CommandInterpreter.cpp
+++ b/source/Interpreter/CommandInterpreter.cpp
@@ -59,6 +59,19 @@
using namespace lldb;
using namespace lldb_private;
+
+static PropertyDefinition
+g_properties[] =
+{
+ { "expand-regex-aliases", OptionValue::eTypeBoolean, true, false, NULL, NULL, "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." },
+ { NULL , OptionValue::eTypeInvalid, true, 0 , NULL, NULL, NULL }
+};
+
+enum
+{
+ ePropertyExpandRegexAliases = 0
+};
+
ConstString &
CommandInterpreter::GetStaticBroadcasterClass ()
{
@@ -73,6 +86,7 @@
bool synchronous_execution
) :
Broadcaster (&debugger, "lldb.command-interpreter"),
+ Properties(OptionValuePropertiesSP(new OptionValueProperties(ConstString("interpreter")))),
m_debugger (debugger),
m_synchronous_execution (synchronous_execution),
m_skip_lldbinit_files (false),
@@ -89,8 +103,18 @@
SetEventName (eBroadcastBitResetPrompt, "reset-prompt");
SetEventName (eBroadcastBitQuitCommandReceived, "quit");
CheckInWithManager ();
+ m_collection_sp->Initialize (g_properties);
}
+bool
+CommandInterpreter::GetExpandRegexAliases () const
+{
+ const uint32_t idx = ePropertyExpandRegexAliases;
+ return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
+}
+
+
+
void
CommandInterpreter::Initialize ()
{