diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp --- a/lldb/source/Symbol/Variable.cpp +++ b/lldb/source/Symbol/Variable.cpp @@ -380,9 +380,8 @@ llvm::SmallVector matches; variable_list.Clear(); if (!g_regex.Execute(variable_expr_path, &matches)) { - error.SetErrorStringWithFormat( - "unable to extract a variable name from '%s'", - variable_expr_path.str().c_str()); + error.SetErrorStringWithFormatv( + "unable to extract a variable name from '{0}'", variable_expr_path); return error; } std::string variable_name = matches[1].str(); @@ -411,10 +410,9 @@ valobj_sp = variable_valobj_sp->GetValueForExpressionPath( variable_sub_expr_path); if (!valobj_sp) { - error.SetErrorStringWithFormat( - "invalid expression path '%s' for variable '%s'", - variable_sub_expr_path.str().c_str(), - var_sp->GetName().GetCString()); + error.SetErrorStringWithFormatv( + "invalid expression path '{0}' for variable '{1}'", + variable_sub_expr_path, var_sp->GetName().GetCString()); variable_list.RemoveVariableAtIndex(i); continue; }