aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2023-11-07 22:01:21 -0800
committerMed Ismail Bennani <ismail@bennani.ma>2023-11-07 22:01:41 -0800
commit0a21144614950ce063d8dac6394307bd3be604cd (patch)
tree4cd20f82195bfc848452b035cb7e4bd177ca555f /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
parent14e7846d6e2c5c99c52ba3882e59bfb021a5f0fa (diff)
downloadllvm-0a21144614950ce063d8dac6394307bd3be604cd.zip
llvm-0a21144614950ce063d8dac6394307bd3be604cd.tar.gz
llvm-0a21144614950ce063d8dac6394307bd3be604cd.tar.bz2
[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>
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
index 012f16e..82eee76 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
@@ -562,6 +562,8 @@ public:
static bool Check(PyObject *py_obj);
+ bool HasKey(const llvm::Twine &key) const;
+
uint32_t GetSize() const;
PythonList GetKeys() const;