Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Richard.Earnshaw@arm.com
Cc: gdb-patches@sources.redhat.com, cagney@redhat.com, kevinb@redhat.com
Subject: Re: [RFA] arm_store_return_value, big-endian (take 2)
Date: Thu, 07 Nov 2002 19:19:00 -0000	[thread overview]
Message-ID: <3DCB2D53.E19B382A@redhat.com> (raw)
In-Reply-To: <200211071825.gA7IPEM32490@pc960.cambridge.arm.com>

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

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?

[-- Attachment #2: arm5.patch --]
[-- Type: text/plain, Size: 838 bytes --]

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));
  }

  reply	other threads:[~2002-11-08  3:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06 16:27 Michael Snyder
2002-11-07 10:26 ` Richard Earnshaw
2002-11-07 19:19   ` Michael Snyder [this message]
2002-11-08  1:57     ` Richard Earnshaw
2002-11-08 11:37       ` Michael Snyder
2002-11-09  3:55         ` Richard Earnshaw
2002-11-11 17:15           ` Michael Snyder
2002-11-12  2:15             ` Richard Earnshaw
2002-11-13 11:55               ` Michael Snyder
2002-11-14  1:50                 ` Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DCB2D53.E19B382A@redhat.com \
    --to=msnyder@redhat.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=cagney@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox