X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=bin%2Fdiffgdb;h=fdce709bd4b4162ebe34b8c144e0f611fea86560;hb=887320dc69e5162de5d27f9f0b571f1f5746626e;hp=6380007d537887f7beacb96ccb42868a456d4afb;hpb=e057efa81788592031f641ce5aeb5e73a9ca5d69;p=nethome.git diff --git a/bin/diffgdb b/bin/diffgdb index 6380007..fdce709 100755 --- a/bin/diffgdb +++ b/bin/diffgdb @@ -2,6 +2,21 @@ use strict; use warnings; +sub gitmark($) { + my($s)=@_; + return "" if $s!~m{^(... )([^/]*/+[^/]*)/}; + my($pfx,$dir)=($1,$2); + local *GIT; + $dir.="/build/gdbgit"; + return "" if !-d $dir; + open GIT,"cd '$dir';git log --format=%H HEAD^..HEAD|" or return ""; + my $git=do { local $/; ; }; + close GIT; + chomp $git; + return "${pfx}GIT commit $git\n" if $git=~/^[0-9a-f]{40}$/; + return ""; +} + my @ignore=( qr{^.PASS: }o, qr{^.KPASS: }o, @@ -39,6 +54,9 @@ qr{\bgdb version \d\S+ -nw -nx\b}o, qr{^.FAIL: \S+\.exp: valgrind check \d+\n$}o, qr{^.KFAIL: gdb.threads/watchthreads2.exp: gdb can drop watchpoints in multithreaded app \(PRMS: gdb/10116\)\n$}o, qr{^.FAIL: gdb.base/info-os.exp: .*\n$}o, +qr{^.FAIL: gdb.threads/multiple-step-overs.exp: .*\n$}o, +qr{^.FAIL: gdb.base/random-signal.exp: stop with control-c \Q(timeout)\E\n$}o, +qr{^.(?:XFAIL|PASS): gdb.threads/attach-many-short-lived-threads.exp: iter \d+: attach(?: \(EPERM\))?\n$}o, ); my $ignore=shift @ignore; $ignore=qr/$ignore|$_/ for @ignore; @@ -85,11 +103,11 @@ while () { $lastfile=$_; } if (/^--- /) { - $lastfile=$_; + $lastfile=$_.gitmark($_); next; } if (/^\Q+++\E /) { - $lastfile.=$_; + $lastfile.=$_.gitmark($_); next; } $this->{"buffer"}.=$_;