summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/finishSwigPythonLLDB.py
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-01-26 17:23:18 +0000
committerZachary Turner <zturner@google.com>2015-01-26 17:23:18 +0000
commit0bf09687fb624c78e97d2546216558e25c9f4cb3 (patch)
tree92522a714cb47c10b23ad15dd1fadd89b62f9bf3 /lldb/scripts/Python/finishSwigPythonLLDB.py
parent078b612de1ea10c7c0bf2645b9bcdcf12086f522 (diff)
downloadbcm5719-llvm-0bf09687fb624c78e97d2546216558e25c9f4cb3.tar.gz
bcm5719-llvm-0bf09687fb624c78e97d2546216558e25c9f4cb3.zip
Fix darwin-debug build in cmake (OS X)
This patch fixes test_launch_in_terminal test which doesn't work in OS X since the moment as it was added in r225284. The test fails because Target::Launch returns the following error: "the darwin-debug executable doesn't exist at <output_dir>/lib/python2.7/site-packages/lldb/darwin-debug'". Patch by Ilia K Differential Revision: http://reviews.llvm.org/D7102 llvm-svn: 227096
Diffstat (limited to 'lldb/scripts/Python/finishSwigPythonLLDB.py')
-rw-r--r--lldb/scripts/Python/finishSwigPythonLLDB.py60
1 files changed, 58 insertions, 2 deletions
diff --git a/lldb/scripts/Python/finishSwigPythonLLDB.py b/lldb/scripts/Python/finishSwigPythonLLDB.py
index f17b9159681..978b0d67091 100644
--- a/lldb/scripts/Python/finishSwigPythonLLDB.py
+++ b/lldb/scripts/Python/finishSwigPythonLLDB.py
@@ -330,6 +330,53 @@ def make_symlink_other_platforms( vDictArgs, vstrFrameworkPythonDir, vstrSoPath
return (bOk, strMsg);
#++---------------------------------------------------------------------------
+# Details: Make the symbolic link to the darwin-debug. Code for all platforms
+# apart from Windows.
+# Args: vDictArgs - (R) Program input parameters.
+# vstrFrameworkPythonDir - (R) Python framework directory.
+# vstrDarwinDebugFileName - (R) File name for darwin-debug.
+# Returns: Bool - True = function success, False = failure.
+# Str - Error description on task failure.
+# Throws: None.
+#--
+def make_symlink_darwin_debug( vDictArgs, vstrFrameworkPythonDir, vstrDarwinDebugFileName ):
+ dbg = utilsDebug.CDebugFnVerbose( "Python script make_symlink_other_platforms()" );
+ bOk = True;
+ strMsg = "";
+ bDbg = vDictArgs.has_key( "-d" );
+ strTarget = vstrDarwinDebugFileName
+ strDarwinDebugPath = "%s/%s" % (vstrFrameworkPythonDir, strTarget);
+ strTarget = os.path.normcase( strDarwinDebugPath );
+ strSrc = "";
+
+ os.chdir( vstrFrameworkPythonDir );
+ bMakeFileCalled = vDictArgs.has_key( "-m" );
+ if not bMakeFileCalled:
+ return (bOk, strMsg);
+ else:
+ strSrc = os.path.normcase( "../../../../bin/lldb-launcher" );
+
+ if os.path.islink( strTarget ):
+ if bDbg:
+ print strMsglldbsoExists % strTarget;
+ return (bOk, strMsg);
+
+ if bDbg:
+ print strMsglldbsoMk;
+
+ try:
+ os.symlink( strSrc, strTarget );
+ except OSError as e:
+ bOk = False;
+ strMsg = "OSError( %d ): %s %s" % (e.errno, e.strerror, strErrMsgMakeSymlink);
+ strMsg += " Src:'%s' Target:'%s'" % (strSrc, strTarget);
+ except:
+ bOk = False;
+ strMsg = strErrMsgUnexpected % sys.exec_info()[ 0 ];
+
+ return (bOk, strMsg);
+
+#++---------------------------------------------------------------------------
# Details: Make the symlink that the script bridge for Python will need in
# the Python framework directory.
# Args: vDictArgs - (R) Program input parameters.
@@ -343,9 +390,10 @@ def make_symlink( vDictArgs, vstrFrameworkPythonDir ):
bOk = True;
strWkDir = "";
strErrMsg = "";
- strSoFileName = "_lldb";
-
eOSType = utilsOsType.determine_os_type();
+
+ # Make symlink for _lldb
+ strSoFileName = "_lldb";
if eOSType == utilsOsType.EnumOsType.Unknown:
bOk = False;
strErrMsg = strErrMsgOsTypeUnknown;
@@ -357,6 +405,14 @@ def make_symlink( vDictArgs, vstrFrameworkPythonDir ):
bOk, strErrMsg = make_symlink_other_platforms( vDictArgs,
vstrFrameworkPythonDir,
strSoFileName );
+
+ # Make symlink for darwin-debug
+ strDarwinDebugFileName = "darwin-debug"
+ if bOk and eOSType == utilsOsType.EnumOsType.Darwin:
+ bOk, strErrMsg = make_symlink_darwin_debug( vDictArgs,
+ vstrFrameworkPythonDir,
+ strDarwinDebugFileName );
+
return (bOk, strErrMsg);
#++---------------------------------------------------------------------------
OpenPOWER on IntegriCloud