aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Interpreter/OptionValueRegex.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/include/lldb/Interpreter/OptionValueRegex.h b/lldb/include/lldb/Interpreter/OptionValueRegex.h
index caeab69..b09b841 100644
--- a/lldb/include/lldb/Interpreter/OptionValueRegex.h
+++ b/lldb/include/lldb/Interpreter/OptionValueRegex.h
@@ -17,7 +17,8 @@ namespace lldb_private {
class OptionValueRegex : public OptionValue {
public:
OptionValueRegex(const char *value = nullptr)
- : OptionValue(), m_regex(llvm::StringRef::withNullAsEmpty(value)) {}
+ : OptionValue(), m_regex(llvm::StringRef::withNullAsEmpty(value)),
+ m_default_regex_str(llvm::StringRef::withNullAsEmpty(value).str()) {}
~OptionValueRegex() override = default;
@@ -36,7 +37,7 @@ public:
VarSetOperationType = eVarSetOperationAssign) = delete;
bool Clear() override {
- m_regex = RegularExpression();
+ m_regex = RegularExpression(m_default_regex_str);
m_value_was_set = false;
return true;
}
@@ -59,6 +60,7 @@ public:
protected:
RegularExpression m_regex;
+ std::string m_default_regex_str;
};
} // namespace lldb_private