[all-commits] [llvm/llvm-project] c4962f: [lldb/script] Add scripting extension template gen...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Fri Jul 17 16:21:22 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c4962f5721a36e198234019b846d3788738f766a
      https://github.com/llvm/llvm-project/commit/c4962f5721a36e198234019b846d3788738f766a
  Author: Med Ismail Bennani <ismail at bennani.ma>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M lldb/include/lldb/Core/PluginManager.h
    M lldb/include/lldb/Interpreter/ScriptInterpreter.h
    M lldb/source/Commands/CommandObjectScripting.cpp
    M lldb/source/Commands/Options.td
    M lldb/source/Core/PluginManager.cpp
    M lldb/source/Interpreter/ScriptInterpreter.cpp
    M lldb/source/Interpreter/embedded_interpreter.py
    M lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
    A lldb/test/API/functionalities/scripting_extension_generate/Makefile
    A lldb/test/API/functionalities/scripting_extension_generate/TestScriptingExtensionGenerate.py
    A lldb/test/API/functionalities/scripting_extension_generate/main.c

  Log Message:
  -----------
  [lldb/script] Add scripting extension template generator (#209647)

This patch adds a `scripting extension generate <ExtensionType>...`
command that introspects a Python extension base class and emits a
skeleton subclass with `# TODO: Implement` stubs for its abstract
methods (or, with `-a`, every method), then opens the result in an
editor.

Generated imports use `from <module> import <class>`, and the generated
`__init__` forwards its arguments to `super().__init__(...)` since every
base class relies on its constructor to set up attributes
(`self.target`, `self.process`, ...) that inherited, non-overridden
methods depend on. When the host can't open an external editor (e.g.
non-macOS), the command reports that as a message rather than an error,
since the file is already written.

To catch regressions in the generator itself instead of just checking
that a file was produced, this patch adds
`TestScriptingExtensionGenerate.py`, which generates a template for
every extension kind on the fly and drives it through a live lldb
session (`process launch -C`, `breakpoint set -P`, `target stop-hook add
-P`, etc.).

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list