* i386-tdep.c (i386_extract_struct_value_address): New function.
authorMark Kettenis <kettenis@gnu.org>
Sun, 1 Apr 2001 12:39:52 +0000 (12:39 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 1 Apr 2001 12:39:52 +0000 (12:39 +0000)
* 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.

gdb/ChangeLog
gdb/config/i386/tm-i386.h
gdb/i386-tdep.c

index 3bc5c4cd6ff78d6c081099f3be61c4cc43cc4761..6ff6e695d5b107b69c63981f0227c9381cdf790e 100644 (file)
@@ -1,5 +1,10 @@
 2001-04-01  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.
+
        * i386-linux-nat.c (i386_linux_dr_get): Change type of return
        value to `unsigned long'.  Change type of `value' to `unsigned
        long'.
index 9417b77a45332a5d9f7074e2cfe065093e422f90..a7841b57ed5f2f2884fdd3f8a842aad6fc1a340b 100644 (file)
@@ -305,15 +305,18 @@ extern void i386_extract_return_value (struct type *type, char *regbuf,
 
 /* 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
index db001dafab7ef26e990e209d8c692a0037c08608..1090cbef79c3bb394bf8a6ab1991b3e2b5925c38 100644 (file)
@@ -850,6 +850,17 @@ i386_store_return_value (struct type *type, char *valbuf)
                        "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