This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] arm_store_return_value, big-endian (take 2)


Richard Earnshaw wrote:
> 
> Leaving asside the issue of the correctness of write_register_bytes (note
> to self, must finish of my register patches), I don't think this is
> correct -- in fact, I think it's also wrong for little-endian as well.
> 
> What should happen is that the smaller-than-word value should be
> zero/sign-extended to 32 bits and then the whole thing stored in A1_REGNUM.

Ah, thanks.  OK, how about this?
2002-11-06  Michael Snyder  <msnyder@redhat.com>

	* arm-tdep.c (arm_store_return_value): Handle offset of
	small types on big-endian machines.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.74
diff -p -r1.74 arm-tdep.c
*** arm-tdep.c	1 Nov 2002 21:21:49 -0000	1.74
--- arm-tdep.c	8 Nov 2002 03:17:49 -0000
*************** arm_store_return_value (struct type *typ
*** 2417,2422 ****
--- 2417,2429 ----
  	  break;
  	}
      }
+   else if (TYPE_LENGTH (type) < REGISTER_RAW_SIZE (A1_REGNUM)
+ 	   && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+     {
+       LONGEST tmp = unpack_long (type, valbuf);
+ 
+       write_register (ARM_A1_REGNUM, tmp);
+     }
    else
      write_register_bytes (ARM_A1_REGNUM, valbuf, TYPE_LENGTH (type));
  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]