From: Philippe Waroquiers Date: Sat, 12 Nov 2016 11:22:50 +0000 (+0000) Subject: Outer/inner setup : allow append to outer args, use a bigger --num-callers X-Git-Tag: svn/VALGRIND_3_13_0~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec6077e25aa7de0182492d71e6840cd1b8efda1d;p=thirdparty%2Fvalgrind.git Outer/inner setup : allow append to outer args, use a bigger --num-callers * Similarly to what was done in revision r16104 for vg_perf, have a way to append to predefined vg_regtest outer args, rather than only be able to replace them. * increase the num callers for outer tool to 40. (This is in preparation of a future commit, that will allow outer tool to append the inner guest stack trace to reported errors in the inner) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16133 --- diff --git a/perf/vg_perf.in b/perf/vg_perf.in index 009ce3ce36..380dda43d8 100644 --- a/perf/vg_perf.in +++ b/perf/vg_perf.in @@ -71,8 +71,9 @@ usage: vg_perf [options] [files or dirs] --outer-valgrind: run these Valgrind(s) under the given outer valgrind. These Valgrind(s) must be configured with --enable-inner. --outer-tool: tool to use by the outer valgrind (default cachegrind). - --outer-args: use this as outer tool args. If the outer args are starting with +, - the given outer args are appended to the outer args predefined by vg_perf. + --outer-args: use this as outer tool args. If the outer args are starting + with +, the given outer args are appended to the outer args predefined + by vg_perf. Any tools named in --tools must be present in all directories specified with --vg. (This is not checked.) diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in index a441f424c6..0b1061c8aa 100755 --- a/tests/vg_regtest.in +++ b/tests/vg_regtest.in @@ -43,7 +43,9 @@ # --outer-valgrind: run this valgrind under the given outer valgrind. # This valgrind must be configured with --enable-inner. # --outer-tool: tool to use by the outer valgrind (default memcheck). -# --outer-args: use this as outer tool args. +# --outer-args: use this as outer tool args. If the outer args are starting +# with +, the given outer args are appended to the outer args predefined +# by vg_regtest. # --loop-till-fail: loops on the test(s) till one fail, then exit # This is useful to obtain detailed trace or --keep-unfiltered # output of a non deterministic test failure @@ -182,6 +184,7 @@ chomp(my $tests_dir = `pwd`); my $outer_valgrind; my $outer_tool = "memcheck"; my $outer_args; +my $run_outer_args = ""; my $valgrind_lib = "$tests_dir/.in_place"; my $keepunfiltered = 0; @@ -255,8 +258,8 @@ sub process_command_line() if (defined $outer_valgrind) { $outer_valgrind = validate_program($tests_dir, $outer_valgrind, 1, 1); - if (not defined $outer_args) { - $outer_args = + if ((not defined $outer_args) || ($outer_args =~ /^\+/)) { + $run_outer_args = " --command-line-only=yes" . " --run-libc-freeres=no --sim-hints=enable-outer" . " --smc-check=all-non-file" @@ -265,7 +268,16 @@ sub process_command_line() . " --suppressions=" . validate_program($tests_dir,"./tests/outer_inner.supp",1,0) . " --memcheck:leak-check=full --memcheck:show-reachable=no" + . " --num-callers=40" . " "; + # we use a (relatively) big --num-callers, to allow the outer to report + # also the inner guest stack trace, when reporting an error. + if (defined $outer_args) { + $outer_args =~ s/^\+(.*)/$1/; + $run_outer_args = $run_outer_args . $outer_args; + } + } else { + $run_outer_args = $outer_args; } } @@ -505,8 +517,8 @@ sub do_one_test($$) mysystem( "$envvars VALGRIND_LIB_INNER=$valgrind_lib " . "$outer_valgrind " . "--tool=" . $outer_tool . " " - . "$outer_args " . "--log-file=" . "$name.outer.log " + . "$run_outer_args " . "$valgrind --command-line-only=yes --memcheck:leak-check=no " . "--sim-hints=no-inner-prefix " . "--tool=$tool $extraopts $vgopts "