blob: dc02ad9ab7c3b97e8d4a9efe6fcb94eb473e3985 [file] [log] [blame]
Zachary Turner9e845352015-10-27 22:54:46 +00001# Module level initialization for the `lldbsuite` module.
2
3import inspect
4import os
5import sys
6
7def find_lldb_root():
8 lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
9 while True:
10 lldb_root = os.path.dirname(lldb_root)
11 if lldb_root is None:
12 return None
13
14 test_path = os.path.join(lldb_root, "lldb.root")
15 if os.path.isfile(test_path):
16 return lldb_root
17 return None
18
19# lldbsuite.lldb_root refers to the root of the git/svn source checkout
20lldb_root = find_lldb_root()