This is an archive of the discontinued LLVM Phabricator instance.

update TestRunCommandInterpreterAPI to use SBFile
ClosedPublic

Authored by lawrence_danna on Oct 9 2019, 3:03 PM.

Details

Summary

If you look at what this test is doing, it's actually quite
mysterious why it works at all. It sets the input file
inside a "with open". As soon as the with block ends,
that file will be closed. And yet somehow LLDB reads
commands from it anyway. What's actually happening is that
the file descriptor gets dup'd when something inside LLDB
calls File::GetStream(). I think it's fair to say that
what this test is doing is illegal and it has no right
to expect it to work.

This patch updates the test with two cases. One uses
the SBFile api, and actually transfers ownership of
the original file descriptor to the debugger. The other
just uses the old FILE* API, but in a sane way.

I also set NO_DEBUG_INFO_TESTCASE, because this test doesn't
use any debug info and doesn't need to run three times.

Event Timeline

lawrence_danna created this revision.Oct 9 2019, 3:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2019, 3:03 PM
Herald added a subscriber: aprantl. · View Herald Transcript
labath accepted this revision.Oct 10 2019, 12:48 AM

Makes sense to me.

This revision is now accepted and ready to land.Oct 10 2019, 12:48 AM
This revision was automatically updated to reflect the committed changes.

This is still failing on the Windows bot. Please fix it ASAP or revert it.

This is still failing on the Windows bot. Please fix it ASAP or revert it.

Sorry,i didn’t see this. I’ll fix it today

This is still failing on the Windows bot. Please fix it ASAP or revert it.

fix here https://reviews.llvm.org/D68951