<div dir="ltr">Hi,<div><br></div><div>It should.</div><div>Have you opened master pseudoterminal like?:</div><div><br></div><div>int fd = posix_openpt(flags); // open("/dev/ptmx") might work here too but less portable;</div>
<div>grantpt(fd);</div><div>unlockpt(fd);</div><div><br></div><div><div>Depending on target you might need some bizarre ioctls here, but assuming you are using Linux/FreeBSD/MacOSX</div><div>you should be fine.</div><div>
<br></div></div><div>If you had already master pseudo-terminal file descriptor you can skip steps above.</div><div><br></div><div>You can use ptsname for master file descriptor it will return you name of slave pseudo-terminal for your master.<br>
</div><div>Later you can pass name returned by ptsname(fd) as Launch arguments.</div><div><br></div><div>If above won't work you can try replacing Launch() call with ordinary fork, and in child process:</div><div><br>
</div><div>slavefd = open(slavename, O_RDWR);</div><div><br></div><div>dup2(0, slavefd);</div><div>dup2(1, slavefd);</div><div>dup2(2, slavefd);</div><div><br></div><div>And see if that works alone for you...</div><div><br>
</div><div>Good luck,</div><div>/Piotr</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-22 19:29 GMT+01:00 Eran Ifrah <span dir="ltr"><<a href="mailto:eran.ifrah@gmail.com" target="_blank">eran.ifrah@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hello,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
I am trying to use the C++ API with good success so far.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I am now at a point where I want to redirect stdin/out/err of the inferior to my application (my application creates a separate pseudo terminal window)</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Looking at the SBTarget::Launch, I thought that simply passing "/dev/pts/<some-number>" as the 3rd, 4th and 5th argument will do the trick .. well, it did not.</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I am missing something basic here, can anyone shed some light please? or give an example (better) of how to achieve this? </div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Thanks!<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br></div><div>-- <br></div><div dir="ltr">
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><div>wxCrafter, a wxWidgets RAD: http://<a href="http://wxcrafter.codelite.org" target="_blank">wxcrafter.codelite.org</a></div>
</div>
</font></span></div>
<br>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu">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><br>
<br></blockquote></div><br></div>