flush spike log after initial write.
authorTim Newsome <tim@sifive.com>
Wed, 13 Jul 2016 17:37:53 +0000 (10:37 -0700)
committerTim Newsome <tim@sifive.com>
Tue, 19 Jul 2016 18:24:25 +0000 (11:24 -0700)
This makes sure the execution line is the first one in the logfile.

debug/testlib.py

index 3339e9b49a88afaf22538f7029ce5e87c48577aa..e9b17d0283bdeb253cab412a24c31907f567f455 100644 (file)
@@ -65,6 +65,7 @@ class Spike(object):
             cmd.append(binary)
         logfile = open("spike.log", "w")
         logfile.write("+ %s\n" % " ".join(cmd))
+        logfile.flush()
         self.process = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=logfile,
                 stderr=logfile)