Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/m32r] set return_value
@ 2004-10-01  8:59 Kei Sakamoto
  2004-10-01  9:01 ` Kei Sakamoto
  0 siblings, 1 reply; 4+ messages in thread
From: Kei Sakamoto @ 2004-10-01  8:59 UTC (permalink / raw)
  To: gdb-patches

Hello,

The attached patch removes deprecated_extract_struct_value_address
and deprecated_use_struct_convention from m32r-tdep.c and
sets return_value.

OK to commit?

2004-10-01    Kei Sakamoto  <sakamoto.kei@renesas.com>

        * m32r-tdep.c (m32r_use_struct_convention): Delete function.
        (m32r_extract_struct_value_address): Delete function.
        (m32r_return_value): New function.
        (m32r_gdbarch_init): Instead of store_return_value,
        extract_return_value, deprecated_extract_struct_value_address
        and deprecated_use_struct_convention, set return_value.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA/m32r] set return_value
  2004-10-01  8:59 [RFA/m32r] set return_value Kei Sakamoto
@ 2004-10-01  9:01 ` Kei Sakamoto
  2004-10-01 11:24   ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: Kei Sakamoto @ 2004-10-01  9:01 UTC (permalink / raw)
  To: gdb-patches

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

I'm sorry. I forgot to attach the patch file again...

> Hello,
> 
> The attached patch removes deprecated_extract_struct_value_address
> and deprecated_use_struct_convention from m32r-tdep.c and
> sets return_value.
> 
> OK to commit?
> 
> 2004-10-01    Kei Sakamoto  <sakamoto.kei@renesas.com>
> 
>         * m32r-tdep.c (m32r_use_struct_convention): Delete function.
>         (m32r_extract_struct_value_address): Delete function.
>         (m32r_return_value): New function.
>         (m32r_gdbarch_init): Instead of store_return_value,
>         extract_return_value, deprecated_extract_struct_value_address
>         and deprecated_use_struct_convention, set return_value.

[-- Attachment #2: m32r-tdep.patch --]
[-- Type: application/octet-stream, Size: 2812 bytes --]

Index: m32r-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-tdep.c,v
retrieving revision 1.31
diff -u -r1.31 m32r-tdep.c
--- m32r-tdep.c	1 Oct 2004 07:29:34 -0000	1.31
+++ m32r-tdep.c	1 Oct 2004 08:43:22 -0000
@@ -55,19 +55,6 @@
   return sp & ~3;
 }
 
-/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
-   EXTRACT_RETURN_VALUE?  GCC_P is true if compiled with gcc and TYPE
-   is the type (which is known to be struct, union or array).
-
-   The m32r returns anything less than 8 bytes in size in
-   registers. */
-
-static int
-m32r_use_struct_convention (int gcc_p, struct type *type)
-{
-  return (TYPE_LENGTH (type) > 8);
-}
-
 
 /* BREAKPOINT */
 #define M32R_BE_BREAKPOINT32 {0x10, 0xf1, 0x70, 0x00}
@@ -266,19 +253,6 @@
     }
 }
 
-/* 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).  */
-
-static CORE_ADDR
-m32r_extract_struct_value_address (struct regcache *regcache)
-{
-  ULONGEST addr;
-  regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &addr);
-  return addr;
-}
-
-
 /* This is required by skip_prologue. The results of decoding a prologue
    should be cached because this thrashing is getting nuts.  */
 
@@ -781,6 +755,24 @@
     }
 }
 
+enum return_value_convention
+m32r_return_value (struct gdbarch *gdbarch, struct type *valtype,
+		   struct regcache *regcache, void *readbuf,
+		   const void *writebuf)
+{
+  if (TYPE_LENGTH (valtype) > 8)
+    return RETURN_VALUE_STRUCT_CONVENTION;
+  else
+    {
+      if (readbuf != NULL)
+	m32r_extract_return_value (valtype, regcache, readbuf);
+      if (writebuf != NULL)
+	m32r_store_return_value (valtype, regcache, writebuf);
+      return RETURN_VALUE_REGISTER_CONVENTION;
+    }
+}
+
+
 
 static CORE_ADDR
 m32r_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
@@ -900,13 +892,8 @@
   set_gdbarch_register_name (gdbarch, m32r_register_name);
   set_gdbarch_register_type (gdbarch, m32r_register_type);
 
-  set_gdbarch_extract_return_value (gdbarch, m32r_extract_return_value);
   set_gdbarch_push_dummy_call (gdbarch, m32r_push_dummy_call);
-  set_gdbarch_store_return_value (gdbarch, m32r_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
-						       m32r_extract_struct_value_address);
-  set_gdbarch_deprecated_use_struct_convention (gdbarch,
-						m32r_use_struct_convention);
+  set_gdbarch_return_value (gdbarch, m32r_return_value);
 
   set_gdbarch_skip_prologue (gdbarch, m32r_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA/m32r] set return_value
  2004-10-01  9:01 ` Kei Sakamoto
@ 2004-10-01 11:24   ` Mark Kettenis
  2004-10-05  4:09     ` Kei Sakamoto
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2004-10-01 11:24 UTC (permalink / raw)
  To: sakamoto.kei; +Cc: gdb-patches

   From: "Kei Sakamoto" <sakamoto.kei@renesas.com>
   Date: Fri, 1 Oct 2004 18:01:06 +0900

   > OK to commit?

Looks OK to me, so yes please.

   > 2004-10-01    Kei Sakamoto  <sakamoto.kei@renesas.com>
   > 
   >         * m32r-tdep.c (m32r_use_struct_convention): Delete function.
   >         (m32r_extract_struct_value_address): Delete function.
   >         (m32r_return_value): New function.
   >         (m32r_gdbarch_init): Instead of store_return_value,
   >         extract_return_value, deprecated_extract_struct_value_address
   >         and deprecated_use_struct_convention, set return_value.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA/m32r] set return_value
  2004-10-01 11:24   ` Mark Kettenis
@ 2004-10-05  4:09     ` Kei Sakamoto
  0 siblings, 0 replies; 4+ messages in thread
From: Kei Sakamoto @ 2004-10-05  4:09 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

I committed the following patch. Thank you.

Kei Sakamoto


>    From: "Kei Sakamoto" <sakamoto.kei@renesas.com>
>    Date: Fri, 1 Oct 2004 18:01:06 +0900
> 
>    > OK to commit?
> 
> Looks OK to me, so yes please.
> 
>    > 2004-10-01    Kei Sakamoto  <sakamoto.kei@renesas.com>
>    > 
>    >         * m32r-tdep.c (m32r_use_struct_convention): Delete function.
>    >         (m32r_extract_struct_value_address): Delete function.
>    >         (m32r_return_value): New function.
>    >         (m32r_gdbarch_init): Instead of store_return_value,
>    >         extract_return_value, deprecated_extract_struct_value_address
>    >         and deprecated_use_struct_convention, set return_value.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-05  4:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-01  8:59 [RFA/m32r] set return_value Kei Sakamoto
2004-10-01  9:01 ` Kei Sakamoto
2004-10-01 11:24   ` Mark Kettenis
2004-10-05  4:09     ` Kei Sakamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox