diff --git a/src/DbgBreakpoint.cc b/src/DbgBreakpoint.cc index 2ca288ffa6..21753f4035 100644 --- a/src/DbgBreakpoint.cc +++ b/src/DbgBreakpoint.cc @@ -119,7 +119,7 @@ void DbgBreakpoint::RemoveFromStmt() } -bool DbgBreakpoint::SetLocation(ParseLocationRec plr, string loc_str) +bool DbgBreakpoint::SetLocation(ParseLocationRec plr, string_view loc_str) { if ( plr.type == plrUnknown ) { @@ -150,7 +150,7 @@ bool DbgBreakpoint::SetLocation(ParseLocationRec plr, string loc_str) { kind = BP_FUNC; function_name = make_full_var_name(current_module.c_str(), - loc_str.c_str()); + loc_str.data()); at_stmt = plr.stmt; const Location* loc = at_stmt->GetLocationInfo(); snprintf(description, sizeof(description), "%s at %s:%d", diff --git a/src/DbgBreakpoint.h b/src/DbgBreakpoint.h index be5d27d6dd..ab1cf45489 100644 --- a/src/DbgBreakpoint.h +++ b/src/DbgBreakpoint.h @@ -21,7 +21,7 @@ public: void SetID(int newID) { BPID = newID; } // True if breakpoint could be set; false otherwise - bool SetLocation(ParseLocationRec plr, string loc_str); + bool SetLocation(ParseLocationRec plr, string_view loc_str); bool SetLocation(Stmt* stmt); bool SetLocation(double time); diff --git a/src/DebugCmds.cc b/src/DebugCmds.cc index 0632d24a9a..983ee69e84 100644 --- a/src/DebugCmds.cc +++ b/src/DebugCmds.cc @@ -27,9 +27,9 @@ // // Helper routines // -bool string_is_regex(string s) +bool string_is_regex(string_view s) { - return strpbrk(s.c_str(), "?*\\+"); + return strpbrk(s.data(), "?*\\+"); } void lookup_global_symbols_regex(const string& orig_regex, vector& matches,