<div dir="ltr"><div>+lldb-dev</div><div><br></div><div><div><div>I've just tried running the Linux remote tests again and I hit some problems.</div><div><br></div><div>"connect to debug monitor on port NNN failed"</div><div><br></div><div>We will look into it soon.</div><div><br></div>We've never tried it on Ubuntu 12.04 AFAIK. One problem with 12.04 could be causing all of those failures.<div><br></div><div>Sincerely,</div><div><br></div><div>Vince</div></div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 26, 2015 at 7:41 AM, Ted Woodward <span dir="ltr"><<a href="mailto:ted.woodward@codeaurora.org" target="_blank">ted.woodward@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi Vince,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I build top of tree from a couple days ago on Ubuntu 12, then ran the tests normally and got 4 failures. I ran the remote tests using the instructions below, and got 65 failures out of 360 tests, with lldb-server in platform mode on another Ubuntu 12 machine.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I’m trying to establish a baseline before making my changes; are that many failures expected?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Ted<u></u><u></u></span></p><span class=""><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">--<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Qualcomm Innovation Center, Inc.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p></span><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt"><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Vince Harron [mailto:<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>] <br><b>Sent:</b> Tuesday, March 24, 2015 12:54 PM</span></p><div><div class="h5"><br><b>To:</b> Ted Woodward<br><b>Subject:</b> Re: FW: [lldb-dev] Problems selecting correct Platform<u></u><u></u></div></div><p></p></div></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">It's been on my todo list for a long time to document this. I've made some edits in this email, please email if you hit any problems.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">(We run cmake ../../llvm ... in "$TARGETIP/build/host" folder)<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">host1$ TARGETIP=192.168.100.132<u></u><u></u></p></div><div><p class="MsoNormal">host1$ cd $ROOT_DIR/build/host<u></u><u></u></p></div><div><div><p class="MsoNormal">host1$ rsync -hav bin/lldb-server* $TARGETIP:host/bin/<u></u><u></u></p></div><div><p class="MsoNormal">host1$ rsync -havL lib/python2.7 $TARGETIP:host/lib/<u></u><u></u></p></div><div><p class="MsoNormal">host2$ $ROOT_DIR/build/bin/lldb-server platform --listen *:5432 --stay-alive -c "log enable -f /tmp/plat.log gdb-remote all"<u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">host1$ cd $ROOT_DIR/llvm/tools/lldb/test<u></u><u></u></p></div><div><p class="MsoNormal">host1$ DOTEST_OPTS="--executable $ROOT_DIR/build/host/bin/lldb -A x86_64 -C clang-3.5 -s $ROOT_DIR/build/host/lldb-test-traces -u CXXFLAGS -u CFLAGS"<u></u><u></u></p></div><div><p class="MsoNormal">(these next lines are what enable remote test suite)<u></u><u></u></p></div><div><div><p class="MsoNormal">host1$ export LLDB_TEST_THREADS=1<u></u><u></u></p></div><div><p class="MsoNormal">host1$ export DOTEST_OPTS="$DOTEST_OPTS --platform-name remote-linux --platform-url connect://$TARGETIP:5432 --platform-working-dir /tmp"<u></u><u></u></p></div><div><p class="MsoNormal">host1$ ./dosep.py --options "$DOTEST_OPTS"<u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Tue, Mar 24, 2015 at 9:52 AM, Ted Woodward <<a href="mailto:ted.woodward@codeaurora.org" target="_blank">ted.woodward@codeaurora.org</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I want to run linux->remote linux test; how do I do that?</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">--</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Qualcomm Innovation Center, Inc.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> </span><u></u><u></u></p><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt"><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Vince Harron [mailto:<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>] <br><b>Sent:</b> Monday, March 23, 2015 6:00 PM<br><b>To:</b> Ted Woodward<br><b>Subject:</b> Re: FW: [lldb-dev] Problems selecting correct Platform</span><u></u><u></u></p></div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><p>Hi Ted,<u></u><u></u></p><p>I'm going to be busy with non-LLDB stuff this week. So I won't have time to give this question the attention it deserves.<u></u><u></u></p><p>If you make this change and we can still run the tests suite cleanly Linux->remote/local Linux, I think it's fine. But I reserve the right to complain later. :)<u></u><u></u></p><div><p class="MsoNormal">On Mar 23, 2015 3:46 PM, "Ted Woodward" <<a href="mailto:ted.woodward@codeaurora.org" target="_blank">ted.woodward@codeaurora.org</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><p class="MsoNormal" style="margin-bottom:12.0pt"><br>Hi Vince,<br><br>I'm trying to get LLDB on Windows to load a Linux binary and choose the<br>remote Linux Platform, but r226712, which gets the remote-linux platform<br>able to run processes, is causing some trouble.<br><br>Specifically, the call to debugger.GetTargetList().CreateTarget() was<br>changed to call the version of CreateTarget() that takes an ArchSpec instead<br>of a triple. The version that takes the triple will go through all the<br>platforms looking for one that matches the triple, then call the version<br>that takes an ArchSpec. The version that takes an ArchSpec will only use the<br>current platform.<br><br>I'd like to change this back to the original implementation; would that be a<br>problem?<br><br>Ted<br><br>-----Original Message-----<br>From: <a href="mailto:lldb-dev-bounces@cs.uiuc.edu" target="_blank">lldb-dev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:lldb-dev-bounces@cs.uiuc.edu" target="_blank">lldb-dev-bounces@cs.uiuc.edu</a>] On<br>Behalf Of Ted Woodward<br>Sent: Thursday, March 19, 2015 5:53 PM<br>To: 'Greg Clayton'; 'Vince Harron'<br>Cc: <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>Subject: Re: [lldb-dev] Problems selecting correct Platform<br><br><br><br><br>> -----Original Message-----<br>> From: Greg Clayton [mailto:<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>]<br>> Sent: Thursday, March 19, 2015 4:45 PM<br>><br>> > On Mar 19, 2015, at 12:15 PM, Ted Woodward<br>> <<a href="mailto:ted.woodward@codeaurora.org" target="_blank">ted.woodward@codeaurora.org</a>> wrote:<br>> ><br>> > I've got a Hexagon platform, that launches the Hexagon simulator and<br>> > is used for standalone development. Now I'm working on supporting<br>> > Hexagon Linux, but it's not choosing the Linux platform, instead<br>> > it's choosing the Hexagon platform.<br>> ><br>> > I want LLDB to use the Hexagon Platform if my executable's triple is<br>> > "hexagon-unknown-elf" (which is really hexagon-unknown-unknown) and<br>> > use the Linux platform if my executable's triple is<br>"hexagon-unknown-linux".<br>> ><br>> ><br>> > First problem:<br>> > "target create" doesn't search platforms for one matching the<br>> > executable's triple. It used to, but when TargetList::CreateTarget<br>> > was switched to call CreateTargetInternal, "target create" was<br>> > changed to call the method that takes an ArchSpec instead of a<br>> > triple. This method doesn't search for a compatible Platform, but<br>> > instead chooses the<br>> current Platform.<br>> ><br>> > Is this intended behavior?<br>><br>> No. Sounds like you have an old snapshot of LLDB. The current one was<br>recently<br>> fixed to search for the platform with revision 216115.<br><br>I've got 216115. My snapshot includes up to 227289 from 1/27/15. We're<br>trying to get better about staying closer to top-of-tree, but it's something<br>we're not good enough at yet.<br><br>226712 from 1/21/15 changed how "target create" called CreateTarget() in<br>TargetList.cpp. Before that rev, it called the CreateTarget() that took a<br>triple, but after that rev it calls the CreateTarget() that takes an<br>ArchSpec. These 2 methods do different things; the triple one calls the<br>(internal) ArchSpec one at the end. One thing that is missing in the one<br>that takes an ArchSpec is the chunk of code that searches for a valid<br>platform for the specified architecture:<br><br> else if (platform_arch.IsValid())<br> {<br> // if "arch" isn't valid, yet "platform_arch" is, it means we<br>have an executable file with<br> // a single architecture which should be used<br> ArchSpec fixed_platform_arch;<br> if (!platform_sp->IsCompatibleArchitecture(platform_arch, false,<br>&fixed_platform_arch))<br> {<br> platform_sp =<br>Platform::GetPlatformForArchitecture(platform_arch, &fixed_platform_arch);<br> if (platform_sp)<br><br>debugger.GetPlatformList().SetSelectedPlatform(platform_sp);<br> }<br> }<br><br>That code is not currently called by a "target create".<br><br>Vince, would changing the CreateTarget() call in CommandObjectTarget.cpp<br>back to the pre-226712 call break the remote-linux platform run process fix?<br><br>> > Second problem:<br>> > I change DoExecute() in CommandObjectTarget.cpp to call the ArchSpec<br>> > version if the ArchSpec is valid, and the triple version if it is not.<br>> > This has LLDB going through platforms to find a match, but there's<br>> > another problem when it gets to PlatformLinux.<br>> > PlatformLinux::GetSupportedArchitectureAtIndex() will only return<br>> > host<br>> architectures.<br>><br>> This is a bug and should be fixed with code below...<br>><br>> > So in my case, running on Windows, it returns x86_64-pc-windows-msvc<br>> > or i386-pc-windows-msvc. Neither is a match for Linux.<br>> ><br>> > Shouldn't the Linux platform match anything with a triple *-*-linux?<br>> > Or does the platform not matter if I'm just going to use gdb-remote<br>> > to connect to gdbserver or LLGS on a remote Hexagon Linux board?<br><br>I added the code below to PlatformLinux.cpp and now my Windows LLDB<br>correctly selects the remote-linux platform for Hexagon Linux. Thanks!<br><br>> So a platform can say what architectures it supports. This is how we<br>> match architectures up to a binary that is supplied. Each platform<br>> should give<br>an<br>> exhaustive list of the architectures they support.<br>><br>> The current code is:<br>><br>> bool<br>> PlatformLinux::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec<br>> &arch) {<br>> if (idx == 0)<br>> {<br>> arch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault);<br>> return arch.IsValid();<br>> }<br>> else if (idx == 1)<br>> {<br>> // If the default host architecture is 64-bit, look for a<br>> 32-bit<br>variant<br>> ArchSpec hostArch =<br>> HostInfo::GetArchitecture(HostInfo::eArchKindDefault);<br>> if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit())<br>> {<br>> arch = HostInfo::GetArchitecture(HostInfo::eArchKind32);<br>> return arch.IsValid();<br>> }<br>> }<br>> return false;<br>> }<br>><br>><br>> This is only correct if Platform::IsHost() returns true. Otherwise<br>> linux<br>will need<br>> to say all architectures that is supports:<br>><br>><br>> x86_64-*-linux<br>> i386-*-linux<br>> arm*-*-linux<br>> aarch64-*-linux<br>> mips64-*linux<br>><br>> The "*" above for the vendor should be set an an "unspecified<br>> unknown". So<br>the<br>> code should be:<br>><br>> bool<br>> PlatformLinux::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec<br>> &arch) {<br>> if (IsHost())<br>> {<br>> if (idx == 0)<br>> {<br>> arch = HostInfo::GetArchitecture(HostInfo::eArchKindDefault);<br>> return arch.IsValid();<br>> }<br>> else if (idx == 1)<br>> {<br>> // If the default host architecture is 64-bit, look for a<br>32-bit variant<br>> ArchSpec hostArch =<br>> HostInfo::GetArchitecture(HostInfo::eArchKindDefault);<br>> if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit())<br>> {<br>> arch = HostInfo::GetArchitecture(HostInfo::eArchKind32);<br>> return arch.IsValid();<br>> }<br>> }<br>> }<br>> else<br>> {<br>> llvm::Triple triple;<br>> // Set the OS to linux<br>> triple.setOS(llvm::Triple::Linux);<br>> // Set the architecture<br>> switch (idx)<br>> {<br>> case 0: arch.setArchName("x86_64"); break;<br>> case 1: arch.setArchName("i386"); break;<br>> case 2: arch.setArchName("arm"); break;<br>> case 3: arch.setArchName("aarch64"); break;<br>> case 4: arch.setArchName("mips64"); break;<br>> case 5: arch.setArchName("hexagon"); break;<br>> default: return false;<br>> }<br>> // Leave the vendor as "llvm::Triple:UnknownVendor" and don't<br>specify<br>> the vendor by<br>> // calling triple.SetVendorName("unknown") so that it is a<br>"unspecified<br>> unknown".<br>> // This means when someone calls triple.GetVendorName() it will<br>> return an empty string<br>> // which indicates that the vendor can be set when two<br>architectures are<br>> merged<br>><br>> // Now set the triple into "arch" and return true<br>> arch.SetTriple(triple);<br>> return true;<br>> }<br>> return false;<br>> }<br>><br>> Then things should work a bit better for you.<br><br>--<br>Qualcomm Innovation Center, Inc.<br>The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a<br>Linux Foundation Collaborative Project<br><br>_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">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><u></u><u></u></p></blockquote></div></div></div></div></div></div></blockquote></div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- <u></u><u></u></p><div><div><p class="MsoNormal"><u></u> <u></u></p><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td nowrap style="border:none;border-top:solid #d50f25 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#555555">Vince Harron |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #3369e8 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#555555"> Technical Lead Manager |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #009939 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#555555"> <a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a> |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #eeb211 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#555555"> <a href="tel:858-442-0868" value="+18584420868" target="_blank">858-442-0868</a><u></u><u></u></span></p></td></tr></tbody></table><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><br><table cellspacing="0" cellpadding="0" style="font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Vince Harron |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Technical Lead Manager |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 858-442-0868</td></tr></tbody></table><br></div></div>
</div>