summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-07-10 23:47:42 +0000
committerZachary Turner <zturner@google.com>2014-07-10 23:47:42 +0000
commit0ab4b48992cec1101c32e60a33d2d3c2503058f8 (patch)
tree56a87615d434932cfc683d87d2a018a7321b576d /lldb/scripts/Python
parent0902a51bafc72030d52a3c8d55b7b983a23fee75 (diff)
downloadbcm5719-llvm-0ab4b48992cec1101c32e60a33d2d3c2503058f8.tar.gz
bcm5719-llvm-0ab4b48992cec1101c32e60a33d2d3c2503058f8.zip
Get the python scripting interface working on Windows.
This patch fixes a number of issues with embedded Python on Windows. In particular: 1) The script that builds the python modules was normalizing the case of python filenames during copies. The module name is the filename, and is case-sensitive, so this was breaking code. 2) Changes the build to not attempt to link against python27.lib (e.g. the release library) when linking against msvcrt debug library. Doing a debug build of LLDB with embedded python support now requires you to provide your own self-compiled debug version of python. 3) Don't import termios when initializing the interpreter. This is part of a larger effort to remove the dependency on termios since it is not available on Windows. This particular instance was unnecessary and unused. Reviewed by: Todd Fiala Differential Revision: http://reviews.llvm.org/D4441 llvm-svn: 212785
Diffstat (limited to 'lldb/scripts/Python')
-rw-r--r--lldb/scripts/Python/finishSwigPythonLLDB.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/lldb/scripts/Python/finishSwigPythonLLDB.py b/lldb/scripts/Python/finishSwigPythonLLDB.py
index 2fc6f297358..a2e35c5b5fb 100644
--- a/lldb/scripts/Python/finishSwigPythonLLDB.py
+++ b/lldb/scripts/Python/finishSwigPythonLLDB.py
@@ -71,7 +71,7 @@ strMsgFrameWkPyExists = "Python output folder '%s' already exists";
strMsgFrameWkPyMkDir = "Python output folder '%s' will be created";
strErrMsgCreateFrmWkPyDirFailed = "Unable to create directory '%s' error: %s";
strMsglldbsoExists = "Symlink '%s' already exists";
-strMsglldbsoMk = "Creating symlink for _lldb.so";
+strMsglldbsoMk = "Creating symlink for _lldb.so (%s -> %s)";
strErrMsgCpLldbpy = "copying lldb to lldb package directory";
strErrMsgCreatePyPkgMissingSlash = "Parameter 3 fn create_py_pkg() missing slash";
strErrMsgMkLinkExecute = "Command mklink failed: %s";
@@ -135,7 +135,6 @@ def create_py_pkg( vDictArgs, vstrFrameworkPythonDir, vstrPkgDir, vListPkgFiles
strPkgName = vstrPkgDir;
strPkgName = "lldb" + strPkgName.replace( "/", "." );
- strPkgName = os.path.normcase( strPkgName );
strPkgDir = vstrFrameworkPythonDir;
strPkgDir += vstrPkgDir;
@@ -148,10 +147,9 @@ def create_py_pkg( vDictArgs, vstrFrameworkPythonDir, vstrPkgDir, vListPkgFiles
for strPkgFile in vListPkgFiles:
if os.path.exists( strPkgFile ) and os.path.isfile( strPkgFile ):
- strPyFile = os.path.normcase( strPkgFile );
if bDbg:
print(strMsgCreatePyPkgCopyPkgFile % (strPkgFile, strPkgDir));
- shutil.copy( strPyFile, strPkgDir );
+ shutil.copy( strPkgFile, strPkgDir );
# Create a packet init files if there wasn't one
strPkgIniFile = strPkgDir + "/__init__.py";
@@ -162,8 +160,7 @@ def create_py_pkg( vDictArgs, vstrFrameworkPythonDir, vstrPkgDir, vListPkgFiles
strPyScript = "__all__ = [";
strDelimiter = "";
for strPkgFile in vListPkgFiles:
- strPyFile = os.path.normcase( strPkgFile );
- if os.path.exists( strPyFile ) and os.path.isfile( strPyFile ):
+ if os.path.exists( strPkgFile ) and os.path.isfile( strPkgFile ):
strBaseName = os.path.basename( strPkgFile );
nPos = strBaseName.find( "." );
if nPos != -1:
@@ -257,7 +254,7 @@ def make_symlink_windows( vDictArgs, vstrFrameworkPythonDir, vstrDllName ):
return (bOk, strMsg);
if bDbg:
- print strMsglldbsoMk;
+ print strMsglldbsoMk % (os.path.abspath(strSrc), os.path.abspath(strTarget));
try:
csl = ctypes.windll.kernel32.CreateHardLinkW
OpenPOWER on IntegriCloud