diff mbox series

[10/23] plugins/lockstep: make mixed-mode safe

Message ID 20240628124258.832466-11-alex.bennee@linaro.org (mailing list archive)
State New, archived
Headers show
Series July maintainer updates (32bit, testing, plugins, gdbstub) | expand

Commit Message

Alex Bennée June 28, 2024, 12:42 p.m. UTC
The ExecState is shared across the socket and if we want to compare
say 64 bit and 32 bit binaries we need the two to use the same sizes
for things.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 contrib/plugins/lockstep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Richard Henderson June 28, 2024, 10:30 p.m. UTC | #1
On 6/28/24 05:42, Alex Bennée wrote:
> The ExecState is shared across the socket and if we want to compare
> say 64 bit and 32 bit binaries we need the two to use the same sizes
> for things.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   contrib/plugins/lockstep.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
> index 111ec3fa27..761bcdf363 100644
> --- a/contrib/plugins/lockstep.c
> +++ b/contrib/plugins/lockstep.c
> @@ -57,7 +57,7 @@ typedef struct {
>   /* The execution state we compare */
>   typedef struct {
>       uint64_t pc;
> -    unsigned long insn_count;
> +    uint64_t insn_count;
>   } ExecState;

Or long long, but I suppose this is more explicit about the width.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

>   
>   typedef struct {
> @@ -148,7 +148,7 @@ static void report_divergance(ExecState *us, ExecState *them)
>   
>           g_string_printf(out,
>                           "Δ insn_count @ 0x%016" PRIx64
> -                        " (%ld) vs 0x%016" PRIx64 " (%ld)\n",
> +                        " (%"PRId64") vs 0x%016" PRIx64 " (%"PRId64")\n",
>                           us->pc, us->insn_count, them->pc, them->insn_count);
>   
>           for (entry = log, i = 0;
diff mbox series

Patch

diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
index 111ec3fa27..761bcdf363 100644
--- a/contrib/plugins/lockstep.c
+++ b/contrib/plugins/lockstep.c
@@ -57,7 +57,7 @@  typedef struct {
 /* The execution state we compare */
 typedef struct {
     uint64_t pc;
-    unsigned long insn_count;
+    uint64_t insn_count;
 } ExecState;
 
 typedef struct {
@@ -148,7 +148,7 @@  static void report_divergance(ExecState *us, ExecState *them)
 
         g_string_printf(out,
                         "Δ insn_count @ 0x%016" PRIx64
-                        " (%ld) vs 0x%016" PRIx64 " (%ld)\n",
+                        " (%"PRId64") vs 0x%016" PRIx64 " (%"PRId64")\n",
                         us->pc, us->insn_count, them->pc, them->insn_count);
 
         for (entry = log, i = 0;