Remove buffering of test output by making stack fixers not buffer their standard output. (Bug 510014)
authorL. David Baron <dbaron@dbaron.org>
Wed, 12 Aug 2009 15:20:52 -0700
changeset 31405 bfa6573b72a48e4a2e281096f9b2f0f8c20fde1a
parent 31404 1d22a0d5a8fffc65a057b9cbe6d699dde25dd37a
child 31406 b9985fb2557f055a61ce68de93950e54e64278f3
push idunknown
push userunknown
push dateunknown
bugs510014
milestone1.9.2a2pre
Remove buffering of test output by making stack fixers not buffer their standard output. (Bug 510014)
tools/rb/fix-linux-stack.pl
tools/rb/fix-macosx-stack.pl
--- a/tools/rb/fix-linux-stack.pl
+++ b/tools/rb/fix-linux-stack.pl
@@ -238,16 +238,17 @@ sub addr2line_pipe($) {
                         '/usr/bin/addr2line', '-C', '-f', '-e', $debug_file);
         $pipes{$file} = $pipe;
     } else {
         $pipe = $pipes{$file};
     }
     return $pipe;
 }
 
+select STDOUT; $| = 1; # make STDOUT unbuffered
 while (<>) {
     my $line = $_;
     if ($line =~ /^([ \|0-9-]*)(.*) ?\[([^ ]*) \+(0x[0-9A-F]{1,8})\](.*)$/) {
         my $before = $1; # allow preservation of balance trees
         my $badsymbol = $2;
         my $file = $3;
         my $address = hex($4);
         my $after = $5; # allow preservation of counts
--- a/tools/rb/fix-macosx-stack.pl
+++ b/tools/rb/fix-macosx-stack.pl
@@ -214,16 +214,17 @@ sub nm_lookup($$) {
     return {
              symbol => cxxfilt($sym->[1]),
              symbol_offset => ($address - $sym->[0]),
              file => array_lookup($nmstruct->{files}, $address)->[1],
              line => array_lookup($nmstruct->{lines}, $address)->[1]
            };
 }
 
+select STDOUT; $| = 1; # make STDOUT unbuffered
 while (<>) {
     my $line = $_;
     if ($line =~ /^([ \|0-9-]*)(.*) ?\[([^ ]*) \+(0x[0-9A-F]{1,8})\](.*)$/) {
         my $before = $1; # allow preservation of balance trees
         my $badsymbol = $2;
         my $file = $3;
         my $address = hex($4);
         my $after = $5; # allow preservation of counts