diff options
Diffstat (limited to 'lldb/scripts')
| -rw-r--r-- | lldb/scripts/Python/finishSwigPythonLLDB.py | 6 | ||||
| -rw-r--r-- | lldb/scripts/buildSwigWrapperClasses.py | 2 | ||||
| -rw-r--r-- | lldb/scripts/finishSwigWrapperClasses.py | 2 | ||||
| -rw-r--r-- | lldb/scripts/use_lldb_suite.py | 22 |
4 files changed, 30 insertions, 2 deletions
diff --git a/lldb/scripts/Python/finishSwigPythonLLDB.py b/lldb/scripts/Python/finishSwigPythonLLDB.py index 45cb8b98887..d6eb10d6c99 100644 --- a/lldb/scripts/Python/finishSwigPythonLLDB.py +++ b/lldb/scripts/Python/finishSwigPythonLLDB.py @@ -350,8 +350,10 @@ def make_symlink_liblldb( vDictArgs, vstrFrameworkPythonDir, vstrLiblldbFileName if eOSType == utilsOsType.EnumOsType.Windows: # When importing an extension module using a debug version of python, you # write, for example, "import foo", but the interpreter searches for - # "foo_d.pyd" - if is_debug_interpreter(): + # "foo_d.pyd". This only applies for Python 2, however. Python 3 does + # not use the _d suffix for extension modules. + import six + if is_debug_interpreter() and six.PY2: strTarget += "_d"; strTarget += ".pyd"; else: diff --git a/lldb/scripts/buildSwigWrapperClasses.py b/lldb/scripts/buildSwigWrapperClasses.py index ff5cfb737de..a9fa7ca6cd2 100644 --- a/lldb/scripts/buildSwigWrapperClasses.py +++ b/lldb/scripts/buildSwigWrapperClasses.py @@ -31,6 +31,8 @@ import os # Provide directory and file handling # Third party modules: # In-house modules: +import use_lldb_suite # Modify sys.path so we can use shared / third-party libraries + import utilsArgsParse # Parse and validate this script's input arguments import utilsOsType # Determine the OS type this script is running on import utilsDebug # Debug Python scripts diff --git a/lldb/scripts/finishSwigWrapperClasses.py b/lldb/scripts/finishSwigWrapperClasses.py index 3e576263562..b58211862f0 100644 --- a/lldb/scripts/finishSwigWrapperClasses.py +++ b/lldb/scripts/finishSwigWrapperClasses.py @@ -29,6 +29,8 @@ import os # Provide directory and file handling # Third party modules: # In-house modules: +import use_lldb_suite # Modify sys.path so we can use shared / third-party libraries + import utilsArgsParse # Parse and validate this script's input arguments import utilsOsType # Determine the OS type this script is running on import utilsDebug # Debug Python scripts diff --git a/lldb/scripts/use_lldb_suite.py b/lldb/scripts/use_lldb_suite.py new file mode 100644 index 00000000000..3dbcbb91700 --- /dev/null +++ b/lldb/scripts/use_lldb_suite.py @@ -0,0 +1,22 @@ +import inspect +import os +import sys + +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 + + test_path = os.path.join(lldb_root, "lldb.root") + if os.path.isfile(test_path): + return lldb_root + return None + +lldb_root = find_lldb_root() +if lldb_root is not None: + import imp + module = imp.find_module("use_lldb_suite_root", [lldb_root]) + if module is not None: + imp.load_module("use_lldb_suite_root", *module) |

