From: Philippe Waroquiers Date: Mon, 11 Nov 2019 21:22:46 +0000 (+0100) Subject: Repair --px-file-backed broken due to dynamic option change. X-Git-Tag: VALGRIND_3_16_0~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=914d91769a6524f9af07bba998efa3c3c4a51f69;p=thirdparty%2Fvalgrind.git Repair --px-file-backed broken due to dynamic option change. The commit 3a803036f7 (Allow the user to change a set of command line options during execution) removed by mistake the code handling the option --px-file-backed. Add it back, and modify a trivialleak.vgtest to use the 'VEX registers' options setting (and their synonym) to do a minimal verification that the options and synonyms are accepted. The options are specifying the default values, they should not influence the result of the test. Bug (and its origin) reported by Julian. --- diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 6ad1b93d1c..6987236228 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -710,6 +710,15 @@ static void process_option (Clo_Mode mode, VG_(clo_vex_control).iropt_register_updates_default = pxVals[ix]; } + else if VG_STRINDEX_CLO(arg, "--px-file-backed", pxStrings, ix) { + // Whereas --px-file-backed isn't + // the same flag as --vex-iropt-register-updates. + vg_assert(ix < 4); + vg_assert(pxVals[ix] >= VexRegUpdSpAtMemAccess); + vg_assert(pxVals[ix] <= VexRegUpdAllregsAtEachInsn); + VG_(clo_px_file_backed) = pxVals[ix]; + } + else if VG_BINT_CLO(arg, "--vex-iropt-unroll-thresh", VG_(clo_vex_control).iropt_unroll_thresh, 0, 400) {} else if VG_BINT_CLO(arg, "--vex-guest-max-insns", diff --git a/memcheck/tests/trivialleak.vgtest b/memcheck/tests/trivialleak.vgtest index 58641ea33f..44d611ccab 100644 --- a/memcheck/tests/trivialleak.vgtest +++ b/memcheck/tests/trivialleak.vgtest @@ -1,2 +1,4 @@ -vgopts: --leak-check=yes -q +vgopts: --leak-check=yes -q --vex-iropt-register-updates=unwindregs-at-mem-access --px-default=unwindregs-at-mem-access --px-file-backed=unwindregs-at-mem-access +# The options after -q are just validating these options and synonyms are +# accepted: the values above are the default values. prog: trivialleak