Added the ability for users to create new regex commands.
To do this currently, it must be done in multi-line mode:
(lldb) commands regex --help "Help text for command" --syntax "syntax for command" <cmd-name>
Any example that would use "f" for "finish" when there are no arguments,
and "f <num>" to do a "frame select <num>" would be:
(lldb) commands regex f
Enter multiple regular expressions in the form s/find/replace/ then terminate with an empty line:
s/^$/finish/
s/([0-9]+)/frame select %1/
(lldb) f 11
frame select 12
...
(lldb) f
finish
...
Also added the string version of the OptionValue as OptionValueString.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129855 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Interpreter/NamedOptionValue.cpp b/source/Interpreter/NamedOptionValue.cpp
index e3b6357..0400bea 100644
--- a/source/Interpreter/NamedOptionValue.cpp
+++ b/source/Interpreter/NamedOptionValue.cpp
@@ -94,6 +94,13 @@
return NULL;
}
+OptionValueString *
+NamedOptionValue::GetStringValue ()
+{
+ if (GetValueType() == OptionValue::eTypeString)
+ return static_cast<OptionValueString *>(m_value_sp.get());
+ return NULL;
+}
OptionValueFileSpec *
NamedOptionValue::GetFileSpecValue ()
@@ -186,6 +193,24 @@
}
//-------------------------------------------------------------------------
+// OptionValueDictionary
+//-------------------------------------------------------------------------
+void
+OptionValueString::DumpValue (Stream &strm)
+{
+ strm.Printf ("\"%s\"", m_current_value.c_str());
+}
+
+bool
+OptionValueString::SetValueFromCString (const char *value_cstr)
+{
+ SetCurrentValue (value_cstr);
+ return true;
+}
+
+
+
+//-------------------------------------------------------------------------
// OptionValueFileSpec
//-------------------------------------------------------------------------
void