[all-commits] [llvm/llvm-project] 0a2114: [lldb] Check for abstract methods implementation i...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Tue Nov 7 22:02:10 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0a21144614950ce063d8dac6394307bd3be604cd
      https://github.com/llvm/llvm-project/commit/0a21144614950ce063d8dac6394307bd3be604cd
  Author: Med Ismail Bennani <ismail at bennani.ma>
  Date:   2023-11-07 (Tue, 07 Nov 2023)

  Changed paths:
    M lldb/include/lldb/Interpreter/Interfaces/ScriptedInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPlatformPythonInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPythonInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
    M lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
    A lldb/test/API/functionalities/scripted_process/missing_methods_scripted_process.py
    M lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

  Log Message:
  -----------
  [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 at bennani.ma>




More information about the All-commits mailing list