]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix VALGRIND_CLO_CHANGE behaviour (BZ 508093) master
authorFlorian Krohm <flo2030@eich-krohm.de>
Mon, 11 Aug 2025 18:39:28 +0000 (18:39 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Mon, 11 Aug 2025 18:39:28 +0000 (18:39 +0000)
Command line flags that modify variable vex_control did not have the
desired effect when processed dynamically via VALGRIND_CLO_CHANGE.

The fix is to call the new function LibVEX_set_VexControl in
process_dynamic_option.

Fixes https://bugs.kde.org/show_bug.cgi?id=508093

NEWS
VEX/priv/main_main.c
VEX/pub/libvex.h
coregrind/m_main.c

diff --git a/NEWS b/NEWS
index 1a0cee4c84229d4fa1eefdaf0cd615e65a9a954c..c754435d2b5b8e7b79bdacfd406a979b57ac2fe9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux.
 
 * ==================== CORE CHANGES ===================
 
+* New VEX API function LibVEX_set_VexControl
+
 * ================== PLATFORM CHANGES =================
 
 * ==================== TOOL CHANGES ===================
@@ -75,6 +77,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 508027  Fix mips32 FTBFS
 508029  Review the vmsplice syscall wrapper
 508030  Add several missing syscall hooks to ppc64-linux
+508093  VALGRIND_CLO_CHANGE does not update vex_control
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index 0520fd7470e0e73ac0eef4f0c44f6aa7dd219e9a..619cace2e92c8e9bb284eacdca5c67e10fe393ac 100644 (file)
@@ -206,6 +206,11 @@ void LibVEX_default_VexControl ( /*OUT*/ VexControl* vcon )
    vcon->regalloc_version               = 3;
 }
 
+void LibVEX_set_VexControl ( VexControl vcon )
+{
+   __builtin_memcpy(&vex_control, &vcon, sizeof vex_control);
+}
+
 
 /* Exported to library client. */
 
index de19e1ebf6a8f8b0f1c2befdcd1da836508eb410..1779699785a0ef9a3a82030f4b7772077cd8ca36 100644 (file)
@@ -581,6 +581,8 @@ typedef
 extern 
 void LibVEX_default_VexControl ( /*OUT*/ VexControl* vcon );
 
+extern
+void LibVEX_set_VexControl ( VexControl );
 
 /*-------------------------------------------------------*/
 /*--- Storage management control                      ---*/
index f7fd20dbae3ff8c83cf198aca3572365ade64439..c94e5e0536e9a9a00fc93c67be183407e9499921 100644 (file)
@@ -939,6 +939,10 @@ void VG_(process_dynamic_option) (Clo_Mode mode, HChar *value)
    struct process_option_state dummy;
    process_option (mode, value, &dummy);
    // No need to handle a process_option_state once valgrind has started.
+
+   /* Update vex_control in case VALGRIND_CLO_CHANGE was used to modify a
+      VexControl member. */
+   LibVEX_set_VexControl(VG_(clo_vex_control));
 }
 
 /* Peer at previously set up VG_(args_for_valgrind) and do some