2015-10-28 06:54:46 +08:00
|
|
|
# Module level initialization for the `lldbsuite` module.
|
|
|
|
|
|
|
|
import inspect
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-10-28 06:54:46 +08:00
|
|
|
def find_lldb_root():
|
|
|
|
lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
|
|
|
|
while True:
|
|
|
|
lldb_root = os.path.dirname(lldb_root)
|
|
|
|
if lldb_root is None:
|
|
|
|
return None
|
|
|
|
|
2015-11-21 01:40:57 +08:00
|
|
|
test_path = os.path.join(lldb_root, "use_lldb_suite_root.py")
|
2015-10-28 06:54:46 +08:00
|
|
|
if os.path.isfile(test_path):
|
|
|
|
return lldb_root
|
|
|
|
return None
|
|
|
|
|
|
|
|
# lldbsuite.lldb_root refers to the root of the git/svn source checkout
|
|
|
|
lldb_root = find_lldb_root()
|
2015-12-07 14:19:48 +08:00
|
|
|
|
|
|
|
# lldbsuite.lldb_test_root refers to the root of the python test tree
|
|
|
|
lldb_test_root = os.path.join(
|
|
|
|
lldb_root,
|
|
|
|
"packages",
|
|
|
|
"Python",
|
|
|
|
"lldbsuite",
|
|
|
|
"test")
|