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