Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@wins.uva.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH]: Concert EXTRACT_STRUCT_VALUE_ADDRESS into a function  for i386
Date: Sun, 01 Apr 2001 05:42:00 -0000	[thread overview]
Message-ID: <200104011242.f31Cgml07430@delius.kettenis.local> (raw)

As a bonus, this fixes a LE/BE cross-debugging issue, at least that's
what I expect (haven't tested it, since I don't have access to a BE
machine.

Checked in.

Mark


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

	* i386-tdep.c (i386_extract_struct_value_address): New function.
	* config/i386/tm-i386.h (EXTRACT_STRUCT_VALUE_ADDRESS): Redefine
	in terms of i386_extract_struct_value_address.
	(i386_extract_struct_value_address): New prototype.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.24
diff -u -p -r1.24 i386-tdep.c
--- i386-tdep.c 2001/03/31 13:05:16 1.24
+++ i386-tdep.c 2001/04/01 12:38:35
@@ -850,6 +850,17 @@ i386_store_return_value (struct type *ty
 			"Cannot store return value of %d bytes long.", len);
     }
 }
+
+/* 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.  */
+
+CORE_ADDR
+i386_extract_struct_value_address (char *regbuf)
+{
+  return extract_address (&regbuf[REGISTER_BYTE (LOW_RETURN_REGNUM)],
+			  REGISTER_RAW_SIZE (LOW_RETURN_REGNUM));
+}
 \f
 
 /* Convert data from raw format for register REGNUM in buffer FROM to
Index: config/i386/tm-i386.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-i386.h,v
retrieving revision 1.13
diff -u -p -r1.13 tm-i386.h
--- config/i386/tm-i386.h 2001/03/26 12:11:14 1.13
+++ config/i386/tm-i386.h 2001/04/01 12:38:36
@@ -305,15 +305,18 @@ extern void i386_extract_return_value (s
 
 /* Write into the appropriate registers a function return value stored
    in VALBUF of type TYPE, given in virtual format.  */
+
 #define STORE_RETURN_VALUE(type, valbuf) \
   i386_store_return_value ((type), (valbuf))
 extern void i386_store_return_value (struct type *type, char *valbuf);
 
-/* 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 (or an
-   expression that can be used as one).  */
+/* 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.  */
 
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) \
+  i386_extract_struct_value_address ((regbuf))
+extern CORE_ADDR i386_extract_struct_value_address (char *regbuf);
 
 /* The following redefines make backtracing through sigtramp work.
    They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp


                 reply	other threads:[~2001-04-01  5:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200104011242.f31Cgml07430@delius.kettenis.local \
    --to=kettenis@wins.uva.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