This is an archive of the discontinued LLVM Phabricator instance.

Allow redirection to pts for POSIX process
ClosedPublic

Authored by zephyr on Aug 31 2014, 12:29 AM.

Details

Reviewers
tfiala
Summary

I'm using lldb as a lib and I need to redirect inferior stdin/out/err to my own pts.
However, I find that, if the path matches with "/dev/pts/", it will be changed to NULL.
One workaround is to make symbolic link sto my dev/pts/x to bypass the problem.

The attached patch provides a fix for the issue.

Diff Detail

Event Timeline

zephyr updated this revision to Diff 13126.Aug 31 2014, 12:29 AM
zephyr retitled this revision from to Allow redirection to pts for POSIX process.
zephyr updated this object.
zephyr edited the test plan for this revision. (Show Details)
zephyr added a subscriber: Unknown Object (MLST).
tfiala edited edge metadata.Sep 4 2014, 1:13 PM

I tried running the tests with this change on Ubuntu 14.04 x86_64 (via 'ninja check-lldb' on a cmake/ninja build). The tests appear to be locked up.

Can you verify your change with the test suite, zephyr? Thanks!

zephyr updated this revision to Diff 13355.Sep 5 2014, 9:43 PM
zephyr edited edge metadata.

Hi Todd,

I'm sorry for the issue. It's a stupid error. Fixed in patchset 2. On my x86-64, ninja check-lldb shows
FAILED (errors=5, skipped=5)
Ran 309 tests.

it matches the output without my change.

tfiala added a comment.Sep 8 2014, 9:00 AM

No worries, trying this again with patch set 2.

tfiala accepted this revision.Sep 8 2014, 9:04 AM
tfiala edited edge metadata.

LGTM.

Tested:
Ubuntu 14.04 x86_64, clang-3.5-built lldb.

This revision is now accepted and ready to land.Sep 8 2014, 9:04 AM
tfiala closed this revision.Sep 8 2014, 9:07 AM

Submitted here:

svn commit
Sending        source/Plugins/Process/POSIX/ProcessPOSIX.cpp
Sending        source/Plugins/Process/POSIX/ProcessPOSIX.h
Transmitting file data ..
Committed revision 217382.