[lldb-dev] How to redirect stdin/out/err to different pty?
piotr.rak at gmail.com
Sat Mar 22 12:36:36 PDT 2014
Have you opened master pseudoterminal like?:
int fd = posix_openpt(flags); // open("/dev/ptmx") might work here too but
Depending on target you might need some bizarre ioctls here, but assuming
you are using Linux/FreeBSD/MacOSX
you should be fine.
If you had already master pseudo-terminal file descriptor you can skip
You can use ptsname for master file descriptor it will return you name of
slave pseudo-terminal for your master.
Later you can pass name returned by ptsname(fd) as Launch arguments.
If above won't work you can try replacing Launch() call with ordinary fork,
and in child process:
slavefd = open(slavename, O_RDWR);
And see if that works alone for you...
2014-03-22 19:29 GMT+01:00 Eran Ifrah <eran.ifrah at gmail.com>:
> I am trying to use the C++ API with good success so far.
> 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)
> 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.
> I am missing something basic here, can anyone shed some light please? or
> give an example (better) of how to achieve this?
> Eran Ifrah
> Author of codelite, a cross platform open source C/C++ IDE:
> wxCrafter, a wxWidgets RAD: http://wxcrafter.codelite.org
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-dev