blob: 4d7a92da7612d5244e8ee5729dd8241564eff84c [file] [log] [blame]
Zachary Turner8741e312015-10-20 21:05:57 +00001import inspect
2import os
3import sys
4
5def find_lldb_root():
6 lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
7 while True:
8 lldb_root = os.path.dirname(lldb_root)
9 if lldb_root is None:
10 return None
11
12 test_path = os.path.join(lldb_root, "lldb.root")
13 if os.path.isfile(test_path):
14 return lldb_root
15 return None
16
17lldb_root = find_lldb_root()
18if lldb_root is not None:
19 import imp
20 module = imp.find_module("lldb_shared_base", [lldb_root])
21 if module is not None:
22 imp.load_module("lldb_shared_base", *module)