]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390: disasm-test: use s390_disasm
authorFlorian Krohm <flo2030@eich-krohm.de>
Thu, 5 Feb 2026 18:03:05 +0000 (18:03 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Thu, 5 Feb 2026 18:03:05 +0000 (18:03 +0000)
No need to capture the disassembled insn from a tracing side effect.
Call s390_disasm directly with mnemonic-padding disabled.

none/tests/s390x/disasm-test/vex.c

index 3e98aa3b6af4445dacc7213059ecd3f8d100eaa3..32383e7ac6befbf88df14cc7f8b326efe5c20af3 100644 (file)
@@ -26,7 +26,8 @@
 #include "libvex.h"           // LibVEX_Init
 #include "guest_s390_defs.h"  // disInstr_S390
 #include "host_s390_defs.h"   // s390_host_hwcaps
-#include "main_globals.h"     // vex_traceflags
+#include "main_globals.h"     // vex_init_done
+#include "s390_disasm.h"
 
 /* Some VEX header defines this. Need to get rid of it before
    including standard headers. */
@@ -98,9 +99,6 @@ vex_init(void)
    LibVEX_default_VexControl(&vcon);
    LibVEX_Init(vex_exit, vex_put_string, 0, &vcon);
 
-   /* Enable disassembly. */
-   vex_traceflags = VEX_TRACE_FE;
-
    /* Pretend all hardware extensions are available to avoid running
       into an emulation failure */
    s390_host_hwcaps = VEX_HWCAPS_S390X_ALL;
@@ -147,21 +145,5 @@ vex_disasm(const unsigned char *codebuf, int *spec_exc)
       *spec_exc = 1;
    }
 
-   if (last_vex_string) {
-      /* Compress a sequence of spaces with a single blank. */
-      int space_seen = 0;
-      char *p, *q;
-      for (p = q = last_vex_string; *p; ++p) {
-         if (isspace(*p)) {
-            if (space_seen) continue;
-            space_seen = 1;
-         } else {
-            space_seen = 0;
-         }
-         *q++ = *p;
-      }
-      *q = '\0';
-   }
-
-   return last_vex_string;
+   return s390_disasm(codebuf, /* padmnm */ 0);
 }