]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
fixes for HEAD->branch merge.
authorAndrew Cagney <cagney@redhat.com>
Sat, 15 Jun 2002 19:32:44 +0000 (19:32 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 15 Jun 2002 19:32:44 +0000 (19:32 +0000)
12 files changed:
gdb/ChangeLog
gdb/arch-utils.c
gdb/arch-utils.h
gdb/blockframe.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/mi/ChangeLog
gdb/mi/mi-main.c
gdb/regcache.c
gdb/rs6000-tdep.c
gdb/values.c

index c1582ca06ba897d3d99638a13de13743cfd1ed17..0dbe0a5f740a63ca99da1edfc533fdd7dc789450 100644 (file)
@@ -1,3 +1,17 @@
+2002-06-15  Andrew Cagney  <ac131313@redhat.com>
+
+       * regcache.c (regcache_descr): New function.
+       (init_legacy_regcache_descr): Replace legacy_regcache_descr.
+       (init_regcache_descr): Replace regcache_descr.
+       (_initialize_regcache): Pass init_regcache_descr to
+       register_gdbarch_data.
+
+       * arch-utils.h (legacy_extract_return_value): Declare.
+
+       * blockframe.c (generic_call_dummy_register_unwind): Use
+       deprecated_grub_regcache_for_registers to get register value.
+       * values.c (value_being_returned): Ditto.  Include "regcache.h".
+
 2002-05-23  Andrew Cagney  <ac131313@redhat.com>
 
        * regbuf.h, regbuf.c: Delete.
index 887aa9d72239d6f2bc7a5bfd55262182bd9eda89..c0569f2a1108f6385ab1d08654f13d91fdcbc64b 100644 (file)
@@ -91,6 +91,16 @@ legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
   return NULL;
 }
 
+/* Implementation of extract return value that grubs around in the
+   register cache.  */
+void
+legacy_extract_return_value (struct type *type, struct regcache *regcache,
+                            char *valbuf)
+{
+  char *registers = deprecated_grub_regcache_for_registers (regcache);
+  DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, valbuf);
+}
+
 int
 legacy_register_sim_regno (int regnum)
 {
index 0b397af82d48eafd14fec132f5e820b40eecc24d..9dfa70cefdc275bc286ac47935da9b0aa9b79bef 100644 (file)
@@ -39,6 +39,10 @@ extern gdbarch_frame_num_args_ftype frame_num_args_unknown;
    targets that don't yet implement their own breakpoint_from_pc(). */
 extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc;
 
+/* Implementation of extract return value that grubs around in the
+   register cache.  */
+extern gdbarch_extract_return_value_ftype legacy_extract_return_value;
+
 /* Frameless functions not identifable. */
 extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not;
 
index 39038a8f6f30dab77650338de506958bca068b51..7362f5de603229af798356666bbe1e3e609c91b5 100644 (file)
@@ -1349,7 +1349,7 @@ generic_call_dummy_register_unwind (struct frame_info *frame, void **cache,
   /* If needed, find and return the value of the register.  */
   if (bufferp != NULL)
     {
-      char *registers;
+      struct regcache *registers;
 #if 1
       /* Get the address of the register buffer that contains all the
         saved registers for this dummy frame.  Cache that address.  */
@@ -1366,7 +1366,9 @@ generic_call_dummy_register_unwind (struct frame_info *frame, void **cache,
 #endif
       gdb_assert (registers != NULL);
       /* Return the actual value.  */
-      memcpy (bufferp, registers + REGISTER_BYTE (regnum),
+      memcpy (bufferp,
+             (deprecated_grub_regcache_for_registers (registers)
+              + REGISTER_BYTE (regnum)),
              REGISTER_RAW_SIZE (regnum));
     }
 }
index 967379282340ff49193a3d8212dd0de0871124ed..55041aca53a079991b63439373181ee5ed3d2403 100644 (file)
@@ -516,6 +516,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
   current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
   current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
+  current_gdbarch->extract_return_value = legacy_extract_return_value;
   current_gdbarch->push_arguments = default_push_arguments;
   current_gdbarch->use_struct_convention = generic_use_struct_convention;
   current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
@@ -700,9 +701,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of address_to_pointer, invalid_p == 0 */
   /* Skip verify of integer_to_address, has predicate */
   /* Skip verify of return_value_on_stack, invalid_p == 0 */
-  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
-      && (gdbarch->extract_return_value == 0))
-    fprintf_unfiltered (log, "\n\textract_return_value");
+  /* Skip verify of extract_return_value, invalid_p == 0 */
   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->deprecated_extract_return_value == 0))
     fprintf_unfiltered (log, "\n\tdeprecated_extract_return_value");
index 8b2736650cc499bbfc423636096e13cf17954a84..7d73294bfc95a1d145a1d66313b62f9394a63da9 100644 (file)
@@ -1461,6 +1461,11 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_
 #endif
 #endif
 
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE)
+#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf))
+#endif
+
 typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, char *valbuf);
 extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, char *valbuf);
 extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
index ca3ac330ec062ad98cb8b63a91d385c296d6f69e..6d6c2d02f18842433778efe8534f63809a3184c5 100755 (executable)
@@ -528,7 +528,7 @@ f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, COR
 F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf
 #
 f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
-f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, char *valbuf:type, regcache, valbuf::0:0
+f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, char *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
 f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf::0:0
 f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0
 f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-:::0
index fb029512645ca2d2139a462de14d4225217cbecd..096154f9ebbe0764a4b070309f4bf0f1c9fbb679 100644 (file)
@@ -1,3 +1,7 @@
+2002-06-15  Andrew Cagney  <ac131313@redhat.com>
+
+       * mi-main.c: Do not include "regbuf.h".
+
 2002-05-16  Andrew Cagney  <ac131313@redhat.com>
 
        * mi-main.c (register_changed_p): Update.
index d0e63e9a85a7baa57fd9d6896d05fe0c3658dbb9..43dbb6fd9a179bd351e5f163201d726a41e07089 100644 (file)
@@ -41,7 +41,6 @@
 #include "gdb.h"
 #include <ctype.h>
 #include <sys/time.h>
-#include "regbuf.h"
 
 enum
   {
index f2d5b54966c27b9b3c88f41a8f433315933fba4f..5da651272d19ddd4b82c9da0422d02ebcce175ef 100644 (file)
@@ -74,8 +74,8 @@ struct regcache_descr
 
 };
 
-static struct regcache_descr *
-legacy_regcache_descr (struct gdbarch *gdbarch)
+static void *
+init_legacy_regcache_descr (struct gdbarch *gdbarch)
 {
   int i;
   struct regcache_descr *descr;
@@ -83,10 +83,6 @@ legacy_regcache_descr (struct gdbarch *gdbarch)
      ``gdbarch'' as a parameter.  */
   gdb_assert (gdbarch != NULL);
 
-  descr = gdbarch_data (gdbarch, regcache_data_handle);
-  if (descr != NULL)
-    return descr;
-  
   descr = XMALLOC (struct regcache_descr);
   descr->gdbarch = gdbarch;
   descr->legacy_p = 1;
@@ -136,23 +132,18 @@ legacy_regcache_descr (struct gdbarch *gdbarch)
   return descr;
 }
 
-static struct regcache_descr *
-regcache_descr (struct gdbarch *gdbarch)
+static void *
+init_regcache_descr (struct gdbarch *gdbarch)
 {
   int i;
   struct regcache_descr *descr;
   gdb_assert (gdbarch != NULL);
 
-  /* If the value has previously been computed, just return that.  */
-  descr = gdbarch_data (gdbarch, regcache_data_handle);
-  if (descr != NULL)
-    return descr;
-  
   /* If an old style architecture, construct the register cache
      description using all the register macros.  */
   if (!gdbarch_register_read_p (gdbarch)
       && !gdbarch_register_write_p (gdbarch))
-    return legacy_regcache_descr (gdbarch);
+    return init_legacy_regcache_descr (gdbarch);
 
   descr = XMALLOC (struct regcache_descr);
   descr->gdbarch = gdbarch;
@@ -217,6 +208,12 @@ regcache_descr (struct gdbarch *gdbarch)
   return descr;
 }
 
+static struct regcache_descr *
+regcache_descr (struct gdbarch *gdbarch)
+{
+  return gdbarch_data (gdbarch, regcache_data_handle);
+}
+
 static void
 xfree_regcache_descr (struct gdbarch *gdbarch, void *ptr)
 {
@@ -1238,7 +1235,8 @@ regcache_restore_no_passthrough (struct regcache *regcache)
 void
 _initialize_regcache (void)
 {
-  regcache_data_handle = register_gdbarch_data (NULL, xfree_regcache_descr);
+  regcache_data_handle = register_gdbarch_data (init_regcache_descr,
+                                               xfree_regcache_descr);
   REGISTER_GDBARCH_SWAP (current_regcache);
   register_gdbarch_swap (&registers, sizeof (registers), NULL);
   register_gdbarch_swap (&register_valid, sizeof (register_valid), NULL);
index ffc7bb98b58803bd17d3235ab631f0d7c4f521cb..db38203b5e0fa87d70b0a64121156f7d1d95e70f 100644 (file)
@@ -2624,7 +2624,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_register_convert_to_raw (gdbarch, rs6000_register_convert_to_raw);
   set_gdbarch_stab_reg_to_regnum (gdbarch, rs6000_stab_reg_to_regnum);
 
-  set_gdbarch_deprecated_extract_return_value (gdbarch, rs6000_extract_return_value);
+  set_gdbarch_extract_return_value (gdbarch, rs6000_extract_return_value);
   
   /* Note: kevinb/2002-04-12: I'm not convinced that rs6000_push_arguments()
      is correct for the SysV ABI when the wordsize is 8, but I'm also
@@ -2640,7 +2640,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return);
   set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
+  set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
   set_gdbarch_pop_frame (gdbarch, rs6000_pop_frame);
 
   set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
index 1328ddb34b59e876b3f8ecb6385f4abfd8ad8336..69e1dfa5ac26ec72dba57fae399a6b6186a12af9 100644 (file)
@@ -34,6 +34,7 @@
 #include "demangle.h"
 #include "doublest.h"
 #include "gdb_assert.h"
+#include "regcache.h"
 
 /* Prototypes for exported functions. */
 
@@ -1230,7 +1231,6 @@ value_being_returned (struct type *valtype, struct regcache *retbuf,
   struct value *val;
   CORE_ADDR addr;
 
-#if 0
   /* If this is not defined, just use EXTRACT_RETURN_VALUE instead.  */
   if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
     if (struct_return)
@@ -1240,13 +1240,13 @@ value_being_returned (struct type *valtype, struct regcache *retbuf,
          error ("Function return value unknown.");
        return value_at (valtype, addr, NULL);
       }
-#endif
 
   /* If this is not defined, just use EXTRACT_RETURN_VALUE instead.  */
   if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
     if (struct_return)
       {
-       addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
+       char *registers = deprecated_grub_regcache_for_registers (retbuf);
+       addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (registers);
        if (!addr)
          error ("Function return value unknown.");
        return value_at (valtype, addr, NULL);
@@ -1254,7 +1254,6 @@ value_being_returned (struct type *valtype, struct regcache *retbuf,
 
   val = allocate_value (valtype);
   CHECK_TYPEDEF (valtype);
-#define EXTRACT_RETURN_VALUE DEPRECATED_EXTRACT_RETURN_VALUE
   EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val));
 
   return val;