aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/bindings/python/createPythonInit.py
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-04 19:20:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-08 19:02:26 +0000
commit81ad626541db97eb356e2c1d4a20eb2a26a766ab (patch)
tree311b6a8987c32b1e1dcbab65c54cfac3fdb56175 /contrib/llvm-project/lldb/bindings/python/createPythonInit.py
parent5fff09660e06a66bed6482da9c70df328e16bbb6 (diff)
parent145449b1e420787bb99721a429341fa6be3adfb6 (diff)
Diffstat (limited to 'contrib/llvm-project/lldb/bindings/python/createPythonInit.py')
-rw-r--r--contrib/llvm-project/lldb/bindings/python/createPythonInit.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/llvm-project/lldb/bindings/python/createPythonInit.py b/contrib/llvm-project/lldb/bindings/python/createPythonInit.py
index 3deb9159b702..4ad7320675f4 100644
--- a/contrib/llvm-project/lldb/bindings/python/createPythonInit.py
+++ b/contrib/llvm-project/lldb/bindings/python/createPythonInit.py
@@ -10,6 +10,14 @@ importNames = ', '.join('"{}"'.format(getFileName(f)) for f in pkgFiles)
script = """__all__ = [{import_names}]
for x in __all__:
__import__('lldb.{pkg_name}.' + x)
+
+def __lldb_init_module(debugger, internal_dict):
+ import lldb
+ for x in __all__:
+ submodule = getattr(lldb.{pkg_name}, x)
+ lldb_init = getattr(submodule, '__lldb_init_module', None)
+ if lldb_init:
+ lldb_init(debugger, internal_dict)
""".format(import_names=importNames, pkg_name=pkgRelDir.replace("/", "."))
pkgIniFile = os.path.normpath(os.path.join(pkgRelDir, "__init__.py"))