<div dir="ltr">If you compile with MSVC or Clang-cl it wouldn't ask for lldb-server. So most likely there is some code that is using #if defined(_MSC_VER) when it should be using #if defined(LLVM_ON_WINDOWS).<div><br></div><div>You'll have to hunt that down, but a good starting point might be to put a breakpoint in ProcessWindowsLive::CreateInstance and then work backwards to see why that isn't getting called (assuming it's not).</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 28, 2016 at 9:05 AM Eran Ifrah <<a href="mailto:eran.ifrah@gmail.com">eran.ifrah@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 28, 2016 at 6:56 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Patches welcome. If you can split it into independent pieces that would be helpful, but it's not always possible.<br><br></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">Patch is attached, I think you will find it quite straight forward - feel free to comment and send it back for revise</div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline"></div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The NativeProcessProtocol error, that's the interface that converts debugging events that occur on the inferior into packets that can be sent to the server, and vice versa. Since Windows doesn't currently use lldb server, this piece has never been written for Windows </blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">So this raises the question: how come lldb asks for it? (see my first emai inl this conversation)</div></div><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline">I would have build LLDB in debug mode, but it seems that MinGW as.exe fails to write some of the files "File too big"</div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;display:inline"></div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div><div><div class="gmail_quote"><div dir="ltr">On Mon, Mar 28, 2016 at 8:41 AM Eran Ifrah <<a href="mailto:eran.ifrah@gmail.com" target="_blank">eran.ifrah@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 28, 2016 at 6:10 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'm the main Windows maintainer, </blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">Hi</div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline"></div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">and while We've gotten things working pretty well on Windows, our effort has been 100% on building with msvc and/or clang-cl. Building with mingw has a different set of pre processor defines and some other subtle differences, so it doesn't surprise me that things don't work quite right.<br><br></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">I got it to compile (I have a big patch that I can send you if you are interested)</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">mainly involves blocking code under __MINGW32__ and some updates to the various CMakeLists.txt and AddLLDB.cmake module files</div></div><div><div style="font-family:verdana,sans-serif;display:inline">Some functions are missing in MinGW implementations (like gets_s and others :/)</div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div style="font-family:verdana,sans-serif;display:inline"></div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">You can try getting lldb-server to build and run under Windows, or you can try to get it to use the non lldb server codepath on MinGW, but you may still run into some </blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">I got lldb-server to compile and run on Windows, however, it crashes immediately and the backtrace shows this:</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline"><br></div></div><div><div style="display:inline"><font face="monospace, monospace"><div>0 0x0000000000724615 lldb_private::NativeProcessProtocol::Launch(lldb_private::ProcessLaunchInfo&, lldb_private::NativeProcessProtocol::NativeDelegate&, lldb_private::MainLoopBase&, std::shared_ptr<lldb_private::NativeProcessProtocol>&) </div><div>1 0x00000000005f815d lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess() </div><div>2 0x00000000004020e5 handle_launch(lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS&, int, char const* const*) </div><div>3 0x000000000040335e main_gdbserver(int, char**) </div><div>4 0x000000000188329c main </div><div><br></div></font></div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline"><br></div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">I had to #ifndef __MINGW32__ around lldb-platform.cpp as it contains too much Linux code that can not be compiled under Windows (fork, exec*)</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline">and basically lldb-server calls the main_gdbserver instead of main_platform function</div></div><div><div style="font-family:verdana,sans-serif;font-size:small;display:inline"><br></div></div><div style="font-family:verdana,sans-serif;font-size:small">Looking at the function that crashes, I see this:</div><div style="font-family:verdana,sans-serif;font-size:small"><br></div><div><font face="monospace, monospace">llvm_unreachable("Platform has no NativeProcessProtocol support");</font><br></div><div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">Any ideas?</font></div><div><font face="verdana, sans-serif">Thanks!</font></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><font face="verdana, sans-serif"><br></font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">issues after that as well, since you're the first person afaik to try building with MinGW <br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="gmail_quote"><div><div><div dir="ltr">On Sun, Mar 27, 2016 at 10:29 PM Eran Ifrah via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small"><div style="color:rgb(0,0,0)">Hi,</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">I have built LLDB on Windows 7 using MinGW64/4.9.2 (took some effort to get the job done...)</div><div style="color:rgb(0,0,0)">When I tried to debug a simple hello world executable, I get this output:</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0);font-family:arial,sans-serif"><div><font face="monospace, monospace">D:\software\msys-for-clang\1.0\home\PC\build-release-64-lldb\bin>lldb.exe HelloWorld.exe</font></div><div><font face="monospace, monospace">(lldb) target create "HelloWorld.exe"</font></div><div><font face="monospace, monospace">Current executable set to 'HelloWorld.exe' (x86_64).</font></div><div><font face="monospace, monospace">(lldb) b main.cpp:7</font></div><div><font face="monospace, monospace">Breakpoint 1: where = HelloWorld.exe`main + 26 at main.cpp:7, address = 0x000000000040154a</font></div><div><font face="monospace, monospace">(lldb) r</font></div><div><font face="monospace, monospace">error: process launch failed: unable to locate lldb-server</font></div><div><font face="monospace, monospace">(lldb)</font></div></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">I can't seem to locate lldb-server anywhere, and according to LLDBConfig.cmake, this target should not get built on Windows:</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0);font-family:arial,sans-serif"><div><font face="monospace, monospace"># Figure out if lldb could use lldb-server. If so, then we'll</font></div><div><font face="monospace, monospace"># ensure we build lldb-server when an lldb target is being built.</font></div><div><font face="monospace, monospace">if ((CMAKE_SYSTEM_NAME MATCHES "Darwin") OR</font></div><div><font face="monospace, monospace"> (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") OR</font></div><div><font face="monospace, monospace"> (CMAKE_SYSTEM_NAME MATCHES "Linux") OR</font></div><div><font face="monospace, monospace"> (CMAKE_SYSTEM_NAME MATCHES "NetBSD"))</font></div><div><font face="monospace, monospace"> set(LLDB_CAN_USE_LLDB_SERVER 1)</font></div><div><font face="monospace, monospace">else()</font></div><div><font face="monospace, monospace"> set(LLDB_CAN_USE_LLDB_SERVER 0)</font></div><div><font face="monospace, monospace">endif()</font></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">and in the tools/CMakeLists.txt file we have this:</div><div style="font-family:verdana,sans-serif"><br></div><div><div><font face="monospace, monospace">if (LLDB_CAN_USE_LLDB_SERVER)</font></div><div><font face="monospace, monospace"> add_subdirectory(lldb-server)</font></div><div><font face="monospace, monospace">endif()</font></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div></div></div><div style="color:rgb(0,0,0)">Any ideas?</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">Thanks,</div><div style="margin:2px 0px 0px;color:rgb(0,0,0);font-family:arial,sans-serif;font-size:16px"><div><br></div></div></div>-- <br><div><div dir="ltr"><font face="verdana, sans-serif">Eran Ifrah,<br>Author of <div style="font-family:verdana,sans-serif;font-size:small;display:inline">CodeLite</div>, a cross platform open source C/C++ IDE: <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br></font><div><font face="verdana, sans-serif">CodeLite IDE Blog: <a href="http://codeliteide.blogspot.com/" target="_blank">http://codeliteide.blogspot.com/</a></font></div></div></div>
</div></div></div>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div>
</blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div><div dir="ltr"><font face="verdana, sans-serif">Eran Ifrah,<br>Author of codelite, a cross platform open source C/C++ IDE: <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br></font></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div><div dir="ltr"><div><font face="verdana, sans-serif">CodeLite IDE Blog: <a href="http://codeliteide.blogspot.com/" target="_blank">http://codeliteide.blogspot.com/</a></font></div></div></div></div></div></blockquote></div>
</div></div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><font face="verdana, sans-serif">Eran Ifrah,<br>Author of codelite, a cross platform open source C/C++ IDE: <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br></font><div><font face="verdana, sans-serif">CodeLite IDE Blog: <a href="http://codeliteide.blogspot.com/" target="_blank">http://codeliteide.blogspot.com/</a></font></div></div></div>
</div></div></blockquote></div>