|
From: Philippe W. <phi...@so...> - 2019-11-12 05:14:38
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=914d91769a6524f9af07bba998efa3c3c4a51f69 commit 914d91769a6524f9af07bba998efa3c3c4a51f69 Author: Philippe Waroquiers <phi...@sk...> Date: Mon Nov 11 22:22:46 2019 +0100 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: --- coregrind/m_main.c | 9 +++++++++ memcheck/tests/trivialleak.vgtest | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 6ad1b93..6987236 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 58641ea..44d611c 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 |