2002-10-25 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Fri, 25 Oct 2002 15:59:56 +0000 (15:59 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 25 Oct 2002 15:59:56 +0000 (15:59 +0000)
* gdbtypes.c (address_space_name_to_int): Update.
(address_space_int_to_name): Update.
* gdbarch.sh (address_class_type_flags_to_name): Change to a pure
multi-arch predicate.
(address_class_name_to_type_flags): Ditto.
* gdbarch.h, gdbarch.c: Re-generate.

gdb/ChangeLog
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbtypes.c

index 1f80e37c29d4c1e8cf7d365e0e75fa3b54716670..729fdf5ea0f0b0066e9de7f58da8837914d4df9e 100644 (file)
@@ -1,5 +1,12 @@
 2002-10-25  Andrew Cagney  <cagney@redhat.com>
 
+       * gdbtypes.c (address_space_name_to_int): Update.
+       (address_space_int_to_name): Update.
+       * gdbarch.sh (address_class_type_flags_to_name): Change to a pure
+       multi-arch predicate.
+       (address_class_name_to_type_flags): Ditto.
+       * gdbarch.h, gdbarch.c: Re-generate.
+       
        * MAINTAINERS: Check all warnings when h8300hms and alpha-elf.
 
 2002-10-24  Martin M. Hunt  <hunt@redhat.com>
index ce837e9430124a8bff3a5e45195b5f67442e85db..901c47e4f7a9aa1a160b7d411f6d412d93380ddd 100644 (file)
@@ -859,17 +859,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
     fprintf_unfiltered (file,
                         "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
                         (long) current_gdbarch->pseudo_register_write);
-#ifdef ADDRESS_CLASS_NAME_TO_TYPE_FLAGS
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "ADDRESS_CLASS_NAME_TO_TYPE_FLAGS(name, type_flags_ptr)",
-                      XSTRING (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS (name, type_flags_ptr)));
   if (GDB_MULTI_ARCH)
     fprintf_unfiltered (file,
-                        "gdbarch_dump: ADDRESS_CLASS_NAME_TO_TYPE_FLAGS = 0x%08lx\n",
-                        (long) current_gdbarch->address_class_name_to_type_flags
-                        /*ADDRESS_CLASS_NAME_TO_TYPE_FLAGS ()*/);
-#endif
+                        "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
+                        (long) current_gdbarch->address_class_name_to_type_flags);
 #ifdef ADDRESS_CLASS_TYPE_FLAGS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -881,17 +874,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->address_class_type_flags
                         /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
 #endif
-#ifdef ADDRESS_CLASS_TYPE_FLAGS_TO_NAME
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "ADDRESS_CLASS_TYPE_FLAGS_TO_NAME(type_flags)",
-                      XSTRING (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME (type_flags)));
   if (GDB_MULTI_ARCH)
     fprintf_unfiltered (file,
-                        "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_TO_NAME = 0x%08lx\n",
-                        (long) current_gdbarch->address_class_type_flags_to_name
-                        /*ADDRESS_CLASS_TYPE_FLAGS_TO_NAME ()*/);
-#endif
+                        "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
+                        (long) current_gdbarch->address_class_type_flags_to_name);
 #ifdef ADDRESS_TO_POINTER
 #if GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
@@ -5164,7 +5150,7 @@ gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flag
                     "gdbarch: gdbarch_address_class_type_flags_to_name invalid");
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_type_flags_to_name called\n");
-  return gdbarch->address_class_type_flags_to_name (type_flags);
+  return gdbarch->address_class_type_flags_to_name (gdbarch, type_flags);
 }
 
 void
@@ -5190,7 +5176,7 @@ gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, i
                     "gdbarch: gdbarch_address_class_name_to_type_flags invalid");
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_address_class_name_to_type_flags called\n");
-  return gdbarch->address_class_name_to_type_flags (name, type_flags_ptr);
+  return gdbarch->address_class_name_to_type_flags (gdbarch, name, type_flags_ptr);
 }
 
 void
index 17f6b070992bf4ef24470ebbbd59b2fb769559e5..994ae8262a6dd14762d56cf67d9c1527f5a43ff1 100644 (file)
@@ -2648,79 +2648,17 @@ extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbar
 #endif
 #endif
 
-#if defined (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME)
-/* Legacy for systems yet to multi-arch ADDRESS_CLASS_TYPE_FLAGS_TO_NAME */
-#if !defined (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P)
-#define ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P() (1)
-#endif
-#endif
-
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P)
-#define ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P() (0)
-#endif
-
 extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P)
-#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS_TO_NAME"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P)
-#define ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P() (gdbarch_address_class_type_flags_to_name_p (current_gdbarch))
-#endif
 
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME)
-#define ADDRESS_CLASS_TYPE_FLAGS_TO_NAME(type_flags) (internal_error (__FILE__, __LINE__, "ADDRESS_CLASS_TYPE_FLAGS_TO_NAME"), 0)
-#endif
-
-typedef char * (gdbarch_address_class_type_flags_to_name_ftype) (int type_flags);
+typedef char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags);
 extern char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags);
 extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME)
-#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS_TO_NAME"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME)
-#define ADDRESS_CLASS_TYPE_FLAGS_TO_NAME(type_flags) (gdbarch_address_class_type_flags_to_name (current_gdbarch, type_flags))
-#endif
-#endif
-
-#if defined (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS)
-/* Legacy for systems yet to multi-arch ADDRESS_CLASS_NAME_TO_TYPE_FLAGS */
-#if !defined (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P)
-#define ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P() (1)
-#endif
-#endif
-
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P)
-#define ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P() (0)
-#endif
 
 extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P)
-#error "Non multi-arch definition of ADDRESS_CLASS_NAME_TO_TYPE_FLAGS"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P)
-#define ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P() (gdbarch_address_class_name_to_type_flags_p (current_gdbarch))
-#endif
 
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS)
-#define ADDRESS_CLASS_NAME_TO_TYPE_FLAGS(name, type_flags_ptr) (internal_error (__FILE__, __LINE__, "ADDRESS_CLASS_NAME_TO_TYPE_FLAGS"), 0)
-#endif
-
-typedef int (gdbarch_address_class_name_to_type_flags_ftype) (char *name, int *type_flags_ptr);
+typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, char *name, int *type_flags_ptr);
 extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, int *type_flags_ptr);
 extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS)
-#error "Non multi-arch definition of ADDRESS_CLASS_NAME_TO_TYPE_FLAGS"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS)
-#define ADDRESS_CLASS_NAME_TO_TYPE_FLAGS(name, type_flags_ptr) (gdbarch_address_class_name_to_type_flags (current_gdbarch, name, type_flags_ptr))
-#endif
-#endif
 
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
index 2442c068cd2d2471e1adb0faf7c51756687cd980..6c9ac048bc6082d10c982875ac76adbc63e92f92 100755 (executable)
@@ -665,8 +665,8 @@ v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0
 v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0
 v::HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0
 F:2:ADDRESS_CLASS_TYPE_FLAGS:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class
-F:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:char *:address_class_type_flags_to_name:int type_flags:type_flags
-F:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:char *name, int *type_flags_ptr:name, type_flags_ptr
+M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:char *:address_class_type_flags_to_name:int type_flags:type_flags:
+M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:char *name, int *type_flags_ptr:name, type_flags_ptr
 EOF
 }
 
index 5f0d4fe36493c510cae45a610496494ced38abf8..a43987d67e69ec584d991a81d5d8bea18b3d369b 100644 (file)
@@ -397,14 +397,17 @@ lookup_function_type (struct type *type)
 extern int
 address_space_name_to_int (char *space_identifier)
 {
+  struct gdbarch *gdbarch = current_gdbarch;
   int type_flags;
   /* Check for known address space delimiters. */
   if (!strcmp (space_identifier, "code"))
     return TYPE_FLAG_CODE_SPACE;
   else if (!strcmp (space_identifier, "data"))
     return TYPE_FLAG_DATA_SPACE;
-  else if (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS_P ()
-           && ADDRESS_CLASS_NAME_TO_TYPE_FLAGS (space_identifier, &type_flags))
+  else if (gdbarch_address_class_name_to_type_flags_p (gdbarch)
+           && gdbarch_address_class_name_to_type_flags (gdbarch,
+                                                       space_identifier,
+                                                       &type_flags))
     return type_flags;
   else
     error ("Unknown address space specifier: \"%s\"", space_identifier);
@@ -416,13 +419,14 @@ address_space_name_to_int (char *space_identifier)
 extern char *
 address_space_int_to_name (int space_flag)
 {
+  struct gdbarch *gdbarch = current_gdbarch;
   if (space_flag & TYPE_FLAG_CODE_SPACE)
     return "code";
   else if (space_flag & TYPE_FLAG_DATA_SPACE)
     return "data";
   else if ((space_flag & TYPE_FLAG_ADDRESS_CLASS_ALL)
-           && ADDRESS_CLASS_TYPE_FLAGS_TO_NAME_P ())
-    return ADDRESS_CLASS_TYPE_FLAGS_TO_NAME (space_flag);
+           && gdbarch_address_class_type_flags_to_name_p (gdbarch))
+    return gdbarch_address_class_type_flags_to_name (gdbarch, space_flag);
   else
     return NULL;
 }