<div dir="ltr"><div>I've modified a couple of tests to support this.  It's not a big deal but I see a big maintenance problem going forward as people add new tests that work locally but don't consider the remote case.<br></div><div><br></div><div>Also, I'm hitting a problem with the SBProcess API in TestProcessIO.py.  It allows reading/writing bytes at runtime.  It's not sufficient to have the I/O reading/writing from/to files on the remote host.  We need to hook up pipes to get this test passing.</div><div><br></div><div>Vince</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 27, 2015 at 6:48 PM, Vince Harron <span dir="ltr"><<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="">> <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important;background-color:rgb(255,255,255)">I would vote to redirect to a file on the remote host and do nothing else. Then you can fetch the file via the platform command:</span><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important;background-color:rgb(255,255,255)"><br></span></div></span><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important;background-color:rgb(255,255,255)">I'm not super in love with this for a few reasons.</span></div><div><ol><li><span style="font-size:12.8000001907349px">The tests need to be modified and have different behavior for local/remote processes.</span><br></li><li><span style="font-size:12.8000001907349px">Currently, lldb hides a lot of the hassle of running binaries on a remote host by automatically copying them over.  This just adds a special case for output.</span><br></li><li><span style="font-size:12.8000001907349px">Conceptually, for the user, this would mean that 'target create <path>' would be a local path but 'process launch <path>' would be a remote path.  I would prefer that this always be local path if possible.</span><br></li></ol></div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important;background-color:rgb(255,255,255)"><br></span></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Fri, Jan 23, 2015 at 5:15 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"><span><br>
> On Jan 23, 2015, at 12:10 PM, Vince Harron <<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> I'm trying to get the test suite running against a Linux x86_64->Linux x86_64 remote target.  I'm getting a failure when process launch is called with stdout redirected to a file.<br>
><br>
> The host is sending QSetSTDOUT to the remote host with a path that is only valid on the host.<br>
><br>
> For stdout/stderr there are a couple of ways to approach this problem.<br>
><br>
> 1) Let the inferior write to a temporary file on the remote host and then retrieve after the process exits?  I don't like this because I think it's really useful to see the debug output from the file during debugging.<br>
<br>
</span>Just FYI: if you redirect to a file in a local debug session you won't see any output. We don't monitor the file or do anything with it as you asked for the output to be redirected.<br>
<span>><br>
> 2) Hand the inferior a pipe for each redirected stdout/stderr, transfer the bytes written to the host and then write them on the host to the specified file.  What messages do I use for this?  It should be independent of $O.  I don't want to use the $F messages because they're slightly different (and a lot of<br>
><br>
</span><span>> 3) ???<br>
><br>
> For stdin, I think I will just copy to file over to the target and open it on the inferior.<br>
><br>
> Thoughts?<br>
<br>
</span>I would vote to redirect to a file on the remote host and do nothing else. Then you can fetch the file via the platform command:<br>
<br>
(lldb) platform get-file ...<br>
<br>
I am not sure why, but these are only currently available when LLDB_CONFIGURATION_DEBUG is defined:<br>
<br>
<br>
#ifdef LLDB_CONFIGURATION_DEBUG<br>
    LoadSubCommand ("mkdir", CommandObjectSP (new CommandObjectPlatformMkDir (interpreter)));<br>
    LoadSubCommand ("file", CommandObjectSP (new CommandObjectPlatformFile (interpreter)));<br>
    LoadSubCommand ("get-file", CommandObjectSP (new CommandObjectPlatformGetFile (interpreter)));<br>
    LoadSubCommand ("get-size", CommandObjectSP (new CommandObjectPlatformGetSize (interpreter)));<br>
    LoadSubCommand ("put-file", CommandObjectSP (new CommandObjectPlatformPutFile (interpreter)));<br>
#endif<br>
<br>
Feel free to remote this #if so they are always available.<br>
<br>
<br>
Currently I have tested the "lang" directory only when doing remote tests:<br>
<br>
% ./dotest.py [options] lang<br>
<br>
There are many tests that are going to need to be modified for these sorts of things. Such as if we need to redirect stdin from a file, we will need to upload this file first and possibly update the stdin redirect file path to be the new STDIN path on the remote host. Or we can skip these tests for remote for now.<br>
<span><font color="#888888"><br>
Greg<br>
<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="">-- <br><div><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"> <a href="tel:858-442-0868" value="+18584420868" target="_blank">858-442-0868</a></td></tr></tbody></table><br></div></div>
</span></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>