Fix calls with small integers on ARM
authorTom Tromey <tromey@adacore.com>
Wed, 20 Sep 2023 13:38:54 +0000 (07:38 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 30 Oct 2023 13:45:39 +0000 (07:45 -0600)
On big-endian ARM, an inferior call with a small integer will pass the
wrong value.  This patch fixes the problem.  Because the code here
works using scalar values, and not just bytes, left-shifting is
unnecessary.

Approved-By: Luis Machado <luis.machado@arm.com>
gdb/arm-tdep.c

index a0ad1fb7a82146fd3f3a3bd13cf2bd04b25aa693..97d7c5140d2e7ea912f7b10e80dde6ebd7fe67fa 100644 (file)
@@ -4824,9 +4824,6 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
            {
              /* The argument is being passed in a general purpose
                 register.  */
-             if (byte_order == BFD_ENDIAN_BIG)
-               regval <<= (ARM_INT_REGISTER_SIZE - partial_len) * 8;
-
              arm_debug_printf ("arg %d in %s = 0x%s", argnum,
                                gdbarch_register_name (gdbarch, argreg),
                                phex (regval, ARM_INT_REGISTER_SIZE));