This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Make sure we don't drop asynchronous output when sourcing files
ClosedPublic

Authored by labath on Mar 2 2020, 6:58 AM.

Details

Summary

If a command from a sourced file produces asynchronous output, this
output often does not make its way to the user. This happens because the
asynchronous output machinery relies on the iohandler stack to ensure
the output does not interfere with the things the iohandler is doing.

However, if this happens near the end of the command stream then by the
time the asynchronous output is produced we may already have already
started tearing down the sourcing session. Specifically, we may already
pop the relevant iohandler, leaving the stack empty.

This patch makes sure this kind of output gets printed by adding a
fallback to IOHandlerStack::PrintAsync to print the output directly if
the stack is empty. This is safe because if we have no iohandlers then
there is nothing to synchronize.

Diff Detail

Event Timeline

labath created this revision.Mar 2 2020, 6:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2020, 6:58 AM

To the best of my understanding of the IOHandler this LGTM, but I'd like to have Greg look at it too.

clayborg accepted this revision.Mar 2 2020, 10:10 AM

LGTM, check remote build failure to be sure!

This revision is now accepted and ready to land.Mar 2 2020, 10:10 AM
labath added a subscriber: kuhnel.Mar 3 2020, 1:50 AM

check remote build failure to be sure!

That looks like an infrastructure problem. I've seen that on all lldb patches. I think that lldb is just not integrated into the presubmit checking system...

This revision was automatically updated to reflect the committed changes.