Hi Larry,


Like Pavel suggests, the option for installing Python debug binaries is here:



[cid:image001.png@01D57206.80F88AC0]


You would need to re-start the Python installer, and choose “Customize 
installation”, then you get an “Optional features” page, then a second menu 
page “Advanced Options” where you need to select “Download debug binaries”. 
This will create the python_d.exe that LLDB needs. Ensure that -DPYTHON_HOME 
properly points to the folder that you choose during installation. Also ensure 
that you have the GnuWin32<http://gnuwin32.sourceforge.net/> tools installed 
and visible in %PATH%, otherwise the LLDB tests won’t work.

Best,
Alex.



-----Message d'origine-----
De : lldb-dev <lldb-dev-boun...@lists.llvm.org> De la part de Pavel Labath via 
lldb-dev
Envoyé : September 23, 2019 7:56 AM
À : Larry D'Anna <lawrence_da...@apple.com>; lldb-dev@lists.llvm.org
Objet : Re: [lldb-dev] help, how to get a debug build on windows 
(python37_d.lib)



On 22/09/2019 20:20, Larry D'Anna via lldb-dev wrote:

> Hi lldb-dev.

>

> I can’t seem to figure out how to build a debug lldb on windows.   It

> wants to link against a debug version of Python, which isn’t there.

>

> My cmake line looks like this:

>

> cmake -G Ninja `

>          "-DPYTHON_HOME=C:\Program Files (x86)\Microsoft Visual

> Studio\Shared\Python37_64" `

>          "-DLLVM_ENABLE_PROJECTS=clang;lldb;libcxx;libcxxabi;lld" `

> "-DSWIG_EXECUTABLE=C:\ProgramData\chocolatey\bin\swig.exe" `

>          "C:\Users\smoofra\llvm-project\llvm"

>

> I also made this change, to tell it to link against the release python.

>

> --- a/lldb/cmake/modules/LLDBConfig.cmake

> +++ b/lldb/cmake/modules/LLDBConfig.cmake

> @@ -227,7 +227,7 @@ function(find_python_libs_windows)

>     else()

>       # Lookup for concrete python installation depending on build

> type

>       if (CMAKE_BUILD_TYPE STREQUAL Debug)

> -      set(LOOKUP_DEBUG_PYTHON TRUE)

> +      set(LOOKUP_DEBUG_PYTHON FALSE)

>       else()

>         set(LOOKUP_DEBUG_PYTHON FALSE)

>       endif()

>

> But somehow at the very end, the link still fails because

> python37_d.lib isn’t there.

>

> Anybody know what I’m doing wrong?  Thank you.

>



Hi Larry,



I don't know the full details, but it is my understanding that due to how 
windows runtime libraries work (they have a separate debug and release CRT), 
all libraries in a single application need be linked against the same CRT 
flavour. IIRC, the default python installation does not come with a debug 
python, but it should be possible to install it somehow (possibly via checking 
some box in the installation dialog, but I don't remember the details).



It should also be possible to create a "fake" debug build by setting the 
CMAKE_BUILD_TYPE to Release, and enabling debug info (and disabling

optimizations) via CMAKE_CXX_FLAGS, but it's probably better to just get the 
debug python installed.



pl

_______________________________________________

lldb-dev mailing list

lldb-dev@lists.llvm.org<mailto:lldb-dev@lists.llvm.org>

https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to