]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Repair --px-file-backed broken due to dynamic option change.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 11 Nov 2019 21:22:46 +0000 (22:22 +0100)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 12 Nov 2019 05:12:36 +0000 (06:12 +0100)
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.

coregrind/m_main.c
memcheck/tests/trivialleak.vgtest

index 6ad1b93d1ccd15cf19084e36fd5a06bd7875894c..6987236228240a14f41bc4f413947f47b481dd06 100644 (file)
@@ -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",
index 58641ea33f2e8839ef8963da85b58bc0ec5b201b..44d611ccab638cd1015139ace11d3bd4d9009c39 100644 (file)
@@ -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