<rdar://problem/13384801>
Make lldb_private::RegularExpression thread safe everywhere. This was done by removing the m_matches array from the lldb_private::RegularExpression class and putting it into the new lldb_private::RegularExpression::Match class. When executing a regular expression you now have the option to create a lldb_private::RegularExpression::Match object and pass a pointer in if you want to get parenthesized matching. If you don't want any matching, you pass in NULL. The lldb_private::RegularExpression::Match object is initialized with the number of matches you desire. Any matching strings are now extracted from the lldb_private::RegularExpression::Match objects. This makes the regular expression objects thread safe and as a result many more regex objects were turned into static objects that end up using a local lldb_private::RegularExpression::Match object when executing.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178702 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/ThreadPlanStepInRange.cpp b/source/Target/ThreadPlanStepInRange.cpp
index 36751cd..e6da7a0 100644
--- a/source/Target/ThreadPlanStepInRange.cpp
+++ b/source/Target/ThreadPlanStepInRange.cpp
@@ -279,13 +279,16 @@
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
if (log)
num_matches = 1;
- bool return_value = avoid_regexp_to_use->Execute(frame_function_name, num_matches);
+
+ RegularExpression::Match regex_match(num_matches);
+
+ bool return_value = avoid_regexp_to_use->Execute(frame_function_name, ®ex_match);
if (return_value)
{
if (log)
{
std::string match;
- avoid_regexp_to_use->GetMatchAtIndex(frame_function_name,0, match);
+ regex_match.GetMatchAtIndex(frame_function_name,0, match);
log->Printf ("Stepping out of function \"%s\" because it matches the avoid regexp \"%s\" - match substring: \"%s\".",
frame_function_name,
avoid_regexp_to_use->GetText(),