<p dir="ltr">Ooh, I'd definitely be interested. </p>
<p dir="ltr">Sounds like a very fun project.</p>
<p dir="ltr">I'll have to familiarize myself with the internals (I'm currently learning the API, which seems to resemble the internals moderately well...)</p>
<p dir="ltr">I'll start educating myself tomorrow morning when I wake. </p>
<p dir="ltr">-Russell</p>
<br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 3, 2017, 9:00 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.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" class="gmail_msg">As the person who added most of the support for debugging Windows executables, I can tell you that I never tested a MinGW executable (nor was it one of my original goals). It doesn't entirely surprise me that things are behaving this way, but I'm not sure what the exact cause would be off the top of my head. MinGW executables and msvc Win32 executables use an entirely different ABI, so I would exepct the non lldb-server path to be a little wonky since I always assumed MSVC ABI in my implementation. On the other hand, as you said there is no lldb-server.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">If you're interested in digging into the source code and trying to add a patch for MinGW support, I can give you some pointers.</div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"></div><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Apr 3, 2017 at 3:41 PM Russell Greene via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="gmail_msg" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br class="gmail_msg"></div></div><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Also, forgot to include this part: it's pretty important:<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">PS C:\Users\IEUser> C:\msys64\mingw64\bin\lldb.exe C:\msys64\home\IEUser\chigraph\build\bin\chi.exe</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">(lldb) target create "C:\\msys64\\home\\IEUser\\chigraph\\build\\bin\\chi.exe"</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Current executable set to 'C:\msys64\home\IEUser\chigraph\build\bin\chi.exe' (x86_64).</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">(lldb) target list</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">Current targets:</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">* target #0: C:\msys64\home\IEUser\chigraph\build\bin\chi.exe ( arch=x86_64-pc-windows-msvc, platform=host )</font></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">(lldb) r</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">error: process launch failed: unable to locate lldb-server</font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg">(lldb)</font></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><font face="monospace" size="2" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><font size="2" class="gmail_msg">-Russell</font></div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Apr 3, 2017 at 4:39 PM Russell Greene <<a href="mailto:russellgreene8@gmail.com" class="gmail_msg" target="_blank">russellgreene8@gmail.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Interesting: <div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg"><font face="monospace" class="gmail_msg">PS C:\Users\IEUser> C:\msys64\mingw64\bin\lldb.exe C:\msys64\home\IEUser\chigraph\build\bin\chi.exe</font></div><div class="gmail_msg"><font face="monospace" class="gmail_msg">(lldb) target create "C:\\msys64\\home\\IEUser\\chigraph\\build\\bin\\chi.exe"</font></div><div class="gmail_msg"><font face="monospace" class="gmail_msg">Current executable set to 'C:\msys64\home\IEUser\chigraph\build\bin\chi.exe' (x86_64).</font></div><div class="gmail_msg"><font face="monospace" class="gmail_msg">(lldb) target list</font></div><div class="gmail_msg"><font face="monospace" class="gmail_msg">Current targets:</font></div><div class="gmail_msg"><font face="monospace" class="gmail_msg">* target #0: C:\msys64\home\IEUser\chigraph\build\bin\chi.exe ( arch=x86_64-pc-windows-msvc, platform=host )</font></div><div class="gmail_msg"><font face="monospace" class="gmail_msg">(lldb)</font></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><font face="monospace" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-Russell</div><div class="gmail_msg"><br class="gmail_msg"></div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Apr 3, 2017 at 10:54 AM Ted Woodward <<a href="mailto:ted.woodward@codeaurora.org" class="gmail_msg" target="_blank">ted.woodward@codeaurora.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431WordSection1 gmail_msg"><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">I wonder if lldb isn’t using the windows platform. In the lldb command line, load up your target, then type “target list”. I’d like to see what plaform it chose, and what the triple is.<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p></div></div><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431WordSection1 gmail_msg"><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">--<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">Qualcomm Innovation Center, Inc.<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p><p class="MsoNormal gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></span></p></div></div><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431WordSection1 gmail_msg"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt" class="gmail_msg"><div class="gmail_msg"><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in" class="gmail_msg"><p class="MsoNormal gmail_msg"><b class="gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg"> Russell Greene [mailto:<a href="mailto:russellgreene8@gmail.com" class="gmail_msg" target="_blank">russellgreene8@gmail.com</a>] <br class="gmail_msg"><b class="gmail_msg">Sent:</b> Monday, April 03, 2017 11:24 AM<br class="gmail_msg"><b class="gmail_msg">To:</b> Ted Woodward <<a href="mailto:ted.woodward@codeaurora.org" class="gmail_msg" target="_blank">ted.woodward@codeaurora.org</a>>; LLDB <<a href="mailto:lldb-dev@lists.llvm.org" class="gmail_msg" target="_blank">lldb-dev@lists.llvm.org</a>><br class="gmail_msg"><b class="gmail_msg">Subject:</b> Re: [lldb-dev] Using LLDB API on windows<u class="gmail_msg"></u><u class="gmail_msg"></u></span></p></div></div></div></div></div><div lang="EN-US" link="blue" vlink="purple" class="gmail_msg"><div class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431WordSection1 gmail_msg"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt" class="gmail_msg"><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><div class="gmail_msg"><p class="MsoNormal gmail_msg">That makes sense, and I'm sure it works great when using MSVC as a compiler, but I think LLDB recognizes mingw as a unix compiler and tries to do GDBRemoteCommunication::StartDebugserverProcess when it should be doing PlatformWindows::DebugProcess. <u class="gmail_msg"></u><u class="gmail_msg"></u></p><div class="gmail_msg"><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p></div><div class="gmail_msg"><p class="MsoNormal gmail_msg">Not sure though. All I know is when I try to do a SBTarget::Launch on windows under mingw (msys2) it says cannot find lldb-server...<u class="gmail_msg"></u><u class="gmail_msg"></u></p></div><div class="gmail_msg"><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p></div><div class="gmail_msg"><p class="MsoNormal gmail_msg">-Russell<u class="gmail_msg"></u><u class="gmail_msg"></u></p></div></div><p class="MsoNormal gmail_msg"><u class="gmail_msg"></u> <u class="gmail_msg"></u></p><div class="gmail_msg"><div class="gmail_msg"><p class="MsoNormal gmail_msg">On Mon, Apr 3, 2017 at 9:32 AM Ted Woodward <<a href="mailto:ted.woodward@codeaurora.org" class="gmail_msg" target="_blank">ted.woodward@codeaurora.org</a>> wrote:<u class="gmail_msg"></u><u class="gmail_msg"></u></p></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">Hi Russell,</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"> </span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">I assume you mean for SBTarget::Launch or LaunchSimple to launch a Windows application.</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"> </span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">The short answer is, this already works.</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"> </span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">SBTarget::Launch calls Target::Launch, which calls DebugProcess in the relevant platform. For cases where we use lldb-server, the platform make a call that eventually gets to GDBRemoteCommunication::StartDebugserverProcess to start up lldb-server. On Windows, PlatformWindows::DebugProcess calls Process::Launch, which (on Windows) will do the correct thing to start up and connect to a Windows process.</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"> </span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">See PlatformWindows::DebugProcess in source\Plugins\Platform\Windows\PlatformWindows.cpp and ProcessLauncherWIndows::LaunchProcess in source\Host\windows\ProcessLauncherWindows.cpp .</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"> </span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">Ted</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"> </span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">--</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">Qualcomm Innovation Center, Inc.</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg">The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d" class="gmail_msg"> </span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt" class="gmail_msg"><div class="gmail_msg"><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in" class="gmail_msg"><p class="MsoNormal gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><b class="gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg">From:</span></b></span><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg"> lldb-dev [mailto:<a href="mailto:lldb-dev-bounces@lists.llvm.org" class="gmail_msg" target="_blank">lldb-dev-bounces@lists.llvm.org</a>] <b class="gmail_msg">On Behalf Of </b>Russell Greene via lldb-dev</span></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif" class="gmail_msg"><br class="gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><b class="gmail_msg">Sent:</b> Sunday, April 02, 2017 4:38 PM</span><br class="gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><b class="gmail_msg">To:</b> <a href="mailto:lldb-dev@lists.llvm.org" class="gmail_msg" target="_blank">lldb-dev@lists.llvm.org</a></span><br class="gmail_msg"><span class="m_8588499408742087717m_8059929514430960597m_-1480724755296209687m_3956105482223681431gmailmsg gmail_msg"><b class="gmail_msg">Subject:</b> [lldb-dev] Using LLDB API on windows</span></span><u class="gmail_msg"></u><u class="gmail_msg"></u></p></div></div></div></div></div><div class="gmail_msg"><div class="gmail_msg"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt" class="gmail_msg"><p class="MsoNormal gmail_msg"> <u class="gmail_msg"></u><u class="gmail_msg"></u></p><div class="gmail_msg"><p class="MsoNormal gmail_msg">Hey so I am developing a project using LLDB as a debugger and am looking to make it cross-platform. <u class="gmail_msg"></u><u class="gmail_msg"></u></p><div class="gmail_msg"><p class="MsoNormal gmail_msg"> <u class="gmail_msg"></u><u class="gmail_msg"></u></p></div><div class="gmail_msg"><p class="MsoNormal gmail_msg">As I see it, the LLDB API boots up an instance of lldb-server, but lldb-server isn't available on windows. Is there a way to use the LLDB C++ API on windows? <u class="gmail_msg"></u><u class="gmail_msg"></u></p></div><div class="gmail_msg"><p class="MsoNormal gmail_msg"> <u class="gmail_msg"></u><u class="gmail_msg"></u></p></div><div class="gmail_msg"><p class="MsoNormal gmail_msg">On the <a href="https://lldb.llvm.org/status.html" class="gmail_msg" target="_blank">status page</a> I see the lldb commandline tool is OK for windows, which uses the LLDB API, how is this achieved?<u class="gmail_msg"></u><u class="gmail_msg"></u></p></div><div class="gmail_msg"><p class="MsoNormal gmail_msg"> <u class="gmail_msg"></u><u class="gmail_msg"></u></p></div><div class="gmail_msg"><p class="MsoNormal gmail_msg">-Russell<u class="gmail_msg"></u><u class="gmail_msg"></u></p></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div></blockquote></div></blockquote></div><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br class="gmail_msg">
lldb-dev mailing list<br class="gmail_msg">
<a href="mailto:lldb-dev@lists.llvm.org" class="gmail_msg" target="_blank">lldb-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class="gmail_msg">
</blockquote></div>
</blockquote></div>