[lldb-dev] Python scripting in Windows LLDB

Ted Woodward via lldb-dev lldb-dev at lists.llvm.org
Fri Jun 30 12:39:32 PDT 2017


Python support on Windows is much more problematic than support on something like MacOS or Linux. The python you use when you run lldb must be the same python used when you build it. Bad things happen – warnings, crashes, etc – when you use a different rev of the dll/so or the library directory (which contains dlls/sos) than what was used when building lldb. MacOS and various Linux distros ship with a fixed version of python, so lldb can be built with that version. Windows doesn’t have a default python, so you need to make sure that your user has the same version of python that lldb was built with.

 

For the Hexagon tools, we ship the python dll/so and the library directory that we built with. We use 3.5.1 on Windows, and 2.7.8 on Linux. On Linux, we set RPATH to ../lib, so lldb/liblldb.so can find libpython.so. On both, we set a cmake variable LLDB_DEFAULT_PYTHONHOME, and use it when initializing python to point lldb to the path where our python library is installed. This code isn’t upstreamed, but I can upstream it if the community would like it.

 

Another issue on Windows is the python installation integrity check in cmake/modules/LLDBConfig.cmake. It checks to see if python is installed correctly like this:

if (NOT (PYTHON_DEBUG_EXE AND PYTHON_RELEASE_EXE AND PYTHON_DEBUG_LIB AND PYTHON_RELEASE_LIB AND PYTHON_DEBUG_DLL AND PYTHON_RELEASE_DLL))

    message("Python installation is corrupt. Python support will be disabled for this build.")

    set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)

    return()

  endif()

 

 

If you don’t have the debug version of python installed (as is the case on our builders), this check will fail, and python will be turned off. Internally, I break this check up into debug and release checks, based on the value of CMAKE_BUILD_TYPE. I also don’t check for the release dll, because our builders don’t have that.  I can also upstream this if the community is interested.

 

Ted

 

--

Qualcomm Innovation Center, Inc.

The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

 

From: lldb-dev [mailto:lldb-dev-bounces at lists.llvm.org] On Behalf Of Jamie Madill via lldb-dev
Sent: Thursday, June 29, 2017 10:30 AM
To: lldb-dev at lists.llvm.org
Subject: [lldb-dev] Python scripting in Windows LLDB

 

A ping for this regression - Ted Woodward seems to have had a patch for fixing broken Windows scripting support but the 5.0.0 snapshot release didn't have the fix. Is it possible to land that patch for the next snapshot?

 

This is currently breaking LLDB Visual Studio Code integration on Windows (for context, see https://github.com/vadimcn/vscode-lldb/issues/37 .)

 

Thanks!

Jamie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170630/7fe16e96/attachment.html>


More information about the lldb-dev mailing list