aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog16
-rw-r--r--gdb/defs.h16
-rw-r--r--gdb/dwarf2cfi.c2
-rw-r--r--gdb/findvar.c6
-rw-r--r--gdb/frame.c4
-rw-r--r--gdb/gdbarch.h12
-rwxr-xr-xgdb/gdbarch.sh12
-rw-r--r--gdb/i386-tdep.c4
-rw-r--r--gdb/ia64-tdep.c4
-rw-r--r--gdb/infptrace.c4
-rw-r--r--gdb/m68klinux-nat.c2
-rw-r--r--gdb/mi/ChangeLog5
-rw-r--r--gdb/mi/mi-main.c2
-rw-r--r--gdb/mips-linux-tdep.c18
-rw-r--r--gdb/mips-tdep.c24
-rw-r--r--gdb/mn10300-tdep.c2
-rw-r--r--gdb/monitor.c6
-rw-r--r--gdb/ppc-linux-nat.c4
-rw-r--r--gdb/regcache.c13
-rw-r--r--gdb/remote-array.c2
-rw-r--r--gdb/remote-rdp.c2
-rw-r--r--gdb/remote-sim.c8
-rw-r--r--gdb/remote.c6
-rw-r--r--gdb/rs6000-nat.c4
-rw-r--r--gdb/rs6000-tdep.c6
-rw-r--r--gdb/sh-tdep.c8
-rw-r--r--gdb/sparc-tdep.c15
-rw-r--r--gdb/stack.c2
-rw-r--r--gdb/target.c2
-rw-r--r--gdb/tui/ChangeLog5
-rw-r--r--gdb/tui/tuiRegs.c6
-rw-r--r--gdb/valops.c7
32 files changed, 111 insertions, 118 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 67c8ed7..7f439cd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,21 @@
2003-05-08 Andrew Cagney <cagney@redhat.com>
+ * gdbarch.sh: Delete references to MAX_REGISTER_RAW_SIZE.
+ * gdbarch.h: Re-generate.
+ * defs.h (MAX_REGISTER_RAW_SIZE): Delete macro.
+ (legacy_max_register_raw_size): Delete declaration.
+ * regcache.c (legacy_max_register_raw_size): Delete function.
+ * valops.c: Replace MAX_REGISTER_RAW_SIZE with MAX_REGISTER_SIZE.
+ * target.c, stack.c, sparc-tdep.c, sh-tdep.c: Ditto.
+ * rs6000-tdep.c, rs6000-nat.c, remote.c, remote-sim.c: Ditto.
+ * remote-rdp.c, remote-array.c, regcache.c: Ditto.
+ * ppc-linux-nat.c, monitor.c, mn10300-tdep.c: Ditto.
+ * mips-tdep.c, mips-linux-tdep.c, m68klinux-nat.c: Ditto.
+ * infptrace.c, ia64-tdep.c, i386-tdep.c, frame.c: Ditto.
+ * findvar.c, dwarf2cfi.c: Ditto.
+
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
* mips-tdep.c (read_signed_register): New function, moved to here
from "regcache.c".
(read_signed_register_pid): Ditto.
diff --git a/gdb/defs.h b/gdb/defs.h
index 420cf31..d442783 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -1091,22 +1091,6 @@ extern void *alloca ();
enum { MAX_REGISTER_SIZE = 16 };
-/* 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 ()
-
/* Static target-system-dependent parameters for GDB. */
/* Number of bits in a char or unsigned char for the target machine.
diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c
index 81fa207..085c91c 100644
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -1751,7 +1751,7 @@ cfi_write_fp (CORE_ADDR val)
void
cfi_pop_frame (struct frame_info *fi)
{
- char *regbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char regbuf[MAX_REGISTER_SIZE];
int regnum;
for (regnum = 0; regnum < NUM_REGS; regnum++)
diff --git a/gdb/findvar.c b/gdb/findvar.c
index beab9fb..ca371d2 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -300,7 +300,7 @@ value_of_register (int regnum, struct frame_info *frame)
int optim;
struct value *reg_val;
int realnum;
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
enum lval_type lval;
/* Builtin registers lie completly outside of the range of normal
@@ -664,7 +664,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
struct value *
value_from_register (struct type *type, int regnum, struct frame_info *frame)
{
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
CORE_ADDR addr;
int optim;
struct value *v = allocate_value (type);
@@ -699,7 +699,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
CORE_ADDR last_addr = 0;
CORE_ADDR first_addr = 0;
- value_bytes = (char *) alloca (len + MAX_REGISTER_RAW_SIZE);
+ value_bytes = (char *) alloca (len + MAX_REGISTER_SIZE);
/* Copy all of the data out, whereever it may be. */
diff --git a/gdb/frame.c b/gdb/frame.c
index d007c3f..a664b97 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -618,7 +618,7 @@ void
frame_unwind_signed_register (struct frame_info *frame, int regnum,
LONGEST *val)
{
- void *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
frame_unwind_register (frame, regnum, buf);
(*val) = extract_signed_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
@@ -627,7 +627,7 @@ void
frame_unwind_unsigned_register (struct frame_info *frame, int regnum,
ULONGEST *val)
{
- void *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
frame_unwind_register (frame, regnum, buf);
(*val) = extract_unsigned_integer (buf, REGISTER_VIRTUAL_SIZE (regnum));
}
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 27b1ec3..1a8e386 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -802,9 +802,9 @@ extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_regi
#endif
#endif
-/* 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). */
+/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
+ DEPRECATED_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 */
@@ -862,9 +862,9 @@ extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-/* 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). */
+/* The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
+ DEPRECATED_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 */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index f4bae4c..16165a9 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -483,16 +483,16 @@ F::REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::generic_register_byte:gene
# 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 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).
+# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
+# DEPRECATED_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, 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 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).
+# The methods DEPRECATED_MAX_REGISTER_RAW_SIZE and
+# DEPRECATED_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, REGISTER_VIRTUAL_SIZE and
# REGISTER_RAW_SIZE are all being replaced by REGISTER_TYPE.
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 1eab512..5cf63b4 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1097,7 +1097,7 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (i386_mmx_regnum_p (regnum))
{
- char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char mmx_buf[MAX_REGISTER_SIZE];
int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
/* Extract (always little endian). */
@@ -1114,7 +1114,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (i386_mmx_regnum_p (regnum))
{
- char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char mmx_buf[MAX_REGISTER_SIZE];
int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
/* Read ... */
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index ca40f9c..ce9b26c 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -1259,7 +1259,7 @@ ia64_get_saved_register (char *raw_buffer,
}
else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
{
- char *pr_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char pr_raw_buffer[MAX_REGISTER_SIZE];
int pr_optim;
enum lval_type pr_lval;
CORE_ADDR pr_addr;
@@ -1282,7 +1282,7 @@ ia64_get_saved_register (char *raw_buffer,
}
else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
{
- char *unat_raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char unat_raw_buffer[MAX_REGISTER_SIZE];
int unat_optim;
enum lval_type unat_lval;
CORE_ADDR unat_addr;
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index a142080..1225dd8 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -359,7 +359,7 @@ fetch_register (int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
int tid;
if (CANNOT_FETCH_REGISTER (regno))
@@ -424,7 +424,7 @@ store_register (int regno)
register int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
if (CANNOT_STORE_REGISTER (regno))
{
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 0f0a7d1..0cf82fb 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -199,7 +199,7 @@ store_register (int regno)
register int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
if (CANNOT_STORE_REGISTER (regno))
{
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 8e6d8a8..1580d1f 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,5 +1,10 @@
2003-05-08 Andrew Cagney <cagney@redhat.com>
+ * mi-main.c (register_changed_p): Use MAX_REGISTER_SIZE instead of
+ MAX_REGISTER_RAW_SIZE.
+
+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>
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index ac785d3..6158c8f 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -398,7 +398,7 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
static int
register_changed_p (int regnum)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
return -1;
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index ae4e689..b8072f1 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -91,7 +91,7 @@ mips_linux_get_longjmp_target (CORE_ADDR *pc)
static void
supply_32bit_reg (int regnum, const void *addr)
{
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
store_signed_integer (buf, REGISTER_RAW_SIZE (regnum),
extract_signed_integer (addr, 4));
supply_register (regnum, buf);
@@ -104,9 +104,9 @@ supply_gregset (elf_gregset_t *gregsetp)
{
int regi;
elf_greg_t *regp = *gregsetp;
- char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = EF_REG0; regi <= EF_REG31; regi++)
supply_32bit_reg ((regi - EF_REG0), (char *)(regp + regi));
@@ -192,9 +192,9 @@ void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
register int regi;
- char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
@@ -379,9 +379,9 @@ mips64_supply_gregset (mips64_elf_gregset_t *gregsetp)
{
int regi;
mips64_elf_greg_t *regp = *gregsetp;
- char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = MIPS64_EF_REG0; regi <= MIPS64_EF_REG31; regi++)
supply_register ((regi - MIPS64_EF_REG0), (char *)(regp + regi));
@@ -467,9 +467,9 @@ static void
mips64_supply_fpregset (mips64_elf_fpregset_t *fpregsetp)
{
register int regi;
- char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi,
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 619021b..bf19ed8 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -245,7 +245,7 @@ mips_xfer_register (struct regcache *regcache, int reg_num, int length,
enum bfd_endian endian, bfd_byte *in, const bfd_byte *out,
int buf_offset)
{
- bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ bfd_byte reg[MAX_REGISTER_SIZE];
int reg_offset = 0;
/* Need to transfer the left or right part of the register, based on
the targets byte order. */
@@ -1642,7 +1642,7 @@ read_next_frame_reg (struct frame_info *fi, int regno)
CORE_ADDR addr;
int realnum;
enum lval_type lval;
- void *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
if (fi == NULL)
{
@@ -2751,7 +2751,7 @@ mips_eabi_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -3002,7 +3002,7 @@ mips_n32n64_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -3225,7 +3225,7 @@ mips_o32_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -3524,7 +3524,7 @@ mips_o64_push_arguments (int nargs,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val;
- char *valbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
int len = TYPE_LENGTH (arg_type);
@@ -4044,7 +4044,7 @@ mips_print_fp_register (int regnum)
static void
mips_print_register (int regnum, int all)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
int offset;
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
@@ -4100,7 +4100,7 @@ static int
do_gp_register_row (int regnum)
{
/* do values for GP (int) regs */
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
int ncols = (MIPS_REGSIZE == 8 ? 4 : 8); /* display cols per row */
int col, byte;
int start_regnum = regnum;
@@ -4603,7 +4603,7 @@ mips_o64_extract_return_value (struct type *valtype,
static void
mips_eabi_store_return_value (struct type *valtype, char *valbuf)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
struct return_value_word lo;
struct return_value_word hi;
return_value_location (valtype, &hi, &lo);
@@ -4625,7 +4625,7 @@ mips_eabi_store_return_value (struct type *valtype, char *valbuf)
static void
mips_o64_store_return_value (struct type *valtype, char *valbuf)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
struct return_value_word lo;
struct return_value_word hi;
return_value_location (valtype, &hi, &lo);
@@ -4707,7 +4707,7 @@ mips_o32_xfer_return_value (struct type *type,
/* A struct that contains one or two floats. Each value is part
in the least significant part of their floating point
register.. */
- bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ bfd_byte reg[MAX_REGISTER_SIZE];
int regnum;
int field;
for (field = 0, regnum = FP0_REGNUM;
@@ -4819,7 +4819,7 @@ mips_n32n64_xfer_return_value (struct type *type,
/* A struct that contains one or two floats. Each value is part
in the least significant part of their floating point
register.. */
- bfd_byte *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ bfd_byte reg[MAX_REGISTER_SIZE];
int regnum;
int field;
for (field = 0, regnum = FP0_REGNUM;
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 2f88fef..1d58034 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -1010,7 +1010,7 @@ mn10300_dwarf2_reg_to_regnum (int dwarf2)
static void
mn10300_print_register (const char *name, int regnum, int reg_width)
{
- char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
if (reg_width)
printf_filtered ("%*s: ", reg_width, name);
diff --git a/gdb/monitor.c b/gdb/monitor.c
index f58ed2a..20c89f8 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -1181,9 +1181,9 @@ monitor_fetch_register (int regno)
char *regbuf;
int i;
- regbuf = alloca (MAX_REGISTER_RAW_SIZE * 2 + 1);
- zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
- memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
+ regbuf = alloca (MAX_REGISTER_SIZE * 2 + 1);
+ zerobuf = alloca (MAX_REGISTER_SIZE);
+ memset (zerobuf, 0, MAX_REGISTER_SIZE);
if (current_monitor->regname != NULL)
name = current_monitor->regname (regno);
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 4561e4d..20c8add 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -204,7 +204,7 @@ fetch_register (int tid, int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
CORE_ADDR regaddr = ppc_register_u_addr (regno);
if (altivec_register_p (regno))
@@ -364,7 +364,7 @@ store_register (int tid, int regno)
char mess[128]; /* For messages */
register int i;
unsigned int offset; /* Offset of registers within the u area. */
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
if (altivec_register_p (regno))
{
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 8e2a4a9..ec60d97 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -297,15 +297,6 @@ max_register_size (struct gdbarch *gdbarch)
}
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
register_size (struct gdbarch *gdbarch, int regnum)
{
struct regcache_descr *descr = regcache_descr (gdbarch);
@@ -676,7 +667,7 @@ deprecated_read_register_bytes (int in_start, char *in_buf, int in_len)
{
int in_end = in_start + in_len;
int regnum;
- char *reg_buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char reg_buf[MAX_REGISTER_SIZE];
/* See if we are trying to read bytes from out-of-date registers. If so,
update just those registers. */
@@ -1066,7 +1057,7 @@ deprecated_write_register_bytes (int myregstart, char *myaddr, int inlen)
/* The register partially overlaps the range being written. */
else
{
- char *regbuf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char regbuf[MAX_REGISTER_SIZE];
/* What's the overlap between this register's bytes and
those the caller wants to write? */
int overlapstart = max (regstart, myregstart);
diff --git a/gdb/remote-array.c b/gdb/remote-array.c
index da9bfc7..8df9647 100644
--- a/gdb/remote-array.c
+++ b/gdb/remote-array.c
@@ -731,7 +731,7 @@ array_wait (ptid_t ptid, struct target_waitstatus *status)
static void
array_fetch_registers (int ignored)
{
- char *reg = alloca (MAX_REGISTER_RAW_SIZE);
+ char reg[MAX_REGISTER_SIZE];
int regno;
char *p;
char *packet = alloca (PBUFSIZ);
diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c
index 3f956e7..a9dba9a 100644
--- a/gdb/remote-rdp.c
+++ b/gdb/remote-rdp.c
@@ -550,7 +550,7 @@ rdp_fetch_one_fpu_register (int mask, char *buf)
send_rdp ("bbw-SWWWWZ", RDP_COPRO_READ, FPU_COPRO_NUMBER, mask, buf + 0, buf + 4, buf + 8, &dummy);
}
#endif
- memset (buf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (buf, 0, MAX_REGISTER_SIZE);
}
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index f934bd4..da4a96c 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -304,9 +304,9 @@ gdbsim_fetch_register (int regno)
{
/* For moment treat a `does not exist' register the same way
as an ``unavailable'' register. */
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
int nr_bytes;
- memset (buf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (buf, 0, MAX_REGISTER_SIZE);
supply_register (regno, buf);
set_register_cached (regno, -1);
break;
@@ -314,10 +314,10 @@ gdbsim_fetch_register (int regno)
default:
{
static int warn_user = 1;
- char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
int nr_bytes;
gdb_assert (regno >= 0 && regno < NUM_REGS);
- memset (buf, 0, MAX_REGISTER_RAW_SIZE);
+ memset (buf, 0, MAX_REGISTER_SIZE);
nr_bytes = sim_fetch_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
buf, REGISTER_RAW_SIZE (regno));
diff --git a/gdb/remote.c b/gdb/remote.c
index 8a7451e..20becee 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2948,7 +2948,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
case 'T': /* Status with PC, SP, FP, ... */
{
int i;
- char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char regs[MAX_REGISTER_SIZE];
/* Expedited reply, containing Signal, {regno, reg} repeat */
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
@@ -3199,7 +3199,7 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
case 'T': /* Status with PC, SP, FP, ... */
{
int i;
- char* regs = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char regs[MAX_REGISTER_SIZE];
/* Expedited reply, containing Signal, {regno, reg} repeat */
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
@@ -3546,7 +3546,7 @@ store_register_using_P (int regnum)
struct packet_reg *reg = packet_reg_from_regnum (rs, regnum);
/* Try storing a single register. */
char *buf = alloca (rs->remote_packet_size);
- char *regp = alloca (MAX_REGISTER_RAW_SIZE);
+ char regp[MAX_REGISTER_SIZE];
char *p;
int i;
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 4aed8d8..c5a0ea7 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -218,7 +218,7 @@ rs6000_ptrace64 (int req, int id, long long addr, int data, int *buf)
static void
fetch_register (int regno)
{
- int *addr = alloca (MAX_REGISTER_RAW_SIZE);
+ int addr[MAX_REGISTER_SIZE];
int nr, isfloat;
/* Retrieved values may be -1, so infer errors from errno. */
@@ -275,7 +275,7 @@ fetch_register (int regno)
static void
store_register (int regno)
{
- int *addr = alloca (MAX_REGISTER_RAW_SIZE);
+ int addr[MAX_REGISTER_SIZE];
int nr, isfloat;
/* Fetch the register's value from the register cache. */
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 7a692e7..0b239bd 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1739,7 +1739,7 @@ frame_initial_stack_address (struct frame_info *fi)
/* There is an alloca register, use its value, in the current frame,
as the initial stack pointer. */
{
- char *tmpbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ char tmpbuf[MAX_REGISTER_SIZE];
if (frame_register_read (fi, fdata.alloca_reg, tmpbuf))
{
get_frame_extra_info (fi)->initial_sp
@@ -1921,7 +1921,7 @@ e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum;
int offset = 0;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->ppc_gp0_regnum
@@ -1944,7 +1944,7 @@ e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum;
int offset = 0;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->ppc_gp0_regnum
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 00b52b6..e70d74f 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -3481,7 +3481,7 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_nr, void *buffer)
{
int base_regnum, portion;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3520,7 +3520,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int base_regnum;
int portion;
int offset = 0;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3684,7 +3684,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_nr, const void *buffer)
{
int base_regnum, portion;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
@@ -3721,7 +3721,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
int base_regnum, portion;
int offset;
- char *temp_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char temp_buffer[MAX_REGISTER_SIZE];
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->DR0_REGNUM
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index b3a0f1f..7f0ae4b 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -317,9 +317,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
deprecated_read_fp() to create_new_frame. */
if (get_next_frame (fi))
{
- char *buf;
-
- buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
/* Compute ->frame as if not flat. If it is flat, we'll change
it later. */
@@ -368,9 +366,7 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
&& X_OP3 (insn) == 4
&& X_RS1 (insn) == 14)
{
- char *buf;
-
- buf = alloca (MAX_REGISTER_RAW_SIZE);
+ char buf[MAX_REGISTER_SIZE];
/* We definitely have a flat frame now. */
get_frame_extra_info (fi)->flat = 1;
@@ -474,10 +470,9 @@ sparc_extract_struct_value_address (char *regbuf)
CORE_ADDR
sparc_frame_saved_pc (struct frame_info *frame)
{
- char *buf;
+ char buf[MAX_REGISTER_SIZE];
CORE_ADDR addr;
- buf = alloca (MAX_REGISTER_RAW_SIZE);
if ((get_frame_type (frame) == SIGTRAMP_FRAME))
{
/* This is the signal trampoline frame.
@@ -2311,9 +2306,7 @@ void
sparc_store_return_value (struct type *type, char *valbuf)
{
int regno;
- char *buffer;
-
- buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char buffer[MAX_REGISTER_SIZE];
if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
/* Floating-point values are returned in the register pair */
diff --git a/gdb/stack.c b/gdb/stack.c
index cfb3605..0a0aaac 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -814,7 +814,7 @@ frame_info (char *addr_exp, int from_tty)
&realnum, NULL);
if (!optimized && lval == not_lval)
{
- void *value = alloca (MAX_REGISTER_RAW_SIZE);
+ char value[MAX_REGISTER_SIZE];
CORE_ADDR sp;
frame_register_unwind (fi, SP_REGNUM, &optimized, &lval, &addr,
&realnum, value);
diff --git a/gdb/target.c b/gdb/target.c
index 885e3ef..fd0165a 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1640,7 +1640,7 @@ debug_print_register (const char * func, int regno)
if (regno >= 0)
{
int i;
- unsigned char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ unsigned char buf[MAX_REGISTER_SIZE];
deprecated_read_register_gen (regno, buf);
fprintf_unfiltered (gdb_stdlog, " = ");
for (i = 0; i < REGISTER_RAW_SIZE (regno); i++)
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index 0da5591..f44f9aa 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-08 Andrew Cagney <cagney@redhat.com>
+
+ * tuiRegs.c: Use MAX_REGISTER_SIZE instead of
+ MAX_REGISTER_RAW_SIZE.
+
2003-05-03 Andrew Cagney <cagney@redhat.com>
* tuiDisassem.c (tui_disassemble): Call gdb_print_insn, instead of
diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c
index 6920d80..61b9334 100644
--- a/gdb/tui/tuiRegs.c
+++ b/gdb/tui/tuiRegs.c
@@ -489,7 +489,7 @@ tuiCheckRegisterValues (struct frame_info *frame)
else
{
int i, j;
- char rawBuf[MAX_REGISTER_RAW_SIZE];
+ char rawBuf[MAX_REGISTER_SIZE];
for (i = 0;
(i < dataWin->detail.dataDisplayInfo.regsContentCount); i++)
@@ -766,7 +766,7 @@ _tuiRegValueHasChanged (TuiDataElementPtr dataElement,
if (dataElement->itemNo != UNDEFINED_ITEM &&
_tuiRegisterName (dataElement->itemNo) != (char *) NULL)
{
- char rawBuf[MAX_REGISTER_RAW_SIZE];
+ char rawBuf[MAX_REGISTER_SIZE];
int i;
if (_tuiGetRegisterRawValue (
@@ -830,7 +830,7 @@ _tuiSetRegisterElement (int regNum, struct frame_info *frame,
dataElement->highlight = FALSE;
}
if (dataElement->value == (Opaque) NULL)
- dataElement->value = (Opaque) xmalloc (MAX_REGISTER_RAW_SIZE);
+ dataElement->value = (Opaque) xmalloc (MAX_REGISTER_SIZE);
if (dataElement->value != (Opaque) NULL)
_tuiGetRegisterRawValue (regNum, dataElement->value, frame);
}
diff --git a/gdb/valops.c b/gdb/valops.c
index 5523c5d..eae2dc8 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -480,7 +480,7 @@ value_assign (struct value *toval, struct value *fromval)
{
register struct type *type;
struct value *val;
- char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
+ char raw_buffer[MAX_REGISTER_SIZE];
int use_buffer = 0;
struct frame_id old_frame;
@@ -634,8 +634,7 @@ value_assign (struct value *toval, struct value *fromval)
amount_to_copy = byte_offset + TYPE_LENGTH (type);
/* And a bounce buffer. Be slightly over generous. */
- buffer = (char *) alloca (amount_to_copy
- + MAX_REGISTER_RAW_SIZE);
+ buffer = (char *) alloca (amount_to_copy + MAX_REGISTER_SIZE);
/* Copy it in. */
for (regno = reg_offset, amount_copied = 0;
@@ -963,7 +962,7 @@ CORE_ADDR
push_word (CORE_ADDR sp, ULONGEST word)
{
register int len = DEPRECATED_REGISTER_SIZE;
- char *buffer = alloca (MAX_REGISTER_RAW_SIZE);
+ char buffer[MAX_REGISTER_SIZE]);
store_unsigned_integer (buffer, len, word);
if (INNER_THAN (1, 2))