+--valgrind
authorjkratoch <>
Wed, 15 Sep 2010 18:23:53 +0000 (18:23 +0000)
committerjkratoch <>
Wed, 15 Sep 2010 18:23:53 +0000 (18:23 +0000)
bin/hammock

index aecac0c..683f6f9 100755 (executable)
@@ -50,6 +50,7 @@ my $strip;
 # Can't bind address: Address already in use.
 # <last 2 lines repearing>
 my $gdbserver;
 # Can't bind address: Address already in use.
 # <last 2 lines repearing>
 my $gdbserver;
+my $valgrind;
 die if !GetOptions(
   "i|userid=s"=>\$userid,
     "force"=>\$force,
 die if !GetOptions(
   "i|userid=s"=>\$userid,
     "force"=>\$force,
@@ -70,6 +71,7 @@ die if !GetOptions(
     "gdbcvspie"=>\$gdbcvspie,
     "strip"=>\$strip,
     "gdbserver"=>\$gdbserver,
     "gdbcvspie"=>\$gdbcvspie,
     "strip"=>\$strip,
     "gdbserver"=>\$gdbserver,
+    "valgrind"=>\$valgrind,
 );
 $component and ($component=~m{^(?:(?:fedora|rhel)(?:gdb|binutils|glibc)|gdbcvs|binutilscvs|archer-.*|/home/.*)$} or die "-c|--component required to be: fedoragdb|rhelgdb|fedorabinutils|rhelbinutils|fedoraglibc|rhelglibc|gdbcvs|binutilscvs|archer-*|/home/*");
 $component and $component=~m{^/home/} and (-f "$component/gdb/gdbtypes.c" or die "$component/gdb/gdbtypes.c not found");
 );
 $component and ($component=~m{^(?:(?:fedora|rhel)(?:gdb|binutils|glibc)|gdbcvs|binutilscvs|archer-.*|/home/.*)$} or die "-c|--component required to be: fedoragdb|rhelgdb|fedorabinutils|rhelbinutils|fedoraglibc|rhelglibc|gdbcvs|binutilscvs|archer-*|/home/*");
 $component and $component=~m{^/home/} and (-f "$component/gdb/gdbtypes.c" or die "$component/gdb/gdbtypes.c not found");
@@ -85,7 +87,9 @@ if ($component=~/^(gdb|binutils)cvs$/) {
 !$gdbcvspie or $component eq "gdbcvs" or die "--gdbcvspie requires -c gdbcvs";
 @target and ($srcrpm or $component=~/^(?:fedora|rhel)/) and die "--target is available only for baretestsuite modes";
 $strip and ($srcrpm or $component=~/^(?:fedora|rhel)/) and die "--strip is available only for baretestsuite modes";
 !$gdbcvspie or $component eq "gdbcvs" or die "--gdbcvspie requires -c gdbcvs";
 @target and ($srcrpm or $component=~/^(?:fedora|rhel)/) and die "--target is available only for baretestsuite modes";
 $strip and ($srcrpm or $component=~/^(?:fedora|rhel)/) and die "--strip is available only for baretestsuite modes";
-$gdbserver and $component ne "gdbcvs" and die "--gdbserver is available only gdbcvs";
+$gdbserver and $component ne "gdbcvs" and die "--gdbserver is available only for gdbcvs";
+$valgrind and $component ne "gdbcvs" and die "--valgrind is available only for gdbcvs";
+$gdbserver and $valgrind and die "--gdbserver and --valgrind are mutually exclusive";
 my %target;
 do { error "Duplicate target: $_\n" if $target{$_}++; } for @target;
 @arch="x86_64" if @target&&!@arch;
 my %target;
 do { error "Duplicate target: $_\n" if $target{$_}++; } for @target;
 @arch="x86_64" if @target&&!@arch;
@@ -443,7 +447,15 @@ while (@distrouse || keys(%child)) {
        @check=map("check//unix/$_",@check);
        @check=map({($_,"$_/-fPIE/-pie");} @check) if $gdbcvspie;
        # for i in ".join(" ",@check).";do orphanripper make -k \$i || :;done
        @check=map("check//unix/$_",@check);
        @check=map({($_,"$_/-fPIE/-pie");} @check) if $gdbcvspie;
        # for i in ".join(" ",@check).";do orphanripper make -k \$i || :;done
-       mockrun "cd $baretestsuite; $errs12; cd gdb; ulimit -c unlimited; ".(!$gdbserver?"":'DEJAGNU=$HOME/src/runtest-gdbserver/site.exp ')."orphanripper make -k ".join(" ",@check).(!$gdbserver?"":' RUNTESTFLAGS=--target_board=native-gdbserver')." FORCE_PARALLEL=1 || :; ".q{for t in sum log;do for file in testsuite*/gdb.$t;do suffix="${file#testsuite.unix.}"; suffix="${suffix%/gdb.$t}"; ln $file}." $out/gdb".q{$suffix.$t || :; done; done;};
+       mockrun "cd $baretestsuite; $errs12"
+               .(!$valgrind?"":' --without-python')    # FIXME: Fix valgrind --suppressions
+               ."; cd gdb; ulimit -c unlimited; "
+               .(!$gdbserver?"":'DEJAGNU=$HOME/src/runtest-gdbserver/site.exp ')
+               .(!$valgrind?"":'DEJAGNU=$HOME/src/runtest-valgrind/site.exp ')
+               ."orphanripper make -k ".join(" ",@check)
+               .(!$gdbserver?"":' RUNTESTFLAGS=--target_board=native-gdbserver')
+               .(!$valgrind?"":' RUNTESTFLAGS=--target_board=valgrind')
+               ." FORCE_PARALLEL=1 || :; ".q{for t in sum log;do for file in testsuite*/gdb.$t;do suffix="${file#testsuite.unix.}"; suffix="${suffix%/gdb.$t}"; ln $file}." $out/gdb".q{$suffix.$t || :; done; done;};
       }
       # gdbunpack does:
       #                perl -i -pe 's{\Q'"$HOME"'\E/.*?/build/[^/]*/}{}g' "$base"/*
       }
       # gdbunpack does:
       #                perl -i -pe 's{\Q'"$HOME"'\E/.*?/build/[^/]*/}{}g' "$base"/*