[lldb] Check for abstract methods implementation in Scripted Plugin Objects (#71260)
This patch enforces that every scripted object implements all the necessary abstract methods. Every scripted affordance language interface can implement a list of abstract methods name that checked when the object is instanciated. Since some scripting affordances implementations can be derived from template base classes, we can't check the object dictionary since it will contain the definition of the base class, so instead, this checks the scripting class dictionary. Previously, for the various python interfaces, we used `ABC.abstractmethod` decorators but this is too language specific and doesn't work for scripting affordances that are not derived from template base classes (i.e OperatingSystem, ScriptedThreadPlan, ...), so this patch provides generic/language-agnostic checks for every scripted affordance. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
This commit is contained in:
1 parent
14e7846d6e
commit
0a21144614
11 files changed
+236
-29
No files matched your search
+5
@@ -28,6 +28,11 @@ public:
|
||||
StructuredData::DictionarySP args_sp,
|
||||
StructuredData::Generic *script_obj = nullptr) override;
|
||||
|
||||
llvm::SmallVector<llvm::StringLiteral> GetAbstractMethods() const override {
|
||||
return llvm::SmallVector<llvm::StringLiteral>(
|
||||
{"get_stop_reason", "get_register_context"});
|
||||
}
|
||||
|
||||
lldb::tid_t GetThreadID() override;
|
||||
|
||||
std::optional<std::string> GetName() override;
|
||||
|
||||
Reference in new issue
Block a user