Author: cbieneman
Date: Wed Oct 12 15:15:46 2016
New Revision: 284041

Fix lookup path for lldb-mi

The test suite calls realpath on the lldb executable then append "-mi" to it to 
find the path of the lldb-mi executable. This does not work when using CMake 
builds on *nix platforms. On *nix platforms when a version number is set on 
executables CMake generates the binary as ${name}-${version} with a symlink 
named ${name} pointing to it.

This results in the lldb executable being named lldb-4.0.0, and since 
lldb-4.0.0-mi doesn't ever match the lldb-mi executable these tests are always 

This patch looks for lldb-mi in the same directory as lldb.

Reviewers: zturner, tfiala

Subscribers: ki.stfu, enlight, lldb-commits

Differential Revision:


Modified: lldb/trunk/packages/Python/lldbsuite/test/
--- lldb/trunk/packages/Python/lldbsuite/test/ (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/ Wed Oct 12 15:15:46 2016
@@ -673,16 +673,17 @@ def setupSysPath():
     # Assume lldb-mi is in same place as lldb
     # If not found, disable the lldb-mi tests
-    lldbMiExec = None
-    if lldbtest_config.lldbExec and is_exe(lldbtest_config.lldbExec + "-mi"):
-        lldbMiExec = lldbtest_config.lldbExec + "-mi"
-    if not lldbMiExec:
+    # TODO: Append .exe on Windows
+    #   - this will be in a separate commit in case the mi tests fail horribly
+    lldbDir = os.path.dirname(lldbtest_config.lldbExec)
+    lldbMiExec = os.path.join(lldbDir, "lldb-mi")
+    if is_exe(lldbMiExec):
+        os.environ["LLDBMI_EXEC"] = lldbMiExec
+    else:
         if not configuration.shouldSkipBecauseOfCategories(["lldb-mi"]):
                 "The 'lldb-mi' executable cannot be located.  The lldb-mi 
tests can not be run as a result.")
-    else:
-        os.environ["LLDBMI_EXEC"] = lldbMiExec
     lldbPythonDir = None  # The directory that contains 'lldb/'
     if configuration.lldbFrameworkPath:

lldb-commits mailing list

Reply via email to