forked from OSchip/llvm-project
[lldb/Reproducer] Disable buffering of stdout during replay
Different buffering behavior during capture and replay caused some of the shell tests to fail when run from a reproducer. By disabling stdout buffering we get a better approximation of how things get flushed during an regular debug session. There is a performance impact but since this only affects replay this is acceptable.
This commit is contained in:
parent
4751e4f8c2
commit
c4144caf9b
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "lldb/Utility/ReproducerInstrumentation.h"
|
||||
#include "lldb/Utility/Reproducer.h"
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace lldb_private;
|
||||
using namespace lldb_private::repro;
|
||||
|
@ -47,6 +48,10 @@ bool Registry::Replay(llvm::StringRef buffer) {
|
|||
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
|
||||
#endif
|
||||
|
||||
// Disable buffering stdout so that we approximate the way things get flushed
|
||||
// during an interactive session.
|
||||
setvbuf(stdout, nullptr, _IONBF, 0);
|
||||
|
||||
Deserializer deserializer(buffer);
|
||||
while (deserializer.HasData(1)) {
|
||||
unsigned id = deserializer.Deserialize<unsigned>();
|
||||
|
|
Loading…
Reference in New Issue