Make MAX_REGISTER_RAW_SIZE and MAX_REGISTER_VIRTUAL_SIZE optional.
* gdbarch.sh (DEPRECATED_MAX_REGISTER_RAW_SIZE): Variable with
predicate. Replace MAX_REGISTER_RAW_SIZE.
(DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto for
MAX_REGISTER_VIRTUAL_SIZE.
* regcache.c (legacy_max_register_raw_size): New function.
(legacy_max_register_virtual_size): New function.
* defs.h (MAX_REGISTER_VIRTUAL_SIZE): Define.
(MAX_REGISTER_RAW_SIZE): Define.
(legacy_max_register_raw_size): Declare.
(legacy_max_register_virtual_size): Declare.
* config/sparc/tm-sparc.h (DEPRECATED_MAX_REGISTER_RAW_SIZE)
(DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Update.
* config/sparc/tm-sp64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE)
(DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto.
* config/pa/tm-hppa.h (DEPRECATED_MAX_REGISTER_RAW_SIZE)
(DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto.
* config/pa/tm-hppa64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto.
* config/ia64/tm-ia64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto.
* config/i386/tm-ptx.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto.
* xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
* vax-tdep.c (vax_gdbarch_init): Update.
* v850-tdep.c (v850_gdbarch_init): Update.
* sparc-tdep.c (sparc_gdbarch_init): Update.
* sh-tdep.c (sh_gdbarch_init): Update.
* s390-tdep.c (s390_gdbarch_init): Update.
* rs6000-tdep.c (rs6000_gdbarch_init): Update.
* ns32k-tdep.c (ns32k_gdbarch_init): Update.
* mn10300-tdep.c (mn10300_gdbarch_init): Update.
* mips-tdep.c (mips_gdbarch_init): Update.
* mcore-tdep.c (mcore_gdbarch_init): Update.
* m68k-tdep.c (m68k_gdbarch_init): Update.
* m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
* ia64-tdep.c (ia64_gdbarch_init): Update.
* i386-tdep.c (i386_gdbarch_init): Update.
* hppa-tdep.c (hppa_gdbarch_init): Update.
* h8300-tdep.c (h8300_gdbarch_init): Update.
* frv-tdep.c (frv_gdbarch_init): Update.
* cris-tdep.c (cris_gdbarch_init): Update.
* avr-tdep.c (avr_gdbarch_init): Update.
* arm-tdep.c (arm_gdbarch_init): Update.
* alpha-tdep.c (alpha_gdbarch_init): Update.
* d10v-tdep.c (d10v_gdbarch_init): Do not set
max_register_raw_size or max_register_virtual_size.
+2003-03-03 Andrew Cagney <cagney@redhat.com>
+
+ Make MAX_REGISTER_RAW_SIZE and MAX_REGISTER_VIRTUAL_SIZE optional.
+ * gdbarch.sh (DEPRECATED_MAX_REGISTER_RAW_SIZE): Variable with
+ predicate. Replace MAX_REGISTER_RAW_SIZE.
+ (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto for
+ MAX_REGISTER_VIRTUAL_SIZE.
+ * regcache.c (legacy_max_register_raw_size): New function.
+ (legacy_max_register_virtual_size): New function.
+ * defs.h (MAX_REGISTER_VIRTUAL_SIZE): Define.
+ (MAX_REGISTER_RAW_SIZE): Define.
+ (legacy_max_register_raw_size): Declare.
+ (legacy_max_register_virtual_size): Declare.
+ * config/sparc/tm-sparc.h (DEPRECATED_MAX_REGISTER_RAW_SIZE)
+ (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Update.
+ * config/sparc/tm-sp64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE)
+ (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto.
+ * config/pa/tm-hppa.h (DEPRECATED_MAX_REGISTER_RAW_SIZE)
+ (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Ditto.
+ * config/pa/tm-hppa64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto.
+ * config/ia64/tm-ia64.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto.
+ * config/i386/tm-ptx.h (DEPRECATED_MAX_REGISTER_RAW_SIZE): Ditto.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+ * vax-tdep.c (vax_gdbarch_init): Update.
+ * v850-tdep.c (v850_gdbarch_init): Update.
+ * sparc-tdep.c (sparc_gdbarch_init): Update.
+ * sh-tdep.c (sh_gdbarch_init): Update.
+ * s390-tdep.c (s390_gdbarch_init): Update.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Update.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Update.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Update.
+ * mips-tdep.c (mips_gdbarch_init): Update.
+ * mcore-tdep.c (mcore_gdbarch_init): Update.
+ * m68k-tdep.c (m68k_gdbarch_init): Update.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * ia64-tdep.c (ia64_gdbarch_init): Update.
+ * i386-tdep.c (i386_gdbarch_init): Update.
+ * hppa-tdep.c (hppa_gdbarch_init): Update.
+ * h8300-tdep.c (h8300_gdbarch_init): Update.
+ * frv-tdep.c (frv_gdbarch_init): Update.
+ * cris-tdep.c (cris_gdbarch_init): Update.
+ * avr-tdep.c (avr_gdbarch_init): Update.
+ * arm-tdep.c (arm_gdbarch_init): Update.
+ * alpha-tdep.c (alpha_gdbarch_init): Update.
+ * d10v-tdep.c (d10v_gdbarch_init): Do not set
+ max_register_raw_size or max_register_virtual_size.
+
2003-03-03 David Carlton <carlton@math.stanford.edu>
* symtab.h (DEPRECATED_SYMBOL_MATCHES_NAME): Rename from
set_gdbarch_register_bytes (gdbarch, ALPHA_REGISTER_BYTES);
set_gdbarch_register_byte (gdbarch, alpha_register_byte);
set_gdbarch_register_raw_size (gdbarch, alpha_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, ALPHA_MAX_REGISTER_RAW_SIZE);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, ALPHA_MAX_REGISTER_RAW_SIZE);
set_gdbarch_register_virtual_size (gdbarch, alpha_register_virtual_size);
- set_gdbarch_max_register_virtual_size (gdbarch,
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch,
ALPHA_MAX_REGISTER_VIRTUAL_SIZE);
set_gdbarch_register_virtual_type (gdbarch, alpha_register_virtual_type);
set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SREGS);
set_gdbarch_register_raw_size (gdbarch, arm_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, arm_register_virtual_size);
- set_gdbarch_max_register_raw_size (gdbarch, FP_REGISTER_RAW_SIZE);
- set_gdbarch_max_register_virtual_size (gdbarch, FP_REGISTER_VIRTUAL_SIZE);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, FP_REGISTER_RAW_SIZE);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, FP_REGISTER_VIRTUAL_SIZE);
set_gdbarch_register_virtual_type (gdbarch, arm_register_type);
/* Internal <-> external register number maps. */
set_gdbarch_register_bytes (gdbarch, AVR_NUM_REG_BYTES);
set_gdbarch_register_byte (gdbarch, avr_register_byte);
set_gdbarch_register_raw_size (gdbarch, avr_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_register_virtual_size (gdbarch, avr_register_virtual_size);
- set_gdbarch_max_register_virtual_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
set_gdbarch_register_virtual_type (gdbarch, avr_register_virtual_type);
set_gdbarch_print_insn (gdbarch, print_insn_avr);
/* Largest value REGISTER_RAW_SIZE can have. */
-#undef MAX_REGISTER_RAW_SIZE
-#define MAX_REGISTER_RAW_SIZE 10
+#undef DEPRECATED_MAX_REGISTER_RAW_SIZE
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 10
/* Nonzero if register N requires conversion
from raw format to virtual format. */
/* Largest value REGISTER_RAW_SIZE can have. */
-#define MAX_REGISTER_RAW_SIZE 16
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 16
#define GDBSERVER_RESUME_REGS { IA64_IP_REGNUM, IA64_PSR_REGNUM, SP_REGNUM, IA64_BSP_REGNUM, IA64_CFM_REGNUM }
/* Largest value REGISTER_RAW_SIZE can have. */
#if !GDB_MULTI_ARCH
-#define MAX_REGISTER_RAW_SIZE 4
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 4
#endif
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
#if !GDB_MULTI_ARCH
-#define MAX_REGISTER_VIRTUAL_SIZE 8
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
#endif
#if !GDB_MULTI_ARCH
/* Largest value REGISTER_RAW_SIZE can have. */
-#undef MAX_REGISTER_RAW_SIZE
-#define MAX_REGISTER_RAW_SIZE 8
+#undef DEPRECATED_MAX_REGISTER_RAW_SIZE
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
/* Largest value REGISTER_RAW_SIZE can have. */
/* tm-sparc.h defines this as 8, but play it safe. */
-#undef MAX_REGISTER_RAW_SIZE
-#define MAX_REGISTER_RAW_SIZE 8
+#undef DEPRECATED_MAX_REGISTER_RAW_SIZE
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
/* tm-sparc.h defines this as 8, but play it safe. */
-#undef MAX_REGISTER_VIRTUAL_SIZE
-#define MAX_REGISTER_VIRTUAL_SIZE 8
+#undef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
/* Return the GDB type object for the "standard" data type
of data in register N. */
/* Largest value REGISTER_RAW_SIZE can have. */
-#define MAX_REGISTER_RAW_SIZE 8
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-#define MAX_REGISTER_VIRTUAL_SIZE 8
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
/* Return the GDB type object for the "standard" data type
of data in register N. */
set_gdbarch_register_raw_size (gdbarch, cris_register_size);
/* The largest value REGISTER_RAW_SIZE can have. */
- set_gdbarch_max_register_raw_size (gdbarch, 32);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 32);
/* The length of the registers in the program's representation. */
set_gdbarch_register_virtual_size (gdbarch, cris_register_size);
/* The largest value REGISTER_VIRTUAL_SIZE can have. */
- set_gdbarch_max_register_virtual_size (gdbarch, 32);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 32);
set_gdbarch_register_virtual_type (gdbarch, cris_register_virtual_type);
set_gdbarch_register_bytes (gdbarch, (d10v_num_regs - 2) * 2 + 16);
set_gdbarch_register_byte (gdbarch, d10v_register_byte);
set_gdbarch_register_raw_size (gdbarch, d10v_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 8);
set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
- set_gdbarch_max_register_virtual_size (gdbarch, 8);
set_gdbarch_register_type (gdbarch, d10v_register_type);
set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
#include "arch-utils.h"
#endif
+/* FIXME: cagney/2003-03-01: Hack to prop up old targets while they
+ migrate to the overhauled register cache.
+
+ The problem is that some architectures specify different sized raw
+ and cooked (nee virtual) register sizes. They shouldn't. Instead,
+ all architectures should just implement a gdbarch_register_type().
+ That can be used to compute all needed register attributes. While
+ waiting for the conversion, provide compatibility macros that keep
+ old code working. */
+
+#ifdef MAX_REGISTER_RAW_SIZE
+#error MAX_REGISTER_RAW_SIZE defined
+#endif
+extern int legacy_max_register_raw_size (void);
+#define MAX_REGISTER_RAW_SIZE legacy_max_register_raw_size ()
+
+#ifdef MAX_REGISTER_VIRTUAL_SIZE
+#error MAX_REGISTER_VIRTUAL_SIZE defined
+#endif
+extern int legacy_max_register_virtual_size (void);
+#define MAX_REGISTER_VIRTUAL_SIZE legacy_max_register_virtual_size ()
+
+
/* Static target-system-dependent parameters for GDB. */
/* Number of bits in a char or unsigned char for the target machine.
set_gdbarch_register_bytes (gdbarch, frv_num_regs * 4);
set_gdbarch_register_byte (gdbarch, frv_register_byte);
set_gdbarch_register_raw_size (gdbarch, frv_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_register_virtual_size (gdbarch, frv_register_virtual_size);
- set_gdbarch_max_register_virtual_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
set_gdbarch_register_virtual_type (gdbarch, frv_register_virtual_type);
set_gdbarch_skip_prologue (gdbarch, frv_skip_prologue);
int register_bytes;
gdbarch_register_byte_ftype *register_byte;
gdbarch_register_raw_size_ftype *register_raw_size;
- int max_register_raw_size;
+ int deprecated_max_register_raw_size;
gdbarch_register_virtual_size_ftype *register_virtual_size;
- int max_register_virtual_size;
+ int deprecated_max_register_virtual_size;
gdbarch_register_virtual_type_ftype *register_virtual_type;
gdbarch_register_type_ftype *register_type;
gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info;
current_gdbarch->register_bytes = -1;
current_gdbarch->register_byte = generic_register_byte;
current_gdbarch->register_raw_size = generic_register_size;
- current_gdbarch->max_register_raw_size = -1;
current_gdbarch->register_virtual_size = generic_register_size;
- current_gdbarch->max_register_virtual_size = -1;
current_gdbarch->print_registers_info = default_print_registers_info;
current_gdbarch->register_sim_regno = legacy_register_sim_regno;
current_gdbarch->cannot_fetch_register = cannot_register_not;
fprintf_unfiltered (log, "\n\tregister_bytes");
/* Skip verify of register_byte, invalid_p == 0 */
/* Skip verify of register_raw_size, invalid_p == 0 */
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->max_register_raw_size == -1))
- fprintf_unfiltered (log, "\n\tmax_register_raw_size");
+ /* Skip verify of deprecated_max_register_raw_size, has predicate */
/* Skip verify of register_virtual_size, invalid_p == 0 */
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->max_register_virtual_size == -1))
- fprintf_unfiltered (log, "\n\tmax_register_virtual_size");
+ /* Skip verify of deprecated_max_register_virtual_size, has predicate */
/* Skip verify of register_virtual_type, has predicate */
/* Skip verify of register_type, has predicate */
/* Skip verify of deprecated_do_registers_info, has predicate */
(long) current_gdbarch->deprecated_init_frame_pc_first
/*DEPRECATED_INIT_FRAME_PC_FIRST ()*/);
#endif
+#ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_MAX_REGISTER_RAW_SIZE_P()",
+ XSTRING (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE_P() = %d\n",
+ DEPRECATED_MAX_REGISTER_RAW_SIZE_P ());
+#endif
+#ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE # %s\n",
+ XSTRING (DEPRECATED_MAX_REGISTER_RAW_SIZE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE = %d\n",
+ DEPRECATED_MAX_REGISTER_RAW_SIZE);
+#endif
+#ifdef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P()",
+ XSTRING (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() = %d\n",
+ DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ());
+#endif
+#ifdef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE # %s\n",
+ XSTRING (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE = %d\n",
+ DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE);
+#endif
#ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
(long) current_gdbarch->in_solib_return_trampoline
/*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
#endif
-#ifdef MAX_REGISTER_RAW_SIZE
- fprintf_unfiltered (file,
- "gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
- XSTRING (MAX_REGISTER_RAW_SIZE));
- fprintf_unfiltered (file,
- "gdbarch_dump: MAX_REGISTER_RAW_SIZE = %d\n",
- MAX_REGISTER_RAW_SIZE);
-#endif
-#ifdef MAX_REGISTER_VIRTUAL_SIZE
- fprintf_unfiltered (file,
- "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE # %s\n",
- XSTRING (MAX_REGISTER_VIRTUAL_SIZE));
- fprintf_unfiltered (file,
- "gdbarch_dump: MAX_REGISTER_VIRTUAL_SIZE = %d\n",
- MAX_REGISTER_VIRTUAL_SIZE);
-#endif
#ifdef MEMORY_INSERT_BREAKPOINT
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
}
int
-gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
+gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->deprecated_max_register_raw_size != 0;
+}
+
+int
+gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->max_register_raw_size == -1)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_max_register_raw_size invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n");
- return gdbarch->max_register_raw_size;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_max_register_raw_size called\n");
+ return gdbarch->deprecated_max_register_raw_size;
}
void
-set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
- int max_register_raw_size)
+set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch,
+ int deprecated_max_register_raw_size)
{
- gdbarch->max_register_raw_size = max_register_raw_size;
+ gdbarch->deprecated_max_register_raw_size = deprecated_max_register_raw_size;
}
int
}
int
-gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
+gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->deprecated_max_register_virtual_size != 0;
+}
+
+int
+gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->max_register_virtual_size == -1)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_max_register_virtual_size invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n");
- return gdbarch->max_register_virtual_size;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_max_register_virtual_size called\n");
+ return gdbarch->deprecated_max_register_virtual_size;
}
void
-set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
- int max_register_virtual_size)
+set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch,
+ int deprecated_max_register_virtual_size)
{
- gdbarch->max_register_virtual_size = max_register_virtual_size;
+ gdbarch->deprecated_max_register_virtual_size = deprecated_max_register_virtual_size;
}
int
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)
-#error "Non multi-arch definition of MAX_REGISTER_RAW_SIZE"
+#if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
+/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */
+#if !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (0)
+#endif
+
+extern int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
+#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_max_register_raw_size_p (current_gdbarch))
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE (0)
+#endif
+
+extern int gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, int deprecated_max_register_raw_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
+#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_RAW_SIZE)
-#define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
+#define DEPRECATED_MAX_REGISTER_RAW_SIZE (gdbarch_deprecated_max_register_raw_size (current_gdbarch))
#endif
#endif
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)
-#error "Non multi-arch definition of MAX_REGISTER_VIRTUAL_SIZE"
+#if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
+/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */
+#if !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (0)
+#endif
+
+extern int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
+#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_max_register_virtual_size_p (current_gdbarch))
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (0)
+#endif
+
+extern int gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, int deprecated_max_register_virtual_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
+#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (MAX_REGISTER_VIRTUAL_SIZE)
-#define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
+#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (gdbarch_deprecated_max_register_virtual_size (current_gdbarch))
#endif
#endif
# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
# by REGISTER_TYPE.
-v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1
+V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size
# 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
# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
# by REGISTER_TYPE.
-v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
+V:2:DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE:int:deprecated_max_register_virtual_size
# 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
set_gdbarch_register_bytes (gdbarch, E_NUM_REGS * BINWORD);
set_gdbarch_register_byte (gdbarch, h8300_register_byte);
set_gdbarch_register_raw_size (gdbarch, h8300_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, h8300h_reg_size);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, h8300h_reg_size);
set_gdbarch_register_virtual_size (gdbarch, h8300_register_raw_size);
- set_gdbarch_max_register_virtual_size (gdbarch, h8300h_reg_size);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, h8300h_reg_size);
set_gdbarch_register_virtual_type (gdbarch, h8300_register_virtual_type);
set_gdbarch_print_registers_info (gdbarch, h8300_print_registers_info);
set_gdbarch_print_float_info (gdbarch, h8300_print_float_info);
set_gdbarch_register_bytes (gdbarch, hppa_num_regs * 4);
set_gdbarch_register_byte (gdbarch, hppa_register_byte);
set_gdbarch_register_virtual_size (gdbarch, hppa_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 4);
- set_gdbarch_max_register_virtual_size (gdbarch, 8);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
set_gdbarch_register_virtual_type (gdbarch, hppa_register_virtual_type);
set_gdbarch_store_struct_return (gdbarch, hppa_store_struct_return);
set_gdbarch_deprecated_extract_return_value (gdbarch,
set_gdbarch_register_name (gdbarch, i386_register_name);
set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch, I386_SIZEOF_GREGS + I386_SIZEOF_FREGS);
- set_gdbarch_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE);
- set_gdbarch_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, I386_MAX_REGISTER_SIZE);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, I386_MAX_REGISTER_SIZE);
set_gdbarch_register_virtual_type (gdbarch, i386_register_virtual_type);
set_gdbarch_print_float_info (gdbarch, i387_print_float_info);
set_gdbarch_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8);
set_gdbarch_register_byte (gdbarch, ia64_register_byte);
set_gdbarch_register_raw_size (gdbarch, ia64_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 16);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16);
set_gdbarch_register_virtual_size (gdbarch, ia64_register_virtual_size);
- set_gdbarch_max_register_virtual_size (gdbarch, 16);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 16);
set_gdbarch_register_virtual_type (gdbarch, ia64_register_virtual_type);
set_gdbarch_skip_prologue (gdbarch, ia64_skip_prologue);
/* Set register info. */
set_gdbarch_fp0_regnum (gdbarch, -1);
- set_gdbarch_max_register_raw_size (gdbarch, 2);
- set_gdbarch_max_register_virtual_size (gdbarch, 2);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 2);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 2);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, m68hc11_frame_init_saved_regs);
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_register_raw_size (gdbarch, m68k_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, m68k_register_virtual_size);
- set_gdbarch_max_register_raw_size (gdbarch, 12);
- set_gdbarch_max_register_virtual_size (gdbarch, 12);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 12);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 12);
set_gdbarch_register_virtual_type (gdbarch, m68k_register_virtual_type);
set_gdbarch_register_name (gdbarch, m68k_register_name);
set_gdbarch_register_size (gdbarch, 4);
/* All registers are 32 bits */
set_gdbarch_register_size (gdbarch, MCORE_REG_SIZE);
- set_gdbarch_max_register_raw_size (gdbarch, MCORE_REG_SIZE);
- set_gdbarch_max_register_virtual_size (gdbarch, MCORE_REG_SIZE);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, MCORE_REG_SIZE);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, MCORE_REG_SIZE);
set_gdbarch_register_name (gdbarch, mcore_register_name);
set_gdbarch_register_virtual_type (gdbarch, mcore_register_virtual_type);
set_gdbarch_register_virtual_size (gdbarch, mcore_register_size);
set_gdbarch_double_bit (gdbarch, 64);
set_gdbarch_long_double_bit (gdbarch, 64);
set_gdbarch_register_raw_size (gdbarch, mips_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 8);
- set_gdbarch_max_register_virtual_size (gdbarch, 8);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
tdep->found_abi = found_abi;
tdep->mips_abi = mips_abi;
set_gdbarch_register_size (gdbarch, 4);
set_gdbarch_register_bytes (gdbarch,
num_regs * gdbarch_register_size (gdbarch));
- set_gdbarch_max_register_raw_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
set_gdbarch_register_raw_size (gdbarch, mn10300_register_raw_size);
set_gdbarch_register_byte (gdbarch, mn10300_register_byte);
- set_gdbarch_max_register_virtual_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
set_gdbarch_register_virtual_size (gdbarch, mn10300_register_virtual_size);
set_gdbarch_register_virtual_type (gdbarch, mn10300_register_virtual_type);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum);
set_gdbarch_register_size (gdbarch, NS32K_REGISTER_SIZE);
set_gdbarch_register_raw_size (gdbarch, ns32k_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, NS32K_MAX_REGISTER_RAW_SIZE);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, NS32K_MAX_REGISTER_RAW_SIZE);
set_gdbarch_register_virtual_size (gdbarch, ns32k_register_virtual_size);
- set_gdbarch_max_register_virtual_size (gdbarch,
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch,
NS32K_MAX_REGISTER_VIRTUAL_SIZE);
set_gdbarch_register_virtual_type (gdbarch, ns32k_register_virtual_type);
return descr->max_register_size;
}
+int
+legacy_max_register_raw_size (void)
+{
+ if (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ())
+ return DEPRECATED_MAX_REGISTER_RAW_SIZE;
+ else
+ return max_register_size (current_gdbarch);
+}
+
+int
+legacy_max_register_virtual_size (void)
+{
+ if (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ())
+ return DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE;
+ else
+ return max_register_size (current_gdbarch);
+}
+
int
register_size (struct gdbarch *gdbarch, int regnum)
{
set_gdbarch_register_bytes (gdbarch, off);
set_gdbarch_register_byte (gdbarch, rs6000_register_byte);
set_gdbarch_register_raw_size (gdbarch, rs6000_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 16);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16);
set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
- set_gdbarch_max_register_virtual_size (gdbarch, 16);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 16);
set_gdbarch_register_virtual_type (gdbarch, rs6000_register_virtual_type);
set_gdbarch_ptr_bit (gdbarch, wordsize * TARGET_CHAR_BIT);
/* Offset from address of function to start of its code.
Zero on most machines. */
set_gdbarch_function_start_offset (gdbarch, 0);
- set_gdbarch_max_register_raw_size (gdbarch, 8);
- set_gdbarch_max_register_virtual_size (gdbarch, 8);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
set_gdbarch_breakpoint_from_pc (gdbarch, s390_breakpoint_from_pc);
set_gdbarch_skip_prologue (gdbarch, s390_skip_prologue);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, s390_init_extra_frame_info);
set_gdbarch_fp0_regnum (gdbarch, -1);
set_gdbarch_num_pseudo_regs (gdbarch, 0);
- set_gdbarch_max_register_raw_size (gdbarch, 4);
- set_gdbarch_max_register_virtual_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_num_regs (gdbarch, SH_DEFAULT_NUM_REGS);
set_gdbarch_register_virtual_size (gdbarch, sh_sh4_register_raw_size);
set_gdbarch_register_byte (gdbarch, sh_sh4_register_byte);
set_gdbarch_num_pseudo_regs (gdbarch, 12);
- set_gdbarch_max_register_raw_size (gdbarch, 4 * 4);
- set_gdbarch_max_register_virtual_size (gdbarch, 4 * 4);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4 * 4);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4 * 4);
set_gdbarch_pseudo_register_read (gdbarch, sh_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write);
tdep->FPUL_REGNUM = 23;
set_gdbarch_register_virtual_size (gdbarch, sh_sh64_register_raw_size);
set_gdbarch_register_byte (gdbarch, sh_sh64_register_byte);
/* This seems awfully wrong!*/
- /*set_gdbarch_max_register_raw_size (gdbarch, 8);*/
+ /*set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);*/
/* should include the size of the pseudo regs. */
- set_gdbarch_max_register_raw_size (gdbarch, 4 * 4);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4 * 4);
/* Or should that go in the virtual_size? */
- /*set_gdbarch_max_register_virtual_size (gdbarch, 8);*/
- set_gdbarch_max_register_virtual_size (gdbarch, 4 * 4);
+ /*set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);*/
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4 * 4);
set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write);
set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT);
set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- set_gdbarch_max_register_raw_size (gdbarch, 8);
- set_gdbarch_max_register_virtual_size (gdbarch, 8);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
set_gdbarch_pop_frame (gdbarch, sparc_pop_frame);
set_gdbarch_push_return_address (gdbarch, sparc_push_return_address);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, sparc_push_dummy_frame);
set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_register_byte (gdbarch, v850_register_byte);
set_gdbarch_register_raw_size (gdbarch, v850_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, v850_reg_size);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, v850_reg_size);
set_gdbarch_register_virtual_size (gdbarch, v850_register_raw_size);
- set_gdbarch_max_register_virtual_size (gdbarch, v850_reg_size);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, v850_reg_size);
set_gdbarch_register_virtual_type (gdbarch, v850_reg_virtual_type);
set_gdbarch_read_fp (gdbarch, v850_target_read_fp);
set_gdbarch_register_bytes (gdbarch, VAX_REGISTER_BYTES);
set_gdbarch_register_byte (gdbarch, vax_register_byte);
set_gdbarch_register_raw_size (gdbarch, vax_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE);
set_gdbarch_register_virtual_size (gdbarch, vax_register_virtual_size);
- set_gdbarch_max_register_virtual_size (gdbarch,
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch,
VAX_MAX_REGISTER_VIRTUAL_SIZE);
set_gdbarch_register_virtual_type (gdbarch, vax_register_virtual_type);
set_gdbarch_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_register_byte (gdbarch, xstormy16_register_byte);
set_gdbarch_register_raw_size (gdbarch, xstormy16_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, xstormy16_pc_size);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, xstormy16_pc_size);
set_gdbarch_register_virtual_size (gdbarch, xstormy16_register_raw_size);
- set_gdbarch_max_register_virtual_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
set_gdbarch_register_virtual_type (gdbarch, xstormy16_reg_virtual_type);
/*