<div dir="ltr"><div>> <span style="font-family:arial,sans-serif;font-size:12.7272720336914px">so it is probably best to always explicitly specify your platform.</span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px">Yeah that's fine. I'll be sure to get some kind of documentation around this once I work out the path.</span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px">Thanks!</span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.7272720336914px">-Todd</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 18, 2014 at 10:19 AM, 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">If you can get the ObjectFileELF to properly set the triple to something that isn't compatible with the host platform, then the platform will be selected automagically when you do: "file a.out". But that won't work for an ELF file that _is_ compatible with the current host (like an "x86_64-*-linux"), so it is probably best to always explicitly specify your platform.<br>
<span class="HOEnZb"><font color="#888888"><br>
Greg<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Sep 18, 2014, at 10:02 AM, Todd Fiala <<a href="mailto:tfiala@google.com">tfiala@google.com</a>> wrote:<br>
><br>
> Ok that seems reasonable. I'll make sure that path works.<br>
><br>
><br>
> On Thu, Sep 18, 2014 at 10:00 AM, Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br>
><br>
> > On Sep 18, 2014, at 8:41 AM, Todd Fiala <<a href="mailto:tfiala@google.com">tfiala@google.com</a>> wrote:<br>
> ><br>
> > Hey Greg,<br>
> ><br>
> > When we fire off a '(lldb) gdb-remote host:port' command on lldb Linux, some bits don't get set up right. The issue seems to be that the platform for the gdb-remote target is using what looks like the current default platform, where Platform::IsHost() returns true. This screws up some process-launching setup, notably pty setup (it tries to use local ptys rather than ignoring that part and going with $O messages). It might be causing other issues as well that I just haven't seen given that the target platform's IsHost() is returning an incorrect value when attached to a remote system.<br>
> ><br>
> > I'm in the process of fixing that up for Linux so I can better address pty setup for local llgs and remote llgs debugging scenarios. What do you think is the right approach to addressing that? Some ideas that come to mind:<br>
> ><br>
> > * install a remote platform into the Target as part of gdb-remote's command handling.<br>
> ><br>
> > * modify gdb-remote to take an option for treating as local or remote. Do the right thing with PTYs based on that. Might need to pass extra state around somewhere for that.<br>
> ><br>
> > * have the pty check do "something else" to figure out whether the target is really going to run locally. Not sure where that state would go. Target::GetPlatform()::IsHost() seems like the right place to deal with that.<br>
> ><br>
> > I probably have a couple more questions based on your preference here. (e.g. if installing a remote-aware Platform instance into the Target, which one? Wait for gdb-remote to tell us? The important bit is that IsHost() return true in this case. But - PlatformLinux will try to do the lldb-platform route which gdb-remote's direct-to-llgs approach is not using. Also - technically we won't know what the remote side is until we get qHostInfo data back).<br>
> ><br>
> > Thoughts?<br>
><br>
> We currently do all local debugging here, so I would not want "remote-macosx" selected as the platform.<br>
><br>
> The idea really should be:<br>
><br>
> (lldb) platform select remote-linux<br>
> (lldb) file ...<br>
> (lldb) gdb-remote ...<br>
><br>
><br>
> This selects the right platform first and then all other "file ..." and "gdb-remote ..." will do the right thing for that instance of LLDB. There doesn't seem to be any other reliable way to do this because even if we try to look at the host that the gdb-remote wants to use (gdb-remote 1111 uses localhost, and gdb-remote foo.bar.baz:1111 uses foo.bar.baz) we aren't going to be able to tell what kind of host it is from the IP address.<br>
><br>
> Greg<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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);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">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>