From 95eae4235d4cfa5cee67ab6c4e686baf8a57e9e5 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 21 Sep 2016 16:01:28 +0000 Subject: Make lldb::Regex use StringRef. This updates getters and setters to use StringRef instead of const char *. I tested the build on Linux, Windows, and OSX and saw no build or test failures. I cannot test any BSD or Android variants, however I expect the required changes to be minimal or non-existant. llvm-svn: 282079 --- lldb/source/Target/ThreadPlanStepInRange.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lldb/source/Target/ThreadPlanStepInRange.cpp') diff --git a/lldb/source/Target/ThreadPlanStepInRange.cpp b/lldb/source/Target/ThreadPlanStepInRange.cpp index 3eece2fc41bb..03f6679ae322 100644 --- a/lldb/source/Target/ThreadPlanStepInRange.cpp +++ b/lldb/source/Target/ThreadPlanStepInRange.cpp @@ -298,10 +298,11 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) { } void ThreadPlanStepInRange::SetAvoidRegexp(const char *name) { + auto name_ref = llvm::StringRef::withNullAsEmpty(name); if (!m_avoid_regexp_ap) - m_avoid_regexp_ap.reset(new RegularExpression(name)); + m_avoid_regexp_ap.reset(new RegularExpression(name_ref)); - m_avoid_regexp_ap->Compile(name); + m_avoid_regexp_ap->Compile(name_ref); } void ThreadPlanStepInRange::SetDefaultFlagValue(uint32_t new_value) { @@ -361,7 +362,8 @@ bool ThreadPlanStepInRange::FrameMatchesAvoidCriteria() { 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(), + frame_function_name, + avoid_regexp_to_use->GetText().str().c_str(), match.c_str()); } } -- cgit v1.2.3