From: jkratoch <> Date: Sun, 14 Mar 2010 09:40:14 +0000 (+0000) Subject: Unify diffgdbfilt into diffgdb. X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=7d51d1c10f33e2d6fd505763f32b44353e14042c Unify diffgdbfilt into diffgdb. --- diff --git a/bin/diffgdb b/bin/diffgdb index f67c66c..28fe7ac 100755 --- a/bin/diffgdb +++ b/bin/diffgdb @@ -1,70 +1,127 @@ -#! /bin/sh -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 '^gnatlink: ' \ - -I '^gnatmake: ' \ - -I '^gcc ' \ - -I '^/usr/bin/ld: .* architecture of input file .* is incompatible with .* output$' \ - -I '^collect2: ' \ - -I '^UNSUPPORTED: ' \ - -I '^UNTESTED: ' \ - -I '^UNRESOLVED: ' \ - -I '^ERROR: ' \ - -I '^WARNING: ' \ - -I '^Running ' \ - -I '^[^:]*[.]ad[sb]:[0-9]' \ - -I '^\(PASS\|FAIL\): gdb.server/ext-run.exp: get process list$' \ - -I '^\(PASS\|FAIL\): gdb.base/checkpoint.exp: info checkpoints with at least 600 checkpoints$' \ - -I '^\(PASS\|FAIL\): gdb.base/checkpoint.exp: break2 with many checkpoints$' \ - -I '^\(PASS\|FAIL\): gdb.base/interrupt.exp: ' \ - -I '^\(PASS\|FAIL\): gdb.base/gdb1250.exp: ' \ - -I '^KFAIL: gdb.threads/watchthreads2.exp: gdb can drop watchpoints in multithreaded app (PRMS: gdb/10116)$' \ - -I '^PASS: gdb.threads/watchthreads2.exp: all threads incremented x$' \ - -I '^FAIL: gdb.base/sigbpt.exp: Verify that SIGSEGV occurs at the last STEPI insn (none 0x[a-f0-9]*)$' \ - -I '^PASS: gdb.threads/threadcrash.exp: core file: ' \ - -I '^PASS: gdb.threads/watchthreads.exp: disable [0-9]*$' \ - -I '^FAIL: gdb.mi/mi-nsmoribund.exp: unexpected stop$' \ - -I '^PASS: gdb.mi/mi-nsmoribund.exp: resume all, program exited normally$' \ - -I '^gdb compile failed, ' \ - -I '^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$' \ - -I '^/tmp/[a-zA-Z0-9]*.o: could not read symbols: Bad value$' \ - -I '^# of ' \ - -I '^/home/' \ - -I '^PASS: gdb.arch/i386-biarch-core.exp: core-file /home/.*/i386-biarch-core.core$' \ - -I '^\.\./as-new [0-9.]*$' \ - -I '^ld/ld-new [0-9.]*$' \ - -I '^\(PASS\|FAIL\): gdb.mi/mi-break.exp: test hitting breakpoint with commands$' \ - -I '^\(PASS\|FAIL\): gdb.threads/attach-stopped.exp: threaded: attach2, exit leaves process sleeping$' \ - -I '^\(PASS\|FAIL\): gdb.threads/attachstop-mt.exp: attach3, exit leaves process stopped$' \ - -I '^\(PASS\|FAIL\): gdb.threads/attachstop-mt.exp: attach4 stop by interrupt\(\| (timeout)\)$' \ - -I '^\(PASS\|FAIL\): gdb.threads/attachstop-mt.exp: attach4, exit leaves process sleeping$' \ - -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/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.reverse/i387-env-reverse.exp: record to end of main\(\| (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 +#! /usr/bin/perl +use strict; +use warnings; -# -I '^"uplevel #0 source .*gdb/testsuite/gdb.threads/watchthreads-thr.*\.\.\."$' \ +my @ignore=( +qr{^.Test Run By }o, +qr{^.gnatbind }o, +qr{^.gnatlink }o, +qr{^.gnatlink: }o, +qr{^.gnatmake: }o, +qr{^.gcc }o, +qr{^./usr/bin/ld: .* architecture of input file .* is incompatible with .* output\n$}o, +qr{^.collect2: }o, +qr{^.UNSUPPORTED: }o, +qr{^.UNTESTED: }o, +qr{^.UNRESOLVED: }o, +qr{^.ERROR: }o, +qr{^.WARNING: }o, +qr{^.Running }o, +qr{^.[^:]*[.]ad[sb]:[0-9]}o, +qr{^.(?:PASS|FAIL): gdb.server/ext-run.exp: get process list\n$}o, +qr{^.(?:PASS|FAIL): gdb.base/checkpoint.exp: info checkpoints with at least 600 checkpoints\n$}o, +qr{^.(?:PASS|FAIL): gdb.base/checkpoint.exp: break2 with many checkpoints\n$}o, +qr{^.(?:PASS|FAIL): gdb.base/interrupt.exp: }o, +qr{^.(?:PASS|FAIL): gdb.base/gdb1250.exp: }o, +qr{^.KFAIL: gdb.threads/watchthreads2.exp: gdb can drop watchpoints in multithreaded app \(PRMS: gdb/10116\)\n$}o, +qr{^.PASS: gdb.threads/watchthreads2.exp: all threads incremented x\n$}o, +qr{^.FAIL: gdb.base/sigbpt.exp: Verify that SIGSEGV occurs at the last STEPI insn \(none 0x[a-f0-9]*\)\n$}o, +qr{^.PASS: gdb.threads/threadcrash.exp: core file: }o, +qr{^.PASS: gdb.threads/watchthreads.exp: disable [0-9]*\n$}o, +qr{^.FAIL: gdb.mi/mi-nsmoribund.exp: unexpected stop\n$}o, +qr{^.PASS: gdb.mi/mi-nsmoribund.exp: resume all, program exited normally\n$}o, +qr{^.gdb compile failed, }o, +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, +qr{^./tmp/[a-zA-Z0-9]*.o: could not read symbols: Bad value\n$}o, +qr{^.# of }o, +qr{^./home/}o, +qr{^.PASS: gdb.arch/i386-biarch-core.exp: core-file /home/.*/i386-biarch-core.core\n$}o, +qr{^.\.\./as-new [0-9.]*\n$}o, +qr{^.ld/ld-new [0-9.]*\n$}o, +qr{^.(?:PASS|FAIL): gdb.mi/mi-break.exp: test hitting breakpoint with commands\n$}o, +qr{^.(?:PASS|FAIL): gdb.threads/attach-stopped.exp: threaded: attach2, exit leaves process sleeping\n$}o, +qr{^.(?:PASS|FAIL): gdb.threads/attachstop-mt.exp: attach3, exit leaves process stopped\n$}o, +qr{^.(?:PASS|FAIL): gdb.threads/attachstop-mt.exp: attach4 stop by interrupt(?: \(timeout\))?\n$}o, +qr{^.(?:PASS|FAIL): gdb.threads/attachstop-mt.exp: attach4, exit leaves process sleeping\n$}o, +qr{^.(?:PASS|FAIL): gdb.threads/manythreads.exp: info threads\n$}o, +qr{gdb version [0-9][^ ]* -nw -nx \n$}o, +qr{^.(?:PASS|FAIL): gdb.threads/attach-stopped.exp: threaded: attach1, exit leaves process stopped\n$}o, +qr{^.(?:PASS|FAIL): gdb.threads/local-watch-wrong-thread.exp: local watchpoint automatically deleted(?: \(timeout\))?\n$}o, +qr{^.(?:PASS|FAIL): gdb.server/server-run.exp: continue to main\n$}o, +qr{^.(?:PASS|FAIL): gdb.mi/mi-nonstop.exp: w1,i0 stop(?: \(timeout\))?\n$}o, +qr{^.(?:PASS|FAIL): gdb.reverse/i387-env-reverse.exp: set reverse direction(?: \(timeout\))?\n$}o, +qr{^.(?:PASS|FAIL): gdb.reverse/i387-env-reverse.exp: record to end of main(?: \(timeout\))?\n$}o, +qr{^.(?:PASS|FAIL): gdb.mi/mi-file-transfer.exp: compare intermediate binary file\n$}o, +qr{^.(?:PASS|FAIL): gdb.mi/mi-file-transfer.exp: compare binary file\n$}o, +qr{^.(?:PASS|FAIL): gdb.mi/mi-file-transfer.exp: deleted binary file\n$}o, +qr{^.(?:PASS|FAIL): gdb.mi/mi-simplerun.exp: continue to end(?: \(failed to resume\))?\n$}o, +qr{^.(?:PASS|FAIL): gdb.mi/mi-simplerun.exp: continue to end(?: \(unknown output after running\))?\n$}o, +qr{^.(?:PASS|FAIL): gdb.server/file-transfer.exp: verified deleted binary file\n$}o, +qr{^.(?:PASS|FAIL): gdb.server/file-transfer.exp: deleted binary file\n$}o, +qr{^.(?:PASS|FAIL): gdb.threads/attachstop-mt.exp: attach1, post-gdb sanity check of the sleeping state - Red Hat BZ 197584\n$}o, +qr{^."uplevel #0 source .*gdb/testsuite/gdb.threads/watchthreads-thr.*\.\.\."\n$}o, +); +my $ignore=shift @ignore; +$ignore=qr/$ignore|$_/o for @ignore; + +if ($ARGV[0] eq "-r") { + $ignore=undef; + shift; +} + +my $last; +my $lastfile; +local *DIFF; +my(@diff)=("diff","-rU-1",@ARGV); +open DIFF,"-|",@diff or die join(" ",@diff).": $!"; +while () { + next if /^diff /; + my($thisname)=m{^.(?:Running (?:.*/)?|[A-Z]+: )(gdb[.]\w+/\S+[.]exp)(?: \Q...\E|: .*)$}; + $thisname||=(m{^.\t\t=== gdb (Summary) ===\n$})[0]; + 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 /^-KPASS: /; + next if /^-FAIL: /; + next if /^-KFAIL: /; + next if /^-XFAIL: /; + next if /^.# of .*\t\d+\n$/; + next if $ignore && /$ignore/o; + 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; +} diff --git a/bin/diffgdbdir b/bin/diffgdbdir index 1866de2..d29fa10 100755 --- a/bin/diffgdbdir +++ b/bin/diffgdbdir @@ -1,7 +1,7 @@ #! /bin/sh x="*.log" -o="-f" +o="" if [ "$1" = "-r" ];then o="-r" shift diff --git a/bin/diffgdbfilt b/bin/diffgdbfilt deleted file mode 100755 index 36194ce..0000000 --- a/bin/diffgdbfilt +++ /dev/null @@ -1,54 +0,0 @@ -#! /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 /^-KPASS: /; - 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; -}