[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
Thu Sep 19 10:23:42 PDT 2024
================
@@ -186,36 +210,49 @@ class ScriptedPythonInterface : virtual public ScriptedInterface {
if (!checker_or_err)
return checker_or_err.takeError();
+ llvm::Error abstract_method_errors = llvm::Error::success();
for (const auto &method_checker : *checker_or_err)
switch (method_checker.second) {
case AbstractMethodCheckerCases::eNotImplemented:
- LLDB_LOG(GetLog(LLDBLog::Script),
- "Abstract method {0}.{1} not implemented.",
- obj_class_name.GetString(), method_checker.first);
+ abstract_method_errors = llvm::joinErrors(
+ std::move(abstract_method_errors),
+ std::move(create_error("Abstract method {0}.{1} not implemented.",
+ obj_class_name.GetString(),
+ method_checker.first)));
break;
case AbstractMethodCheckerCases::eNotAllocated:
- LLDB_LOG(GetLog(LLDBLog::Script),
- "Abstract method {0}.{1} not allocated.",
- obj_class_name.GetString(), method_checker.first);
+ abstract_method_errors = llvm::joinErrors(
+ std::move(abstract_method_errors),
+ std::move(create_error("Abstract method {0}.{1} not allocated.",
+ obj_class_name.GetString(),
+ method_checker.first)));
break;
case AbstractMethodCheckerCases::eNotCallable:
- LLDB_LOG(GetLog(LLDBLog::Script),
- "Abstract method {0}.{1} not callable.",
- obj_class_name.GetString(), method_checker.first);
+ abstract_method_errors = llvm::joinErrors(
+ std::move(abstract_method_errors),
+ std::move(create_error("Abstract method {0}.{1} not callable.",
+ obj_class_name.GetString(),
+ method_checker.first)));
+ break;
+ case AbstractMethodCheckerCases::eInvalidArgumentCount:
+ abstract_method_errors = llvm::joinErrors(
+ std::move(abstract_method_errors),
+ std::move(create_error(
+ "Abstract method {0}.{1} has unexpected argument count.",
----------------
bulbazord wrote:
I don't think this error is actionable as-is. Is there a way you can include the argument count and the minimum number of arguments?
https://github.com/llvm/llvm-project/pull/109063
More information about the lldb-commits
mailing list