Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Kei Sakamoto" <sakamoto.kei@renesas.com>
To: <gdb-patches@sources.redhat.com>
Subject: Re: [RFA/m32r] set return_value
Date: Fri, 01 Oct 2004 09:01:00 -0000	[thread overview]
Message-ID: <01a201c4a795$2fc40e00$5169910a@E5A02646> (raw)
In-Reply-To: <019201c4a794$e46529d0$5169910a@E5A02646>

[-- 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);

  reply	other threads:[~2004-10-01  9:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01  8:59 Kei Sakamoto
2004-10-01  9:01 ` Kei Sakamoto [this message]
2004-10-01 11:24   ` Mark Kettenis
2004-10-05  4:09     ` Kei Sakamoto

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='01a201c4a795$2fc40e00$5169910a@E5A02646' \
    --to=sakamoto.kei@renesas.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