2004-02-14 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Sat, 14 Feb 2004 17:26:35 +0000 (17:26 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 14 Feb 2004 17:26:35 +0000 (17:26 +0000)
* gdbarch.sh (DEPRECATED_REGISTER_CONVERTIBLE): Add predicate.
* gdbarch.h, gdbarch.c: Re-generate.
* arch-utils.c (deprecated_register_convertible_not): Delete.
* arch-utils.h (deprecated_register_convertible_not): Delete.
* mi/mi-main.c (get_register): Update.  Update copyright.
* infcmd.c (default_print_registers_info): Update.

gdb/ChangeLog
gdb/arch-utils.c
gdb/arch-utils.h
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/infcmd.c
gdb/mi/mi-main.c

index 8b9d95902b23886a3f55e64a75569faa8967d90a..b35e1691daa86618960ddf972fedfc5d5ff322f4 100644 (file)
@@ -1,5 +1,12 @@
 2004-02-14  Andrew Cagney  <cagney@redhat.com>
 
+       * gdbarch.sh (DEPRECATED_REGISTER_CONVERTIBLE): Add predicate.
+       * gdbarch.h, gdbarch.c: Re-generate.
+       * arch-utils.c (deprecated_register_convertible_not): Delete.
+       * arch-utils.h (deprecated_register_convertible_not): Delete.
+       * mi/mi-main.c (get_register): Update.  Update copyright.
+       * infcmd.c (default_print_registers_info): Update.
+
        * gdbarch.sh (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED): Delete.
        (DEPRECATED_CALL_DUMMY_STACK_ADJUST): Delete.
        (DEPRECATED_CALL_DUMMY_ADDRESS): Delete.
index e8c070d10801ee02c9318fff461c8d3617cb86bd..f567a55c3a154c6f120c6677da3488fc8c7d8a22 100644 (file)
@@ -195,13 +195,6 @@ default_double_format (struct gdbarch *gdbarch)
 
 /* Misc helper functions for targets. */
 
-int
-deprecated_register_convertible_not (int num)
-{
-  return 0;
-}
-  
-
 CORE_ADDR
 core_addr_identity (CORE_ADDR addr)
 {
index b15f6912cd8ab36893714c8c25ce3ef34b5ebc0e..158868ff5f2828aed24b55b167b31f2c706c3860 100644 (file)
@@ -32,9 +32,6 @@ struct gdbarch_info;
 /* gdbarch trace variable */
 extern int gdbarch_debug;
 
-/* Fallback for register convertible. */
-extern gdbarch_deprecated_register_convertible_ftype deprecated_register_convertible_not;
-
 /* Implementation of extract return value that grubs around in the
    register cache.  */
 extern gdbarch_extract_return_value_ftype legacy_extract_return_value;
index 2fe3db8431e9acf9a2bb3d9636839daa14e86f33..86c2e02189d2d5c4cdafa2c4023c3de980ccc20f 100644 (file)
@@ -500,7 +500,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
   current_gdbarch->cannot_fetch_register = cannot_register_not;
   current_gdbarch->cannot_store_register = cannot_register_not;
   current_gdbarch->deprecated_pc_in_call_dummy = generic_pc_in_call_dummy;
-  current_gdbarch->deprecated_register_convertible = deprecated_register_convertible_not;
   current_gdbarch->convert_register_p = legacy_convert_register_p;
   current_gdbarch->register_to_value = legacy_register_to_value;
   current_gdbarch->value_to_register = legacy_value_to_register;
@@ -656,7 +655,7 @@ verify_gdbarch (struct gdbarch *current_gdbarch)
   /* Skip verify of deprecated_init_frame_pc_first, has predicate */
   /* Skip verify of deprecated_init_frame_pc, has predicate */
   /* Skip verify of deprecated_get_saved_register, has predicate */
-  /* Skip verify of deprecated_register_convertible, invalid_p == 0 */
+  /* Skip verify of deprecated_register_convertible, has predicate */
   /* Skip verify of deprecated_register_convert_to_virtual, invalid_p == 0 */
   /* Skip verify of deprecated_register_convert_to_raw, invalid_p == 0 */
   /* Skip verify of convert_register_p, invalid_p == 0 */
@@ -1426,6 +1425,15 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
                       "gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n",
                       DEPRECATED_REGISTER_BYTES);
 #endif
+#ifdef DEPRECATED_REGISTER_CONVERTIBLE_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_REGISTER_CONVERTIBLE_P()",
+                      XSTRING (DEPRECATED_REGISTER_CONVERTIBLE_P ()));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_REGISTER_CONVERTIBLE_P() = %d\n",
+                      DEPRECATED_REGISTER_CONVERTIBLE_P ());
+#endif
 #ifdef DEPRECATED_REGISTER_CONVERTIBLE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -3876,6 +3884,13 @@ set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch,
   gdbarch->deprecated_get_saved_register = deprecated_get_saved_register;
 }
 
+int
+gdbarch_deprecated_register_convertible_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->deprecated_register_convertible != NULL;
+}
+
 int
 gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr)
 {
index 57c293a05197c56e9403100a69a0c1b77be79efa..d6b7b58bc5178c557ae7d5e517d41e07e6565cc0 100644 (file)
@@ -1209,6 +1209,21 @@ extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch,
 /* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
    For raw <-> cooked register conversions, replaced by pseudo registers. */
 
+#if defined (DEPRECATED_REGISTER_CONVERTIBLE)
+/* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_CONVERTIBLE */
+#if !defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
+#define DEPRECATED_REGISTER_CONVERTIBLE_P() (1)
+#endif
+#endif
+
+extern int gdbarch_deprecated_register_convertible_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
+#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERTIBLE"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
+#define DEPRECATED_REGISTER_CONVERTIBLE_P() (gdbarch_deprecated_register_convertible_p (current_gdbarch))
+#endif
+
 typedef int (gdbarch_deprecated_register_convertible_ftype) (int nr);
 extern int gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr);
 extern void set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible);
index bdda88eb8ebc3160b7ac9d4362fc25c05d7dbb34..8156a62070c0fb069a61512f55805a1ad6600c66 100755 (executable)
@@ -572,7 +572,7 @@ F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_b
 #
 # For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
 # For raw <-> cooked register conversions, replaced by pseudo registers.
-f:2:DEPRECATED_REGISTER_CONVERTIBLE:int:deprecated_register_convertible:int nr:nr:::deprecated_register_convertible_not::0
+F::DEPRECATED_REGISTER_CONVERTIBLE:int:deprecated_register_convertible:int nr:nr
 # For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
 # For raw <-> cooked register conversions, replaced by pseudo registers.
 f:2:DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL:void:deprecated_register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
index 2de769ed2c6f9964210867aaa7a0c3215919a510..6e74f4e5431472eca4176c4b15ce530ee50e7496 100644 (file)
@@ -1556,7 +1556,8 @@ default_print_registers_info (struct gdbarch *gdbarch,
          The function frame_register_read() should have returned the
          pre-cooked register so no conversion is necessary.  */
       /* Convert raw data to virtual format if necessary.  */
-      if (DEPRECATED_REGISTER_CONVERTIBLE (i))
+      if (DEPRECATED_REGISTER_CONVERTIBLE_P ()
+         && DEPRECATED_REGISTER_CONVERTIBLE (i))
        {
          DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i),
                                       raw_buffer, virtual_buffer);
index 19eba99bdeddb9df42a266bb5eaf4db24272832a..db5f3b9a3019395a961c866365f122032f0c55bf 100644 (file)
@@ -1,5 +1,8 @@
 /* MI Command Set.
-   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+   Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
+   Inc.
+
    Contributed by Cygnus Solutions (a Red Hat company).
 
    This file is part of GDB.
@@ -537,7 +540,8 @@ get_register (int regnum, int format)
 
   /* Convert raw data to virtual format if necessary.  */
 
-  if (DEPRECATED_REGISTER_CONVERTIBLE (regnum))
+  if (DEPRECATED_REGISTER_CONVERTIBLE_P ()
+      && DEPRECATED_REGISTER_CONVERTIBLE (regnum))
     {
       DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum,
                                   register_type (current_gdbarch, regnum),