[Lldb-commits] [lldb] [lldb/Interpreter] Add requirements to Scripted Interface abstract methods (PR #109063)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 18 13:46:38 PDT 2024


================
@@ -78,8 +100,11 @@ class ScriptedPythonInterface : virtual public ScriptedInterface {
     using namespace python;
     using Locker = ScriptInterpreterPythonImpl::Locker;
 
-    auto create_error = [](std::string message) {
-      return llvm::createStringError(llvm::inconvertibleErrorCode(), message);
+    Log *log = GetLog(LLDBLog::Script);
+    auto create_error = [](llvm::StringRef format, auto &&...ts) {
----------------
bulbazord wrote:

I think it would be better to be specific with the type here: `const char *`.
`llvm::StringRef` may or may not point to a null-terminated string so calling `.data()` on the parameter sets off alarm bells in my head. I can manually verify that this is never called with anything other than a `const char *` but somebody else may not be so careful in the future.

https://github.com/llvm/llvm-project/pull/109063


More information about the lldb-commits mailing list