Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Richard.Earnshaw@arm.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: PATCH ARM initial support for different floating-point models
Date: Tue, 19 Feb 2002 15:12:00 -0000	[thread overview]
Message-ID: <3C72DBCD.3000504@cygnus.com> (raw)
In-Reply-To: <200202191923.TAA06815@cam-mail2.cambridge.arm.com>

Hmm, I'm afraid you may have just stepped into the 
write_register_bytes() bear trap :-( Have a look at the comments in 
regcache.c for the history.


> Index: arm-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/arm-tdep.c,v
> retrieving revision 1.47
> diff -p -r1.47 arm-tdep.c
> *** arm-tdep.c	2002/02/19 13:57:35	1.47
> --- arm-tdep.c	2002/02/19 19:14:40
> *************** arm_extract_return_value (struct type *t
> *** 2139,2145 ****
>   			  char *valbuf)
>   {
>     if (TYPE_CODE_FLT == TYPE_CODE (type))
> !     convert_from_extended (&regbuf[REGISTER_BYTE (ARM_F0_REGNUM)], valbuf);
>     else
>       memcpy (valbuf, &regbuf[REGISTER_BYTE (ARM_A1_REGNUM)],
>   	    TYPE_LENGTH (type));

Here, unfortunatly, directly pokeing around the regcache buffer (a 
parameter) is still the only way to do this.


>   	    TYPE_LENGTH (type));
> *************** arm_store_return_value (struct type *typ
> *** 2256,2270 ****
>   {
>     if (TYPE_CODE (type) == TYPE_CODE_FLT)
>       {
>         char buf[MAX_REGISTER_RAW_SIZE];
>   
> !       convert_to_extended (valbuf, buf);
> !       /* XXX Is this correct for soft-float?  */
> !       write_register_bytes (REGISTER_BYTE (ARM_F0_REGNUM), buf,
> ! 			    MAX_REGISTER_RAW_SIZE);

I think your changes to this function can be rewritten to use 
write_register_gen(REGNUM,BUF).

Need to be careful though.  If the code is assuming a floating point 
value should be stored across multiple adjacent registers then the code 
will need to be broken down into separate explicit writes.

enjoy,
Andrew



      reply	other threads:[~2002-02-19 23:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-19 11:26 Richard Earnshaw
2002-02-19 15:12 ` Andrew Cagney [this message]

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=3C72DBCD.3000504@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gdb-patches@sources.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