]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - use_lldb_suite_root.py
Vendor import of lldb release_39 branch r287912:
[FreeBSD/FreeBSD.git] / use_lldb_suite_root.py
1 import inspect
2 import os
3 import sys
4
5 def add_third_party_module_dirs(lldb_root):
6     third_party_modules_dir = os.path.join(lldb_root, "third_party", "Python", "module")
7     if not os.path.isdir(third_party_modules_dir):
8         return
9
10     module_dirs = os.listdir(third_party_modules_dir)
11     for module_dir in module_dirs:
12         module_dir = os.path.join(third_party_modules_dir, module_dir)
13         sys.path.insert(0, module_dir)
14
15 def add_lldbsuite_packages_dir(lldb_root):
16     packages_dir = os.path.join(lldb_root, "packages", "Python")
17     sys.path.insert(0, packages_dir)
18
19 lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
20
21 add_third_party_module_dirs(lldb_root)
22 add_lldbsuite_packages_dir(lldb_root)