[Reproducers] Flush files to disk periodically
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 8 May 2019 21:07:19 +0000 (21:07 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 8 May 2019 21:07:19 +0000 (21:07 +0000)
Periodically flush some of the data to disk. Although not perfect, this
helps when the debugger crashes.

llvm-svn: 360286

lldb/include/lldb/Utility/Reproducer.h
lldb/include/lldb/Utility/ReproducerInstrumentation.h

index 14b9309..60e6ffe 100644 (file)
@@ -126,6 +126,7 @@ public:
     m_os << t;
     if (newline)
       m_os << '\n';
+    m_os.flush();
   }
 
   const FileSpec &GetFilename() { return m_filename; }
index 6835e8e..f90ce4b 100644 (file)
@@ -542,7 +542,9 @@ public:
     SerializeAll(tail...);
   }
 
-  void SerializeAll() {}
+  void SerializeAll() {
+    m_stream.flush();
+  }
 
 private:
   /// Serialize pointers. We need to differentiate between pointers to