* gdbarch.sh: Add comments on MAX_REGISTER_SIZE.
* gdbarch.h: Re-generate.
* defs.h (MAX_REGISTER_VIRTUAL_SIZE): Delete macro.
(legacy_max_register_virtual_size): Delete declaration.
* infcmd.c (default_print_registers_info): Use MAX_REGISTER_SIZE.
* d10v-tdep.c (d10v_print_registers_info): Ditto.
* tracepoint.c (memrange_sortmerge): Ditto.
* sparc-tdep.c (sparc_print_registers): Ditto.
* regcache.c (legacy_max_register_virtual_size): Delete function.
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh: Add comments on MAX_REGISTER_SIZE.
+ * gdbarch.h: Re-generate.
+ * defs.h (MAX_REGISTER_VIRTUAL_SIZE): Delete macro.
+ (legacy_max_register_virtual_size): Delete declaration.
+ * infcmd.c (default_print_registers_info): Use MAX_REGISTER_SIZE.
+ * d10v-tdep.c (d10v_print_registers_info): Ditto.
+ * tracepoint.c (memrange_sortmerge): Ditto.
+ * sparc-tdep.c (sparc_print_registers): Ditto.
+ * regcache.c (legacy_max_register_virtual_size): Delete function.
+
2002-05-08 J. Brobecker <brobecker@gnat.com>
* fork-child.c (escape_bang_in_quoted_argument): New function.
}
{
- char *num = alloca (max_register_size (gdbarch));
+ char num[MAX_REGISTER_SIZE];
int a;
fprintf_filtered (file, "A0-A%d", NR_A_REGS - 1);
for (a = a0_regnum (gdbarch); a < a0_regnum (gdbarch) + NR_A_REGS; a++)
#include "arch-utils.h"
#endif
+/* Maximum size of a register. Something small, but large enough for
+ all known ISAs. If it turns out to be too small, make it bigger. */
+
+enum { MAX_REGISTER_SIZE = 16 };
+
/* FIXME: cagney/2003-03-01: Hack to prop up old targets while they
migrate to the overhauled register cache.
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.
#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. */
+/* The methods REGISTER_VIRTUAL_TYPE, 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)
#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. */
+/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE, MAX_REGISTER_RAW_SIZE,
+ DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE, and MAX_REGISTER_VIRTUAL_SIZE
+ are all being replaced by MAX_REGISTER_SIZE (a constant). */
#if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */
#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. */
+/* The methods REGISTER_VIRTUAL_TYPE, 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)
#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. */
+/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE, MAX_REGISTER_RAW_SIZE,
+ DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE, and MAX_REGISTER_VIRTUAL_SIZE
+ are all being replaced by MAX_REGISTER_SIZE (a constant). */
#if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */
#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. */
+/* The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+ REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE. */
#if defined (REGISTER_VIRTUAL_TYPE)
/* Legacy for systems yet to multi-arch REGISTER_VIRTUAL_TYPE */
# migration process - old code, calling REGISTER_BYTE, doesn't need to
# be modified.
F::REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte
-# 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.
+# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
-# 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.
+# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE, MAX_REGISTER_RAW_SIZE,
+# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE, and MAX_REGISTER_VIRTUAL_SIZE
+# are all being replaced by MAX_REGISTER_SIZE (a constant).
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
-# by REGISTER_TYPE.
+# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size::0
-# 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.
+# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE, MAX_REGISTER_RAW_SIZE,
+# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE, and MAX_REGISTER_VIRTUAL_SIZE
+# are all being replaced by MAX_REGISTER_SIZE (a constant).
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
-# by REGISTER_TYPE.
+# The methods REGISTER_VIRTUAL_TYPE, REGISTER_VIRTUAL_SIZE and
+# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
F:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr::0:
#
{
int i;
const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
- char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
if (DEPRECATED_DO_REGISTERS_INFO_P ())
{
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * mi-main.c (get_register): Use MAX_REGISTER_SIZE.
+
2003-05-05 Andrew Cagney <cagney@redhat.com>
* mi-main.c (mi_cmd_data_write_register_values): Replace
static int
get_register (int regnum, int format)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
- char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
int optim;
int realnum;
CORE_ADDR addr;
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)
{
{
int i;
const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
- char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
+ char virtual_buffer[MAX_REGISTER_SIZE];
for (i = 0; i < numregs; i++)
{
{
if (memranges->list[a].type == memranges->list[b].type &&
memranges->list[b].start - memranges->list[a].end <=
- MAX_REGISTER_VIRTUAL_SIZE)
+ MAX_REGISTER_SIZE)
{
/* memrange b starts before memrange a ends; merge them. */
if (memranges->list[b].end > memranges->list[a].end)