Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: gdb-patches@sources.redhat.com
Subject: [commit/hppa] Enable 32-bit push_dummy_call and return_value
Date: Fri, 27 Feb 2004 19:05:00 -0000	[thread overview]
Message-ID: <403F94F6.2030801@gnu.org> (raw)

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

Hello,

I just did a comparison between the old and new 32-bit code and the new 
inferior call and struct return code, while still occasionally tripping 
up, is way better than the old.  structs.exp, for instance, gets 70 
fails rather than at least 170 (it hangs).

This enables that part of the 32-bit code, committed,

Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 8372 bytes --]

Index: ChangeLog
2004-02-27  Andrew Cagney  <cagney@redhat.com>

	* hppa-tdep.c (hppa_gdbarch_init): On 32-bit systems always
	"return_value" and "push_dummy_call".
	(hppa32_use_struct_convention): Delete unused function.
	(hppa32_store_return_value): Delete unused function.
	(hppa32_extract_return_value): Delete unused function.
	(hppa32_stack_align): Delete function.

Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.127
diff -u -r1.127 hppa-tdep.c
--- hppa-tdep.c	27 Feb 2004 16:38:39 -0000	1.127
+++ hppa-tdep.c	27 Feb 2004 18:58:33 -0000
@@ -183,7 +183,6 @@
 int hppa_in_solib_return_trampoline (CORE_ADDR pc, char *name);
 CORE_ADDR hppa_saved_pc_after_call (struct frame_info *frame);
 int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
-CORE_ADDR hppa32_stack_align (CORE_ADDR sp);
 CORE_ADDR hppa64_stack_align (CORE_ADDR sp);
 int hppa_pc_requires_run_before_use (CORE_ADDR pc);
 int hppa_instruction_nullified (void);
@@ -192,13 +191,9 @@
 struct type * hppa32_register_virtual_type (int reg_nr);
 struct type * hppa64_register_virtual_type (int reg_nr);
 void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
-void hppa32_extract_return_value (struct type *type, char *regbuf,
-                                  char *valbuf);
 void hppa64_extract_return_value (struct type *type, char *regbuf,
                                   char *valbuf);
-int hppa32_use_struct_convention (int gcc_p, struct type *type);
 int hppa64_use_struct_convention (int gcc_p, struct type *type);
-void hppa32_store_return_value (struct type *type, char *valbuf);
 void hppa64_store_return_value (struct type *type, char *valbuf);
 int hppa_cannot_store_register (int regnum);
 void hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame);
@@ -241,14 +236,6 @@
 /* Should call_function allocate stack space for a struct return?  */
 
 int
-hppa32_use_struct_convention (int gcc_p, struct type *type)
-{
-  return (TYPE_LENGTH (type) > 2 * DEPRECATED_REGISTER_SIZE);
-}
-
-/* Same as hppa32_use_struct_convention() for the PA64 ABI.  */
-
-int
 hppa64_use_struct_convention (int gcc_p, struct type *type)
 {
   /* RM: struct upto 128 bits are returned in registers */
@@ -5446,30 +5433,6 @@
   /* We can leave the tail's space the same, since there's no jump.  */
 }
 
-/* Copy the function value from VALBUF into the proper location
-   for a function return.
-
-   Called only in the context of the "return" command.  */
-
-void
-hppa32_store_return_value (struct type *type, char *valbuf)
-{
-  /* For software floating point, the return value goes into the
-     integer registers.  But we do not have any flag to key this on,
-     so we always store the value into the integer registers.
-
-     If its a float value, then we also store it into the floating
-     point registers.  */
-  deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (28)
-				   + (TYPE_LENGTH (type) > 4
-				      ? (8 - TYPE_LENGTH (type))
-				      : (4 - TYPE_LENGTH (type))),
-				   valbuf, TYPE_LENGTH (type));
-  if (TYPE_CODE (type) == TYPE_CODE_FLT)
-    deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP4_REGNUM),
-				     valbuf, TYPE_LENGTH (type));
-}
-
 /* Same as hppa32_store_return_value(), but for the PA64 ABI.  */
 
 void
@@ -5496,28 +5459,6 @@
     }
 }
 
-/* Copy the function's return value into VALBUF.
-
-   This function is called only in the context of "target function calls",
-   ie. when the debugger forces a function to be called in the child, and
-   when the debugger forces a fucntion to return prematurely via the
-   "return" command.  */
-
-void
-hppa32_extract_return_value (struct type *type, char *regbuf, char *valbuf)
-{
-  if (TYPE_CODE (type) == TYPE_CODE_FLT)
-    memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (FP4_REGNUM), TYPE_LENGTH (type));
-  else
-    memcpy (valbuf,
-	    (regbuf
-	     + DEPRECATED_REGISTER_BYTE (28)
-	     + (TYPE_LENGTH (type) > 4
-		? (8 - TYPE_LENGTH (type))
-		: (4 - TYPE_LENGTH (type)))),
-	    TYPE_LENGTH (type));
-}
-
 /* Same as hppa32_extract_return_value but for the PA64 ABI case.  */
 
 void
@@ -5564,15 +5505,6 @@
 }
 
 CORE_ADDR
-hppa32_stack_align (CORE_ADDR sp)
-{
-  /* elz: adjust the quantity to the next highest value which is
-     64-bit aligned.  This is used in valops.c, when the sp is adjusted.
-     On hppa the sp must always be kept 64-bit aligned */
-  return ((sp % 8) ? (sp + 7) & -8 : sp);
-}
-
-CORE_ADDR
 hppa64_stack_align (CORE_ADDR sp)
 {
   /* The PA64 ABI mandates a 16 byte stack alignment.  */
@@ -5844,74 +5776,54 @@
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
 
   /* Inferior function call methods.  */
-  if (0)
+  switch (tdep->bytes_per_address)
     {
-      switch (tdep->bytes_per_address)
+    case 4:
+      set_gdbarch_push_dummy_call (gdbarch, hppa32_push_dummy_call);
+      set_gdbarch_frame_align (gdbarch, hppa32_frame_align);
+      break;
+    case 8:
+      if (0)
 	{
-	case 4:
-	  set_gdbarch_push_dummy_call (gdbarch, hppa32_push_dummy_call);
-	  set_gdbarch_frame_align (gdbarch, hppa32_frame_align);
-	  break;
-	case 8:
 	  set_gdbarch_push_dummy_call (gdbarch, hppa64_push_dummy_call);
 	  set_gdbarch_frame_align (gdbarch, hppa64_frame_align);
 	  break;
 	}
-    }
-  else
-    {
-      switch (tdep->bytes_per_address)
+      else
 	{
-	case 4:
-	  set_gdbarch_deprecated_call_dummy_length (gdbarch, hppa32_call_dummy_length);
-	  set_gdbarch_deprecated_stack_align (gdbarch, hppa32_stack_align);
-	  set_gdbarch_deprecated_reg_struct_has_addr (gdbarch, hppa_reg_struct_has_addr);
-	  break;
-	case 8:
 	  set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, hppa64_call_dummy_breakpoint_offset);
 	  set_gdbarch_deprecated_call_dummy_length (gdbarch, hppa64_call_dummy_length);
 	  set_gdbarch_deprecated_stack_align (gdbarch, hppa64_stack_align);
 	  break;
+	  set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);
+	  /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
+	  set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments);
+	  set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
+	  set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
+	  set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
 	}
-      set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);
-      /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
-      set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments);
-      set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
-      set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
-      set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+      break;
     }
       
   /* Struct return methods.  */
-  if (0)
-    {
-      switch (tdep->bytes_per_address)
-	{
-	case 4:
-	  set_gdbarch_return_value (gdbarch, hppa32_return_value);
-	  break;
-	case 8:
-	  set_gdbarch_return_value (gdbarch, hppa64_return_value);
-	  break;
-	default:
-	  internal_error (__FILE__, __LINE__, "bad switch");
-	}
-    }
-  else
+  switch (tdep->bytes_per_address)
     {
-      switch (tdep->bytes_per_address)
+    case 4:
+      set_gdbarch_return_value (gdbarch, hppa32_return_value);
+      break;
+    case 8:
+      if (0)
+	set_gdbarch_return_value (gdbarch, hppa64_return_value);
+      else
 	{
-	case 4:
-	  set_gdbarch_deprecated_extract_return_value (gdbarch, hppa32_extract_return_value);
-	  set_gdbarch_use_struct_convention (gdbarch, hppa32_use_struct_convention);
-	  set_gdbarch_deprecated_store_return_value (gdbarch, hppa32_store_return_value);
-	  break;
-	case 8:
 	  set_gdbarch_deprecated_extract_return_value (gdbarch, hppa64_extract_return_value);
 	  set_gdbarch_use_struct_convention (gdbarch, hppa64_use_struct_convention);
 	  set_gdbarch_deprecated_store_return_value (gdbarch, hppa64_store_return_value);
-	  break;
+	  set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
 	}
-      set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
+      break;
+    default:
+      internal_error (__FILE__, __LINE__, "bad switch");
     }
       
   /* Frame unwind methods.  */

             reply	other threads:[~2004-02-27 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27 19:05 Andrew Cagney [this message]
2004-02-27 20:53 Michael Elizabeth Chastain
2004-02-27 21:39 ` 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=403F94F6.2030801@gnu.org \
    --to=cagney@gnu.org \
    --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