aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-05-08 18:46:49 +0000
committerAndrew Cagney <cagney@redhat.com>2003-05-08 18:46:49 +0000
commit0c92afe8cde4361ee019f661e94e34b363ba24e9 (patch)
treea89708cba42549fa1c2942b0c9e0c8013389feac
parent6037b8306e768248d2a00de918bfb953fa9d8b24 (diff)
downloadgdb-0c92afe8cde4361ee019f661e94e34b363ba24e9.zip
gdb-0c92afe8cde4361ee019f661e94e34b363ba24e9.tar.gz
gdb-0c92afe8cde4361ee019f661e94e34b363ba24e9.tar.bz2
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.
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/d10v-tdep.c2
-rw-r--r--gdb/defs.h12
-rw-r--r--gdb/gdbarch.h32
-rwxr-xr-xgdb/gdbarch.sh32
-rw-r--r--gdb/infcmd.c4
-rw-r--r--gdb/mi/ChangeLog4
-rw-r--r--gdb/mi/mi-main.c4
-rw-r--r--gdb/regcache.c9
-rw-r--r--gdb/sparc-tdep.c4
-rw-r--r--gdb/tracepoint.c2
11 files changed, 53 insertions, 64 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ce84ed7..f0d19c4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+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.
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index 32e60f1..c184b44 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -865,7 +865,7 @@ d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
}
{
- 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++)
diff --git a/gdb/defs.h b/gdb/defs.h
index 6024253..420cf31 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -1086,6 +1086,11 @@ extern void *alloca ();
#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.
@@ -1102,13 +1107,6 @@ extern void *alloca ();
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.
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 10404a0..27b1ec3 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -782,10 +782,8 @@ 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. */
+/* 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)
@@ -804,10 +802,9 @@ 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. */
+/* 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 */
@@ -845,10 +842,8 @@ extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarc
#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)
@@ -867,10 +862,9 @@ 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. */
+/* 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 */
@@ -908,10 +902,8 @@ extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gd
#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 */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 47271f9..f4bae4c 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -480,30 +480,22 @@ v::REGISTER_BYTES:int:register_bytes
# 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:
#
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 5867655..de6c319 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1500,8 +1500,8 @@ default_print_registers_info (struct gdbarch *gdbarch,
{
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 ())
{
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index dc6669b..8e6d8a8 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,7 @@
+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
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index e13516a..ac785d3 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -511,8 +511,8 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc)
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;
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 5bfe958..5fa2b4a 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -306,15 +306,6 @@ legacy_max_register_raw_size (void)
}
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)
{
struct regcache_descr *descr = regcache_descr (gdbarch);
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 00f9f16..b3a0f1f 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -2070,8 +2070,8 @@ sparc_print_registers (struct gdbarch *gdbarch,
{
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++)
{
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 855a5b2..17ee07c 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1115,7 +1115,7 @@ memrange_sortmerge (struct collection_list *memranges)
{
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)