Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] Address FIXME in i386-tdep.c:i386_extract_struct_value_address
Date: Sat, 26 Oct 2002 07:41:00 -0000	[thread overview]
Message-ID: <200210261441.g9QEff6t004409@elgar.kettenis.dyndns.org> (raw)

We know for sure here that we're not dealing with a cooked register.

Checked in.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* i386-tdep.c (i386_extract_struct_value_address): Use
	regcache_raw_read_unsigned instead of
	regcache_cooked_read_unsigned since we know that the register
	we're reading isn't a pseudo register.  Rename variable 'val' into
	the more descriptive 'addr'.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.88
diff -u -p -r1.88 i386-tdep.c
--- i386-tdep.c 17 Sep 2002 20:42:01 -0000 1.88
+++ i386-tdep.c 26 Oct 2002 14:39:42 -0000
@@ -1039,25 +1039,17 @@ i386_store_return_value (struct type *ty
     }
 }
 
-/* Extract from an array REGBUF containing the (raw) register state
-   the address in which a function should return its structure value,
-   as a CORE_ADDR.  */
+/* Extract from REGCACHE, which contains the (raw) register state, the
+   address in which a function should return its structure value, as a
+   CORE_ADDR.  */
 
 static CORE_ADDR
 i386_extract_struct_value_address (struct regcache *regcache)
 {
-  /* NOTE: cagney/2002-08-12: Replaced a call to
-     regcache_raw_read_as_address() with a call to
-     regcache_cooked_read_unsigned().  The old, ...as_address function
-     was eventually calling extract_unsigned_integer (via
-     extract_address) to unpack the registers value.  The below is
-     doing an unsigned extract so that it is functionally equivalent.
-     The read needs to be cooked as, otherwise, it will never
-     correctly return the value of a register in the [NUM_REGS
-     .. NUM_REGS+NUM_PSEUDO_REGS) range.  */
-  ULONGEST val;
-  regcache_cooked_read_unsigned (regcache, LOW_RETURN_REGNUM, &val);
-  return val;
+  ULONGEST addr;
+
+  regcache_raw_read_unsigned (regcache, LOW_RETURN_REGNUM, &addr);
+  return addr;
 }
 \f
 


             reply	other threads:[~2002-10-26 14:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-26  7:41 Mark Kettenis [this message]
2002-10-26 10:23 ` Andrew Cagney
2002-10-27  8:25   ` Mark Kettenis
2002-11-07 15:12     ` Andrew Cagney

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=200210261441.g9QEff6t004409@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --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