ignore+=valgrind check
[nethome.git] / bin / diffgdb
1 #! /usr/bin/perl
2 use strict;
3 use warnings;
4
5 my @ignore=(
6 qr{^.PASS: }o,
7 qr{^.KPASS: }o,
8 qr{^-FAIL: }o,
9 qr{^-KFAIL: }o,
10 qr{^-XFAIL: }o,
11 qr{^.Test Run By }o,
12 qr{^.gnatbind }o,
13 qr{^.gnatlink }o,
14 qr{^.gnatlink: }o,
15 qr{^.gnatmake: }o,
16 qr{^.gcc }o,
17 qr{^./usr/bin/ld: .* architecture of input file .* is incompatible with .* output\n$}o,
18 qr{^.collect2: }o,
19 #qr{^.UNSUPPORTED: }o,
20 #qr{^.UNTESTED: }o,
21 #qr{^.UNRESOLVED: }o,
22 #qr{^.ERROR: }o,
23 #qr{^.WARNING: }o,
24 qr{^.[^:]*[.]ad[sb]:[0-9]}o,
25 qr{^.(?:PASS|FAIL): gdb.server/ext-run.exp: get process list\n$}o,
26 qr{^.(?:PASS|FAIL): gdb.base/checkpoint.exp: info checkpoints with at least 600 checkpoints\n$}o,
27 qr{^.(?:PASS|FAIL): gdb.base/checkpoint.exp: break2 with many checkpoints\n$}o,
28 qr{^.(?:PASS|FAIL): gdb.base/interrupt.exp: }o,
29 qr{^.(?:PASS|FAIL): gdb.base/gdb1250.exp: }o,
30 qr{^.KFAIL: gdb.threads/watchthreads2.exp: gdb can drop watchpoints in multithreaded app \(PRMS: gdb/10116\)\n$}o,
31 qr{^.PASS: gdb.threads/watchthreads2.exp: all threads incremented x\n$}o,
32 qr{^.FAIL: gdb.base/sigbpt.exp: Verify that SIGSEGV occurs at the last STEPI insn \(none 0x[a-f0-9]*\)\n$}o,
33 qr{^.PASS: gdb.threads/threadcrash.exp: core file: }o,
34 qr{^.PASS: gdb.threads/watchthreads.exp: disable [0-9]*\n$}o,
35 qr{^.FAIL: gdb.mi/mi-nsmoribund.exp: unexpected stop\n$}o,
36 qr{^.PASS: gdb.mi/mi-nsmoribund.exp: resume all, program exited normally\n$}o,
37 qr{^.gdb compile failed, }o,
38 qr{^.gdb compile failed, /usr/bin/ld: /tmp/[a-zA-Z0-9]*.o: relocation R_X86_64_32S against `a local symbol. can not be used when making a shared object; recompile with -fPIC\n$}o,
39 qr{^./tmp/[a-zA-Z0-9]*.o: could not read symbols: Bad value\n$}o,
40 qr{^./tmp/[a-zA-Z0-9]*.s:\d+: Error: unrecognized symbol type "gnu_indirect_function"\n$}o,
41 qr{^./tmp/[a-zA-Z0-9]*.o: In function `\S+':\n$}o,
42 qr{^./tmp/[a-zA-Z0-9]*.o:.*: undefined reference to `.*'\n$}o,
43 qr{^./tmp/[a-zA-Z0-9]*.s:\d+: Error: syntax error; found `.' but expected `,'\n$}o,
44 qr{^./tmp/[a-zA-Z0-9]*.s:\d+: Error: junk at end of line: `.(?:plt|local)'\n$}o,
45 qr{^./usr/bin/ld: /tmp/[a-zA-Z0-9]*.o\(\.text\+0x[0-9a-f]+\): unresolvable R_PPC64_REL24 relocation against symbol `\S+'\n$}o,
46 qr{^.# of }o,
47 qr{^./home/}o,
48 qr{^.PASS: gdb.arch/i386-biarch-core.exp: core-file /home/.*/i386-biarch-core.core\n$}o,
49 qr{^.\.\./as-new [0-9.]*\n$}o,
50 qr{^.ld/ld-new [0-9.]*\n$}o,
51 qr{^.(?:PASS|FAIL): gdb.mi/mi-break.exp: test hitting breakpoint with commands\n$}o,
52 qr{^.(?:PASS|FAIL): gdb.threads/attach-stopped.exp: threaded: attach2, exit leaves process sleeping\n$}o,
53 qr{^.(?:PASS|FAIL): gdb.threads/attachstop-mt.exp: attach3, exit leaves process stopped\n$}o,
54 qr{^.(?:PASS|FAIL): gdb.threads/attachstop-mt.exp: attach4 stop by interrupt(?: \(timeout\))?\n$}o,
55 qr{^.(?:PASS|FAIL): gdb.threads/attachstop-mt.exp: attach4, exit leaves process sleeping\n$}o,
56 qr{^.(?:PASS|FAIL): gdb.threads/manythreads.exp: info threads\n$}o,
57 qr{gdb version  \d\S+ -nw -nx \n$}o,
58 qr{^.(?:PASS|FAIL): gdb.threads/attach-stopped.exp: threaded: attach1, exit leaves process stopped\n$}o,
59 qr{^.(?:PASS|FAIL): gdb.threads/local-watch-wrong-thread.exp: local watchpoint automatically deleted(?: \(timeout\))?\n$}o,
60 qr{^.(?:PASS|FAIL): gdb.server/server-run.exp: continue to main\n$}o,
61 qr{^.(?:PASS|FAIL): gdb.mi/mi-nonstop.exp: w1,i0 stop(?: \(timeout\))?\n$}o,
62 qr{^.(?:PASS|FAIL): gdb.reverse/i387-env-reverse.exp: set reverse direction(?: \(timeout\))?\n$}o,
63 qr{^.(?:PASS|FAIL): gdb.reverse/i387-env-reverse.exp: record to end of main(?: \(timeout\))?\n$}o,
64 qr{^.(?:PASS|FAIL): gdb.mi/mi-file-transfer.exp: compare intermediate binary file\n$}o,
65 qr{^.(?:PASS|FAIL): gdb.mi/mi-file-transfer.exp: compare binary file\n$}o,
66 qr{^.(?:PASS|FAIL): gdb.mi/mi-file-transfer.exp: deleted binary file\n$}o,
67 qr{^.(?:PASS|FAIL): gdb.mi/mi-simplerun.exp: continue to end(?: \(failed to resume\))?\n$}o,
68 qr{^.(?:PASS|FAIL): gdb.mi/mi-simplerun.exp: continue to end(?: \(unknown output after running\))?\n$}o,
69 qr{^.(?:PASS|FAIL): gdb.server/file-transfer.exp: verified deleted binary file\n$}o,
70 qr{^.(?:PASS|FAIL): gdb.server/file-transfer.exp: deleted binary file\n$}o,
71 qr{^.(?:PASS|FAIL): gdb.threads/attachstop-mt.exp: attach1, post-gdb sanity check of the sleeping state - Red Hat BZ 197584\n$}o,
72 qr{^."uplevel #0 source .*gdb/testsuite/gdb.threads/watchthreads-thr(?:eaded\.exp|.*\.\.\.)"\n$}o,
73 qr{^.(?:PASS|FAIL): gdb.cp/ref-types.exp: print value of rL\n$}o,
74 qr{^.FAIL: gdb.threads/watchthreads-reorder.exp: reorder[01]: (?:continue [ab]|rwatch unused1_rwatch)(?: \((?:timeout|the program exited|the program is no longer running)\))?\n$}o,
75 qr{^.FAIL: gdb.base/sigbpt.exp: Verify that SIGSEGV occurs at the last STEPI insn \(none 0x[0-9a-f]+\)\n$}o,
76 qr{^.(?:KFAIL|FAIL): gdb.base/sigbpt.exp: stepi bp at segv; stepi out of handler(?: \(corrupt pc\) \(PRMS: gdb/1702\))?\n$}o,
77 qr{^.(?:KFAIL|FAIL): gdb.base/sigbpt.exp: stepi bp before and at segv; stepi out of handler(?: \(corrupt pc\) \(PRMS: gdb/1702\))?\n$}o,
78 qr{^.FAIL: \S+\.exp: valgrind check \d+\n$}o,
79 );
80 my $ignore=shift @ignore;
81 $ignore=qr/$ignore|$_/ for @ignore;
82
83 my $opt_new;
84 while (1) {
85   if ($ARGV[0] eq "-r") {
86     $ignore=undef;
87     shift;
88     next;
89   }
90   if ($ARGV[0] eq "-N") {
91     $opt_new=1;
92     shift;
93     next;
94   }
95   last;
96 }
97
98 my $last;
99 my $lastfile;
100 local *DIFF;
101 my(@diff)=("diff","-rU-1",@ARGV);
102 open DIFF,"-|",@diff or die join(" ",@diff).": $!";
103 while (<DIFF>) {
104   next if /^diff /;
105   my($thisname)=m{^.(?:Running (?:.*/)?|[A-Z]+: )(gdb[.]\w+/\S+[.]exp)(?: \Q...\E|: .*)$};
106   $thisname||=(m{^.\t\t=== gdb (Summary) ===\n$})[0];
107   $thisname||=(m{^(Only in) })[0];
108   my $this;
109   if (!$thisname || ($last && $thisname eq $last->{"name"})) {
110 #if (!$thisname) { print "X: !thisname\n"; } else { print "X: \"".$last->{"name"}."\" -> \"$thisname\"\n"; }
111     $this=$last;
112   } else {
113 #print "X: new \"$thisname\"\n";
114     $last=$this={"name"=>$thisname,"+Running"=>(/^[+]/||0)};
115   }
116   next if /^@@ .* @@\n$/;
117   if ($this->{"print"}) {
118     print;
119     next;
120   }
121   if (/^Only in /) {
122     $lastfile=$_;
123   }
124   if (/^--- /) {
125     $lastfile=$_;
126     next;
127   }
128   if (/^\Q+++\E /) {
129     $lastfile.=$_;
130     next;
131   }
132   $this->{"buffer"}.=$_;
133   next if /^ /;
134   next if /^[+]Running / && $thisname && !$opt_new;
135   next if $ignore && /$ignore/o;
136   next if /^[+]FAIL: / && $this->{"+Running"};
137   next if /^[+]KFAIL: / && $this->{"+Running"};
138   next if /^[+]XFAIL: / && $this->{"+Running"};
139   next if /^[+]UNTESTED: / && $this->{"+Running"};
140   next if /^[+]gdb compile failed, / && $this->{"+Running"};
141   next if /^[+].*: Error: bad register name `%.*'\n$/ && $this->{"+Running"};
142   next if /^[+].*: Error: `.*' is only supported in 64-bit mode\n$/ && $this->{"+Running"};
143
144   $this->{"print"}=1;
145   print $lastfile||""; $lastfile=undef();
146   print "\n#".($this->{"name"}||"???")."\n";
147   print $this->{"buffer"}; $this->{"buffer"}=undef();
148   next;
149 }