<div dir="ltr">Thanks! I will probably not be able to test it until Monday as the holiday starts soon, but I will fix anything up unless someone beats me to it.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jul 2, 2014 at 2:20 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Following up on pipe support for windows, I added a host layer which should improve things on windows. Please test the changes and make them work if I didn't catch everything as I can't build on windows, but tried to get everything right. The commit was:<br>
<br>
% svn commit<br>
Sending include/lldb/Core/ConnectionFileDescriptor.h<br>
Adding include/lldb/Host/Pipe.h<br>
Sending lldb.xcodeproj/project.pbxproj<br>
Sending source/Core/ConnectionFileDescriptor.cpp<br>
Sending source/Host/common/CMakeLists.txt<br>
Adding source/Host/common/Pipe.cpp<br>
Sending source/Interpreter/ScriptInterpreterPython.cpp<br>
Sending source/Target/Process.cpp<br>
Transmitting file data ........<br>
Committed revision 212220.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> On Jul 2, 2014, at 1:23 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
><br>
> Ahh, yea that was it. Strange, I actually did a recursive file search from the root and it didn't find anything.<br>
><br>
><br>
> On Wed, Jul 2, 2014 at 1:21 PM, Deepak Panickal <<a href="mailto:deepak@codeplay.com">deepak@codeplay.com</a>> wrote:<br>
> The LLDB python package is created within the build directory.<br>
> Assuming it's a debug build, could you check llvm/build/Debug/lib/site-packages?<br>
><br>
><br>
> On 02/07/2014 21:19, Zachary Turner wrote:<br>
>> So it seems something is still wrong. I'm generating the build files with this command:<br>
>><br>
>> cmake -G Ninja -DLLDB_DISABLE_PYTHON=0 -DPYTHON_INCLUDE_DIR=c:\Python27\include -DPYTHON_LIBRARY=C:\Python27\libs\python27.lib ..\..<br>
>><br>
>> (I have the patch I posted in the other thread applied, so LLDB_DISABLE_PYTHON=0 implies LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION=1)<br>
>><br>
>> I successfully run a build, and after the build I observe the following:<br>
>><br>
>> 1) LLDBWrapPython.cpp and lldb.py are in llvm/build/ninja/tools/lldb/scripts<br>
>><br>
>> 2) There is no _lldb.pyd anywhere.<br>
>><br>
>> 3) My Python is installed in C:\Python27, and C:\Python27\Lib\site-packages is empty.<br>
>><br>
>> #2 and #3 seem like an error, am I doing something wrong in my build?<br>
>><br>
>><br>
>> On Wed, Jul 2, 2014 at 12:27 PM, Deepak Panickal <<a href="mailto:deepak@codeplay.com">deepak@codeplay.com</a>> wrote:<br>
>> That problem is due to PYTHONPATH not being exported to the location where the python packages are built.<br>
>> Similar to Linux, you have to export PYTHONPATH to build_dir/lib/site-packages/python.<br>
>> The _lldb.pyd file symlinks to liblldb.dll on Windows.<br>
>><br>
>> Regardles, you would still get an error on the command-line due to the missing python termios module on Windows.<br>
>> In ScriptInterpreterPython.cpp:2628, the termios module is imported, which would fail immediately.<br>
>><br>
>><br>
>> PyRun_SimpleString<br>
>><br>
>><br>
>> (<br>
>> "sys.dont_write_bytecode<br>
>><br>
>> = 1; import lldb.embedded_interpreter; from<br>
>> lldb.embedded_interpreter import<br>
>> run_python_interpreter; from<br>
>> lldb.embedded_interpreter import run_one_line;<br>
>> from termios import *"<br>
>> );<br>
>><br>
>> We have yet to solve this dependency on Windows.<br>
>> However, we can use the API directly for now.<br>
>><br>
>> AFAIK, these modules are only used for the command-line interpreter, so does not affect using the API directly.<br>
>> If we comment out these out, we can run the examples in lldb/examples/python/, such as globals.py to load an ELF file and dump the globals using the Python API on Windows.<br>
>><br>
>> Thanks,<br>
>> Deepak<br>
>><br>
>><br>
>> On 02/07/2014 19:48, Zachary Turner wrote:<br>
>>> One more problem. Compiled successfully, and ran LLDB. Upon startup I get this warning:<br>
>>><br>
>>> Traceback (most recent call last):<br>
>>> File "<string>", line 1, in <module><br>
>>> ImportError: No module named lldb.embedded_interpreter<br>
>>> (lldb)<br>
>>><br>
>>> So something is wrong there. Typing "script" with no arguments gives this:<br>
>>><br>
>>> Traceback (most recent call last):<br>
>>> File "<string>", line 1, in <module><br>
>>> NameError: name 'run_one_line' is not defined<br>
>>> Traceback (most recent call last):<br>
>>> File "<string>", line 1, in <module><br>
>>> NameError: name 'run_one_line' is not defined<br>
>>> Traceback (most recent call last):<br>
>>> File "<string>", line 1, in <module><br>
>>> NameError: name 'run_one_line' is not defined<br>
>>> Traceback (most recent call last):<br>
>>> File "<string>", line 1, in <module><br>
>>> NameError: name 'run_one_line' is not defined<br>
>>> Traceback (most recent call last):<br>
>>> File "<string>", line 1, in <module><br>
>>> NameError: name 'run_one_line' is not defined<br>
>>><br>
>>> Just curious, what has been your use case for this so far? Do you have it working on your end? If so, what kind of things can you successfully do with it?<br>
>>><br>
>>><br>
>>> On Tue, Jul 1, 2014 at 4:52 PM, Deepak Panickal <<a href="mailto:deepak@codeplay.com">deepak@codeplay.com</a>> wrote:<br>
>>> Thanks, I'll look into the CMake warning.<br>
>>><br>
>>> For now, you have to enable the variable LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION specifically to use the new python scripts, when LLDB_DISABLE_PYTHON is disabled.<br>
>>> Which is why not using the variable would break the build on Windows. On Linux, it would work both ways.<br>
>>><br>
>>> I added this variable so that the new scripts can be tested without affecting normal builds on other platforms.<br>
>>> Could you please try,<br>
>>> cmake -DLLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION=1 -DLLDB_DISABLE_PYTHON=0 -DPYTHON_INCLUDE_DIR=c:\python27\include -DPYTHON_LIBRARY=C:\Python27\libs\python27.lib ..\..<br>
>>><br>
>>> Thanks,<br>
>>> Deepak<br>
>>><br>
>>><br>
>>> On 01/07/2014 23:56, Zachary Turner wrote:<br>
>>>> Also getting the following error:<br>
>>>><br>
>>>> For reference, I ran cmake as<br>
>>>><br>
>>>> cmake -DLLDB_DISABLE_PYTHON=0 -DPYTHON_INCLUDE_DIR=c:\python27\include -DPYTHON_LIBRARY=C:\Python27\libs\python27.lib ..\..<br>
>>>><br>
>>>> D:\src\llvm\build\ninja>ninja lldb<br>
>>>> [88/433] Building lldb python wrapper<br>
>>>> FAILED: cmd.exe /c cd /D D:\src\llvm\build\ninja\tools\lldb\scripts && env PYTHON_EXECUTABLE=C:/Python27/python.exe D:/src/llvm/tools/lldb/scripts/build-swig-wrapper-classes.sh D:/src/llvm/tools/lldb D:/src/llvm/build/ninja/tools/lldb/scripts D:/src/llvm/build/ninja/tools/lldb/scripts D:/src/llvm/bu<br>
>>>> ild/ninja -m && env PYTHON_EXECUTABLE=C:/Python27/python.exe D:/src/llvm/tools/lldb/scripts/finish-swig-wrapper-classes.sh D:/src/llvm/tools/lldb D:/src/llvm/build/ninja/tools/lldb/scripts D:/src/llvm/build/ninja/tools/lldb/scripts D:/src/llvm/build/ninja -m<br>
>>>> env: D:/src/llvm/tools/lldb/scripts/build-swig-wrapper-classes.sh: Exec format error<br>
>>>> [88/433] Building CXX object tools\lldb\source\Plugins\Process\mach-core\CMakeFiles\lldbPluginProcessMachCore.dir\ProcessMachCore.cpp.obj<br>
>>>> ninja: build stopped: subcommand failed.<br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Tue, Jul 1, 2014 at 3:41 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
>>>> I get the following warning when running cmake with no special options passed via -D<br>
>>>><br>
>>>> CMake Warning (dev) at tools/lldb/CMakeLists.txt:234 (target_link_libraries):<br>
>>>> Policy CMP0023 is not set: Plain and keyword target_link_libraries<br>
>>>> signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy<br>
>>>> details. Use the cmake_policy command to set the policy and suppress this<br>
>>>> warning.<br>
>>>><br>
>>>> The keyword signature for target_link_libraries has already been used with<br>
>>>> the target "liblldb". All uses of target_link_libraries with a target<br>
>>>> should be either all-keyword or all-plain.<br>
>>>><br>
>>>> The uses of the keyword signature are here:<br>
>>>><br>
>>>> * cmake/modules/AddLLVM.cmake:331 (target_link_libraries)<br>
>>>><br>
>>>> Call Stack (most recent call first):<br>
>>>> tools/lldb/source/CMakeLists.txt:214 (add_lldb_library)<br>
>>>> This warning is for project developers. Use -Wno-dev to suppress it.<br>
>>>><br>
>>>><br>
>>>> On Tue, Jul 1, 2014 at 10:54 AM, Deepak Panickal <<a href="mailto:deepak@codeplay.com">deepak@codeplay.com</a>> wrote:<br>
>>>> Hi,<br>
>>>><br>
>>>> I'm planning to upstream the Windows Python API changes now.<br>
>>>><br>
>>>> This has been done by completely rewriting the shell scripts used for the API generation in Python so that it's portable across different platforms. We have tested it on both Windows and Linux successfully.<br>
>>>><br>
>>>> I have added a new CMake variable "LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION", to control if the new Python scripts for managing SWIG generating the API are enabled or not. This is disabled by default to not impact other platforms. This variable can be removed once we move all the platforms to the Python scripts from the shell scripts. There's some cleanup to be done, which I'll be working on.<br>
>>>><br>
>>>> Please let me know if there are any issues or comments.<br>
>>>><br>
>>>> Thanks,<br>
>>>> Deepak<br>
>>>><br>
>>>><br>
>>>> On 24/06/14 12:23, Deepak Panickal wrote:<br>
>>>>> Yes, it was compiling with MSVC 2013. It hasn't been updated though since the review was submitted.<br>
>>>>> We're working on it now, so should be fixed to current tip and upstreamed soon.<br>
>>>>><br>
>>>>> Thanks,<br>
>>>>> Deepak<br>
>>>>><br>
>>>>> On 24/06/14 01:24, Zachary Turner wrote:<br>
>>>>>> By the way, does this compile with MSVC 2013? Many of the changes I had to make to get things compiling don't seem to be present in this patch.<br>
>>>>>><br>
>>>>>><br>
>>>>>> On Mon, Jun 23, 2014 at 5:16 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
>>>>>> Interesting. I had already made some progress towards this in my own branch, so I'll have a look.<br>
>>>>>><br>
>>>>>> BTW, I'm not sure what your solution was regarding the missing python modules, but the pexpect one in particualr is pretty trivial to fix. Just change it to subprocess.run() and remove the import of pexpect.<br>
>>>>>><br>
>>>>>><br>
>>>>>> On Mon, Jun 23, 2014 at 5:09 PM, Deepak Panickal <<a href="mailto:deepak@codeplay.com">deepak@codeplay.com</a>> wrote:<br>
>>>>>> We have already ported the lldb.py generating scripts to Python for portability and got the API working in Windows and Linux.<br>
>>>>>> We can load an ELF file, dump symbols, do remote debugging etc.<br>
>>>>>> This work has been put into review sometime ago, so might need some updation.<br>
>>>>>><br>
>>>>>> <a href="http://reviews.llvm.org/D2980" target="_blank">http://reviews.llvm.org/D2980</a><br>
>>>>>><br>
>>>>>> We're planning to fix it up quite soon to match with the current tip.<br>
>>>>>><br>
>>>>>> Thanks,<br>
>>>>>> Deepak<br>
>>>>>><br>
>>>>>><br>
>>>>>> On 23/06/2014 22:09, Zachary Turner wrote:<br>
>>>>>>> I'm already volunteering, just want to make sure it's ok before I do the work :)<br>
>>>>>>><br>
>>>>>>> That being said, Greg mentions in an earlier message that it might not be possible because we wish to support a Python-less build. Who uses this out of curiosity? I don't think any Windows developers mind installing Python as a requirement. It's also mentioned on the Building LLDB page (<a href="http://lldb.llvm.org/build.html" target="_blank">http://lldb.llvm.org/build.html</a>) that Python is a dependency<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> On Mon, Jun 23, 2014 at 2:07 PM, Todd Fiala <<a href="mailto:tfiala@google.com">tfiala@google.com</a>> wrote:<br>
>>>>>>> You can volunteer to write it more portably ;-)<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> On Mon, Jun 23, 2014 at 1:55 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
>>>>>>> Hmm, a shell script. kind of a non-starter for Windows. Any reason this can't be a python script?<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> On Mon, Jun 23, 2014 at 1:52 PM, Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br>
>>>>>>> It is generated by running swig with many options. See:<br>
>>>>>>><br>
>>>>>>> lldb/scripts/build-swig-wrapper-classes.sh<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> > On Jun 23, 2014, at 1:41 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
>>>>>>> ><br>
>>>>>>> > I'm trying to get the test suite into a working state on windows, or at the very least get it to the point where it fails by saying that none of the tests are supported on this platform. I seem to be missing this file lldb.py though. Is it supposed to be in the tree, or is it generated somehow?<br>
>>>>>>> > _______________________________________________<br>
>>>>>>> > lldb-dev mailing list<br>
>>>>>>> > <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
>>>>>>> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> _______________________________________________<br>
>>>>>>> lldb-dev mailing list<br>
>>>>>>> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
>>>>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> --<br>
>>>>>>> Todd Fiala | Software Engineer | <a href="mailto:tfiala@google.com">tfiala@google.com</a> | <a href="tel:650-943-3180" value="+16509433180">650-943-3180</a><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> _______________________________________________<br>
>>>>>>> lldb-dev mailing list<br>
>>>>>>><br>
>>>>>>> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
>>>>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
>>>>>><br>
>>>>>><br>
>>>>>> _______________________________________________<br>
>>>>>> lldb-dev mailing list<br>
>>>>>> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
>>>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> lldb-dev mailing list<br>
>>>>><br>
>>>>> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
>>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
>>>><br>
>>>><br>
>>>><br>
>>><br>
>>><br>
>><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br>
</div></div></blockquote></div><br></div>