hhb updated this revision to Diff 223117.
hhb added a comment.

Fix comment


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67988/new/

https://reviews.llvm.org/D67988

Files:
  lldb/scripts/Python/finishSwigPythonLLDB.py
  lldb/scripts/finishSwigWrapperClasses.py

Index: lldb/scripts/finishSwigWrapperClasses.py
===================================================================
--- lldb/scripts/finishSwigWrapperClasses.py
+++ lldb/scripts/finishSwigWrapperClasses.py
@@ -5,8 +5,6 @@
 
     Overview:       Python script(s) to finish off the SWIG Python C++ Script
                     Bridge wrapper code on the Windows/LINUX/OSX platform.
-                    The Python scripts are equivalent to the shell script (.sh)
-                    files.
                     We use SWIG to create a C++ file containing the appropriate
                     wrapper classes and functions for each scripting language,
                     before liblldb is built (thus the C++ file can be compiled
@@ -293,11 +291,9 @@
 
     # Iterate script directory find any script language directories
     for scriptLang in listDirs:
-        # __pycache__ is a magic directory in Python 3 that holds .pyc files
-        if scriptLang != "__pycache__" and scriptLang != "swig_bot_lib":
-            dbg.dump_text("Executing language script for \'%s\'" % scriptLang)
-            nResult, strStatusMsg = run_post_process(
-                scriptLang, strFinishFileName, vDictArgs)
+        dbg.dump_text("Executing language script for \'%s\'" % scriptLang)
+        nResult, strStatusMsg = run_post_process(
+            scriptLang, strFinishFileName, vDictArgs)
         if nResult < 0:
             break
 
Index: lldb/scripts/Python/finishSwigPythonLLDB.py
===================================================================
--- lldb/scripts/Python/finishSwigPythonLLDB.py
+++ lldb/scripts/Python/finishSwigPythonLLDB.py
@@ -5,8 +5,6 @@
 
     Overview:       Python script(s) to post process SWIG Python C++ Script
                     Bridge wrapper code on the Windows/LINUX/OSX platform.
-                    The Python scripts are equivalent to the shell script (.sh)
-                    files.
                     For the Python script interpreter (external to liblldb) to
                     be able to import and use the lldb module, there must be
                     two files, lldb.py and _lldb.so, that it can find. lldb.py
@@ -599,7 +597,8 @@
 
 #++---------------------------------------------------------------------------
 # Details:  Determine where to put the files. Retrieve the directory path for
-#           Python's dist_packages/ site_package folder on a Windows platform.
+#           Python's dist_packages / site_package folder when build for traditional
+#           unix layout.
 # Args:     vDictArgs   - (R) Program input parameters.
 # Returns:  Bool - True = function success, False = failure.
 #           Str - Python Framework directory path.
@@ -608,13 +607,14 @@
 #--
 
 
-def get_framework_python_dir_windows(vDictArgs):
+def get_framework_python_dir_traditional(vDictArgs):
     dbg = utilsDebug.CDebugFnVerbose(
-        "Python script get_framework_python_dir_windows()")
+        "Python script get_framework_python_dir_traditional()")
     bOk = True
     strWkDir = ""
     strErrMsg = ""
 
+    dbg.dump_text("Built by LLVM")
     # We are being built by LLVM, so use the PYTHON_INSTALL_DIR argument,
     # and append the python version directory to the end of it.  Depending
     # on the system other stuff may need to be put here as well.
@@ -640,7 +640,7 @@
 
 #++---------------------------------------------------------------------------
 # Details:  Retrieve the directory path for Python's dist_packages/
-#           site_package folder on a UNIX style platform.
+#           site_package folder for macos framework.
 # Args:     vDictArgs   - (R) Program input parameters.
 # Returns:  Bool - True = function success, False = failure.
 #           Str - Python Framework directory path.
@@ -649,32 +649,27 @@
 #--
 
 
-def get_framework_python_dir_other_platforms(vDictArgs):
+def get_framework_python_dir_macos_framework(vDictArgs):
     dbg = utilsDebug.CDebugFnVerbose(
-        "Python script get_framework_python_dir_other_platform()")
+        "Python script get_framework_python_dir_macos_framework()")
     bOk = True
     strWkDir = ""
     strErrMsg = ""
     bDbg = "-d" in vDictArgs
 
-    bMakeFileCalled = "-m" in vDictArgs
-    if bMakeFileCalled:
-        dbg.dump_text("Built by LLVM")
-        return get_framework_python_dir_windows(vDictArgs)
+    dbg.dump_text("Built by XCode")
+    # We are being built by XCode, so all the lldb Python files can go
+    # into the LLDB.framework/Resources/Python subdirectory.
+    strWkDir = vDictArgs["--targetDir"]
+    strWkDir = os.path.join(strWkDir, "LLDB.framework")
+    if os.path.exists(strWkDir):
+        if bDbg:
+            print((strMsgFoundLldbFrameWkDir % strWkDir))
+        strWkDir = os.path.join(strWkDir, "Resources", "Python", "lldb")
+        strWkDir = os.path.normcase(strWkDir)
     else:
-        dbg.dump_text("Built by XCode")
-        # We are being built by XCode, so all the lldb Python files can go
-        # into the LLDB.framework/Resources/Python subdirectory.
-        strWkDir = vDictArgs["--targetDir"]
-        strWkDir = os.path.join(strWkDir, "LLDB.framework")
-        if os.path.exists(strWkDir):
-            if bDbg:
-                print((strMsgFoundLldbFrameWkDir % strWkDir))
-            strWkDir = os.path.join(strWkDir, "Resources", "Python", "lldb")
-            strWkDir = os.path.normcase(strWkDir)
-        else:
-            bOk = False
-            strErrMsg = strErrMsgFrameWkPyDirNotExist % strWkDir
+        bOk = False
+        strErrMsg = strErrMsgFrameWkPyDirNotExist % strWkDir
 
     return (bOk, strWkDir, strErrMsg)
 
@@ -697,17 +692,11 @@
     strWkDir = ""
     strErrMsg = ""
 
-    eOSType = utilsOsType.determine_os_type()
-    if eOSType == utilsOsType.EnumOsType.Unknown:
-        bOk = False
-        strErrMsg = strErrMsgOsTypeUnknown
-    elif eOSType == utilsOsType.EnumOsType.Windows:
-        bOk, strWkDir, strErrMsg = get_framework_python_dir_windows(vDictArgs)
+    bMakeFileCalled = "-m" in vDictArgs
+    if bMakeFileCalled:
+        return get_framework_python_dir_traditional(vDictArgs)
     else:
-        bOk, strWkDir, strErrMsg = get_framework_python_dir_other_platforms(
-            vDictArgs)
-
-    return (bOk, strWkDir, strErrMsg)
+        return get_framework_python_dir_macos_framework(vDictArgs)
 
 #++---------------------------------------------------------------------------
 # Details:  Retrieve the liblldb directory path, if it exists and is valid.
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to