From 5f11f355589542b03a46e5282d04ddee4c04b7ba Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 25 Oct 2002 15:59:56 +0000 Subject: [PATCH] 2002-10-25 Andrew Cagney * 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 | 7 ++++++ gdb/gdbarch.c | 26 +++++--------------- gdb/gdbarch.h | 66 ++------------------------------------------------ gdb/gdbarch.sh | 4 +-- gdb/gdbtypes.c | 12 ++++++--- 5 files changed, 25 insertions(+), 90 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1f80e37c29d..729fdf5ea0f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2002-10-25 Andrew Cagney + * 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 diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index ce837e94301..901c47e4f7a 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -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 diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 17f6b070992..994ae8262a6 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -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); diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 2442c068cd2..6c9ac048bc6 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -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 } diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 5f0d4fe3649..a43987d67e6 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -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; } -- 2.30.2