diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-03-01 17:59:12 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-03-01 17:59:12 +0000 |
commit | 35cac7cfea5ce05bfb0516b9ca11e3cf6561c1d4 (patch) | |
tree | fd02efded8c8c4461b78a7a556fc594e0bc60194 /gdb/gdbarch.h | |
parent | 7b83296f2249f4252acecdc5af64595d66daadbd (diff) | |
download | gdb-35cac7cfea5ce05bfb0516b9ca11e3cf6561c1d4.zip gdb-35cac7cfea5ce05bfb0516b9ca11e3cf6561c1d4.tar.gz gdb-35cac7cfea5ce05bfb0516b9ca11e3cf6561c1d4.tar.bz2 |
2003-03-01 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (register_type): New function with predicate.
(REGISTER_VIRTUAL_TYPE): Change to function with predicate.
* gdbarch.h, gdbarch.c: Re-generate.
* arch-utils.c (generic_register_byte): Use generic_register_size.
(generic_register_size): When available, use
gdbarch_register_type.
* regcache.c (init_regcache_descr): When available, initialize the
register type array using gdbarch_register_type. If the
architecture supplies gdbarch_register_type, do not use the legacy
regcache layout.
* d10v-tdep.c (d10v_register_type): Replace
d10v_register_virtual_type.
(d10v_gdbarch_init): Set register_type instead of
register_virtual_type.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r-- | gdb/gdbarch.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 606511b..641db5f 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -721,6 +721,11 @@ extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register #endif #endif +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced + by REGISTER_TYPE. */ + /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE) #define REGISTER_RAW_SIZE(reg_nr) (generic_register_size (reg_nr)) @@ -738,6 +743,11 @@ extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_regi #endif #endif +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced + by REGISTER_TYPE. */ + extern int gdbarch_max_register_raw_size (struct gdbarch *gdbarch); extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_RAW_SIZE) @@ -749,6 +759,11 @@ extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_ #endif #endif +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced + by REGISTER_TYPE. */ + /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE) #define REGISTER_VIRTUAL_SIZE(reg_nr) (generic_register_size (reg_nr)) @@ -766,6 +781,11 @@ extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_ #endif #endif +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced + by REGISTER_TYPE. */ + extern int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch); extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size); #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (MAX_REGISTER_VIRTUAL_SIZE) @@ -777,6 +797,36 @@ extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int #endif #endif +/* The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE, + MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE, + REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE have all being replaced + by REGISTER_TYPE. */ + +#if defined (REGISTER_VIRTUAL_TYPE) +/* Legacy for systems yet to multi-arch REGISTER_VIRTUAL_TYPE */ +#if !defined (REGISTER_VIRTUAL_TYPE_P) +#define REGISTER_VIRTUAL_TYPE_P() (1) +#endif +#endif + +/* Default predicate for non- multi-arch targets. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE_P) +#define REGISTER_VIRTUAL_TYPE_P() (0) +#endif + +extern int gdbarch_register_virtual_type_p (struct gdbarch *gdbarch); +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE_P) +#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE" +#endif +#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_VIRTUAL_TYPE_P) +#define REGISTER_VIRTUAL_TYPE_P() (gdbarch_register_virtual_type_p (current_gdbarch)) +#endif + +/* Default (function) for non- multi-arch platforms. */ +#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE) +#define REGISTER_VIRTUAL_TYPE(reg_nr) (internal_error (__FILE__, __LINE__, "REGISTER_VIRTUAL_TYPE"), 0) +#endif + typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr); extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type); @@ -789,6 +839,12 @@ extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_ #endif #endif +extern int gdbarch_register_type_p (struct gdbarch *gdbarch); + +typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr); +extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type); + #if defined (DEPRECATED_DO_REGISTERS_INFO) /* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */ #if !defined (DEPRECATED_DO_REGISTERS_INFO_P) |