New diffgdbfilt.
authorjkratoch <>
Sat, 6 Mar 2010 20:41:26 +0000 (20:41 +0000)
committerjkratoch <>
Sat, 6 Mar 2010 20:41:26 +0000 (20:41 +0000)
diffgdb: Extend -Is.

bin/diffgdb
bin/diffgdbfilt [new file with mode: 0755]

index 260cbce..e34b9c8 100755 (executable)
@@ -1,5 +1,14 @@
 #! /bin/sh
 #! /bin/sh
-exec diff \
+filt=true
+if [ "$1" = "-r" ];then
+  filt=false
+  shift
+fi
+if [ "$1" = "-f" ];then
+  filt=true
+  shift
+fi
+exec diff $(if false && $filt;then echo "-U999999";else echo "-u";fi) \
        -I '^Test Run By ' \
        -I '^gnatbind ' \
        -I '^gnatlink ' \
        -I '^Test Run By ' \
        -I '^gnatbind ' \
        -I '^gnatlink ' \
@@ -43,4 +52,18 @@ exec diff \
        -I '^\(PASS\|FAIL\): gdb.threads/manythreads.exp: info threads$' \
        -I 'gdb version  [0-9][^ ]* -nw -nx $' \
        -I '^\(PASS\|FAIL\): gdb.threads/attach-stopped.exp: threaded: attach1, exit leaves process stopped$' \
        -I '^\(PASS\|FAIL\): gdb.threads/manythreads.exp: info threads$' \
        -I 'gdb version  [0-9][^ ]* -nw -nx $' \
        -I '^\(PASS\|FAIL\): gdb.threads/attach-stopped.exp: threaded: attach1, exit leaves process stopped$' \
--ru "$@" | grep -v '^diff '
+       -I '^\(PASS\|FAIL\): gdb.threads/local-watch-wrong-thread.exp: local watchpoint automatically deleted\(\| (timeout)\)$' \
+       -I '^\(PASS\|FAIL\): gdb.server/server-run.exp: continue to main$' \
+       -I '^\(PASS\|FAIL\): gdb.mi/mi-nonstop.exp: w1,i0 stop\(\| (timeout)\)$' \
+       -I '^\(PASS\|FAIL\): gdb.reverse/i387-env-reverse.exp: set reverse direction\(\| (timeout)\)$' \
+       -I '^\(PASS\|FAIL\): gdb.mi/mi-file-transfer.exp: compare intermediate binary file$' \
+       -I '^\(PASS\|FAIL\): gdb.mi/mi-file-transfer.exp: compare binary file$' \
+       -I '^\(PASS\|FAIL\): gdb.mi/mi-file-transfer.exp: deleted binary file$' \
+       -I '^\(PASS\|FAIL\): gdb.mi/mi-simplerun.exp: continue to end\(\| (failed to resume)\)$' \
+       -I '^\(PASS\|FAIL\): gdb.mi/mi-simplerun.exp: continue to end\(\| (unknown output after running)\)$' \
+       -I '^\(PASS\|FAIL\): gdb.server/file-transfer.exp: verified deleted binary file$' \
+       -I '^\(PASS\|FAIL\): gdb.server/file-transfer.exp: deleted binary file$' \
+       -I '^\(PASS\|FAIL\): gdb.threads/attachstop-mt.exp: attach1, post-gdb sanity check of the sleeping state - Red Hat BZ 197584$' \
+-ru "$@" | if $filt;then diffgdbfilt;else grep -v '^diff ';fi
+
+#      -I '^"uplevel #0 source .*gdb/testsuite/gdb.threads/watchthreads-thr.*\.\.\."$' \
diff --git a/bin/diffgdbfilt b/bin/diffgdbfilt
new file mode 100755 (executable)
index 0000000..05edbf8
--- /dev/null
@@ -0,0 +1,53 @@
+#! /usr/bin/perl
+use strict;
+use warnings;
+
+my $last;
+my $lastfile;
+while (<>) {
+  next if /^diff /;
+  my($thisname)=m{^.(?:Running (?:.*/)?|[A-Z]+: )(gdb[.]\w+/\S+[.]exp)(?: \Q...\E|: .*)$};
+  my $this;
+  if (!$thisname || ($last && $thisname eq $last->{"name"})) {
+#if (!$thisname) { print "X: !thisname\n"; } else { print "X: \"".$last->{"name"}."\" -> \"$thisname\"\n"; }
+    $this=$last;
+  } else {
+#print "X: new \"$thisname\"\n";
+    $last=$this={"name"=>$thisname,"+Running"=>(/^[+]/||0)};
+  }
+  next if /^@@ .* @@\n$/;
+  if ($this->{"print"}) {
+    print;
+    next;
+  }
+  if (/^--- /) {
+    $lastfile=$_;
+    next;
+  }
+  if (/^\Q+++\E /) {
+    $lastfile.=$_;
+    next;
+  }
+  $this->{"buffer"}.=$_;
+  next if /^ /;
+  next if /^[+]Running / && $thisname;
+  next if /^[+]PASS: /;
+  next if /^[+]KPASS: /;
+  next if /^-PASS: /;
+  next if /^-FAIL: /;
+  next if /^-KFAIL: /;
+  next if /^-XFAIL: /;
+  next if /^[+]FAIL: / && $this->{"+Running"};
+  next if /^[+]KFAIL: / && $this->{"+Running"};
+  next if /^[+]XFAIL: / && $this->{"+Running"};
+  next if /^[+]UNTESTED: / && $this->{"+Running"};
+  next if /^[+]gdb compile failed, / && $this->{"+Running"};
+  next if /^[+].*: Error: bad register name `%.*'\n$/ && $this->{"+Running"};
+  next if /^[+].*: Error: `.*' is only supported in 64-bit mode\n$/ && $this->{"+Running"};
+
+  $this->{"print"}=1;
+  print $lastfile||""; $lastfile=undef();
+  print "\n#".$this->{"name"}."\n";
+  print $this->{"buffer"}; $this->{"buffer"}=undef();
+  next;
+}