From: Andrew Cagney Date: Tue, 3 Aug 2004 02:02:24 +0000 (+0000) Subject: 2004-08-02 Andrew Cagney X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f42accbe7716215000a57d249d71abe32784c9fe;p=binutils-gdb.git 2004-08-02 Andrew Cagney * gdbarch.sh (deprecated_register_bytes): Delete. * gdbarch.h, gdbarch.c: Re-generate. * regcache.c (deprecated_register_bytes): New function. * regcache.h (deprecated_register_bytes): Declare. * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. * v850-tdep.c (v850_gdbarch_init): Update. * sh64-tdep.c (sh64_gdbarch_init): Update. * ns32k-tdep.c (ns32k_gdbarch_init_32082): Update. * mn10300-tdep.c (mn10300_gdbarch_init): Update. * mcore-tdep.c (mcore_gdbarch_init): Update. * cris-tdep.c (cris_gdbarch_init): Update. * arm-tdep.c (arm_gdbarch_init): Update. * remote.c (init_remote_state): Update. * remote-vx.c (vx_prepare_to_store): Update. * remote-sds.c (sds_fetch_registers, sds_prepare_to_store): Update. * irix5-nat.c (fetch_core_registers): Update. * cris-tdep.c (cris_register_bytes_ok): Update. * config/nm-gnu.h (CHILD_PREPARE_TO_STORE): Update. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5c3b2ab67e3..64c61bf47b6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,24 @@ 2004-08-02 Andrew Cagney + * gdbarch.sh (deprecated_register_bytes): Delete. + * gdbarch.h, gdbarch.c: Re-generate. + * regcache.c (deprecated_register_bytes): New function. + * regcache.h (deprecated_register_bytes): Declare. + * xstormy16-tdep.c (xstormy16_gdbarch_init): Update. + * v850-tdep.c (v850_gdbarch_init): Update. + * sh64-tdep.c (sh64_gdbarch_init): Update. + * ns32k-tdep.c (ns32k_gdbarch_init_32082): Update. + * mn10300-tdep.c (mn10300_gdbarch_init): Update. + * mcore-tdep.c (mcore_gdbarch_init): Update. + * cris-tdep.c (cris_gdbarch_init): Update. + * arm-tdep.c (arm_gdbarch_init): Update. + * remote.c (init_remote_state): Update. + * remote-vx.c (vx_prepare_to_store): Update. + * remote-sds.c (sds_fetch_registers, sds_prepare_to_store): Update. + * irix5-nat.c (fetch_core_registers): Update. + * cris-tdep.c (cris_register_bytes_ok): Update. + * config/nm-gnu.h (CHILD_PREPARE_TO_STORE): Update. + * mips-tdep.c (mips_gdbarch_init, mips_insn16_frame_cache) (mips_insn16_frame_this_id, mips_insn16_frame_prev_register) (mips_insn16_frame_unwind, mips_insn16_frame_sniffer) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 952b18ff63b..43de3b1f095 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -2710,10 +2710,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM); set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM); set_gdbarch_deprecated_register_byte (gdbarch, arm_register_byte); - set_gdbarch_deprecated_register_bytes (gdbarch, - (NUM_GREGS * INT_REGISTER_SIZE - + NUM_FREGS * FP_REGISTER_SIZE - + NUM_SREGS * STATUS_REGISTER_SIZE)); set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SREGS); set_gdbarch_register_type (gdbarch, arm_register_type); diff --git a/gdb/config/nm-gnu.h b/gdb/config/nm-gnu.h index ea6308a2c70..bff33dd129e 100644 --- a/gdb/config/nm-gnu.h +++ b/gdb/config/nm-gnu.h @@ -30,7 +30,7 @@ extern char *gnu_target_pid_to_str (int pid); /* Before storing, we need to read all the registers. */ -#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES) +#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, deprecated_register_bytes ()) /* Don't do wait_for_inferior on attach. */ #define ATTACH_NO_WAIT diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 0d1123dfa2f..be90dbfddce 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -1320,7 +1320,7 @@ cris_register_name (int regno) static int cris_register_bytes_ok (long bytes) { - return (bytes == DEPRECATED_REGISTER_BYTES); + return (bytes == deprecated_register_bytes ()); } /* Extract from an array regbuf containing the raw register state a function @@ -3850,8 +3850,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unknown CRIS version"); } - set_gdbarch_deprecated_register_bytes (gdbarch, register_bytes); - /* Returns the register offset for the first byte of register regno's space in the saved register state. */ set_gdbarch_deprecated_register_byte (gdbarch, cris_register_offset); diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index e41c2431ca2..90cea681e29 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-02 Andrew Cagney + + * gdbint.texinfo (Target Architecture Definition): Delete + description of DEPRECATED_REGISTER_BYTES. + 2004-07-30 Baurjan Ismagulov * gdb.texinfo (Source Path): Document the new behavior of diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 76fa057098c..2f8e04a1b24 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -3626,14 +3626,6 @@ reserved for that breakpoint, and @var{real_pc} set to @var{funaddr}. This method replaces @code{CALL_DUMMY_LOCATION}, @code{DEPRECATED_REGISTER_SIZE}. -@item DEPRECATED_REGISTER_BYTES -@findex DEPRECATED_REGISTER_BYTES -The total amount of space needed to store @value{GDBN}'s copy of the -machine's register state. - -This is no longer needed. @value{GDBN} instead computes the size of the -register buffer at run-time. - @item REGISTER_NAME(@var{i}) @findex REGISTER_NAME Return the name of register @var{i} as a string. May return @code{NULL} diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 0345070655d..5e7741b59cc 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -146,7 +146,6 @@ struct gdbarch gdbarch_register_name_ftype *register_name; gdbarch_register_type_ftype *register_type; gdbarch_deprecated_register_virtual_type_ftype *deprecated_register_virtual_type; - int deprecated_register_bytes; gdbarch_deprecated_register_byte_ftype *deprecated_register_byte; gdbarch_deprecated_register_raw_size_ftype *deprecated_register_raw_size; gdbarch_deprecated_register_virtual_size_ftype *deprecated_register_virtual_size; @@ -291,7 +290,6 @@ struct gdbarch startup_gdbarch = 0, /* register_name */ 0, /* register_type */ 0, /* deprecated_register_virtual_type */ - 0, /* deprecated_register_bytes */ generic_register_byte, /* deprecated_register_byte */ generic_register_size, /* deprecated_register_raw_size */ generic_register_size, /* deprecated_register_virtual_size */ @@ -1198,14 +1196,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: deprecated_register_byte = <0x%lx>\n", (long) current_gdbarch->deprecated_register_byte); -#ifdef DEPRECATED_REGISTER_BYTES - fprintf_unfiltered (file, - "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n", - XSTRING (DEPRECATED_REGISTER_BYTES)); -#endif - fprintf_unfiltered (file, - "gdbarch_dump: deprecated_register_bytes = %s\n", - paddr_d (current_gdbarch->deprecated_register_bytes)); #ifdef DEPRECATED_REGISTER_RAW_SIZE_P fprintf_unfiltered (file, "gdbarch_dump: %s # %s\n", @@ -2620,22 +2610,6 @@ set_gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, gdbarch->deprecated_register_virtual_type = deprecated_register_virtual_type; } -int -gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_bytes called\n"); - return gdbarch->deprecated_register_bytes; -} - -void -set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, - int deprecated_register_bytes) -{ - gdbarch->deprecated_register_bytes = deprecated_register_bytes; -} - int gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch) { diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index afddb7a8ec3..7b071300a47 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -481,18 +481,6 @@ extern void set_gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarc #define DEPRECATED_REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_deprecated_register_virtual_type (current_gdbarch, reg_nr)) #endif -/* DEPRECATED_REGISTER_BYTES can be deleted. The value is computed - from REGISTER_TYPE. */ - -extern int gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch); -extern void set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, int deprecated_register_bytes); -#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTES) -#error "Non multi-arch definition of DEPRECATED_REGISTER_BYTES" -#endif -#if !defined (DEPRECATED_REGISTER_BYTES) -#define DEPRECATED_REGISTER_BYTES (gdbarch_deprecated_register_bytes (current_gdbarch)) -#endif - /* If the value returned by DEPRECATED_REGISTER_BYTE agrees with the register offsets computed using just REGISTER_TYPE, this can be deleted. See: maint print registers. NOTE: cagney/2002-05-02: This diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 563781df6f5..7c687a3d7c2 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -463,9 +463,6 @@ f:=:const char *:register_name:int regnr:regnr M::struct type *:register_type:int reg_nr:reg_nr # REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE. F:=:struct type *:deprecated_register_virtual_type:int reg_nr:reg_nr -# DEPRECATED_REGISTER_BYTES can be deleted. The value is computed -# from REGISTER_TYPE. -v:=:int:deprecated_register_bytes # If the value returned by DEPRECATED_REGISTER_BYTE agrees with the # register offsets computed using just REGISTER_TYPE, this can be # deleted. See: maint print registers. NOTE: cagney/2002-05-02: This diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 129742fb6d8..5cf60555f04 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -210,7 +210,7 @@ static void fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, CORE_ADDR reg_addr) { - if (core_reg_size == DEPRECATED_REGISTER_BYTES) + if (core_reg_size == deprecated_register_bytes ()) { memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size); } diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c index 0313a6cfa6e..f2a283a20f0 100644 --- a/gdb/mcore-tdep.c +++ b/gdb/mcore-tdep.c @@ -1041,7 +1041,6 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_deprecated_register_virtual_size (gdbarch, mcore_register_size); set_gdbarch_deprecated_register_raw_size (gdbarch, mcore_register_size); set_gdbarch_deprecated_register_byte (gdbarch, mcore_register_byte); - set_gdbarch_deprecated_register_bytes (gdbarch, MCORE_REG_SIZE * MCORE_NUM_REGS); set_gdbarch_num_regs (gdbarch, MCORE_NUM_REGS); set_gdbarch_pc_regnum (gdbarch, 64); set_gdbarch_sp_regnum (gdbarch, 0); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 624ce6704e6..e9b72005557 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1290,7 +1290,6 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_num_regs (gdbarch, num_regs); set_gdbarch_register_name (gdbarch, register_name); set_gdbarch_deprecated_register_size (gdbarch, 4); - set_gdbarch_deprecated_register_bytes (gdbarch, num_regs * gdbarch_deprecated_register_size (gdbarch)); set_gdbarch_deprecated_register_raw_size (gdbarch, mn10300_register_raw_size); set_gdbarch_deprecated_register_byte (gdbarch, mn10300_register_byte); set_gdbarch_deprecated_register_virtual_size (gdbarch, mn10300_register_virtual_size); diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c index 500f3a06cc3..8813cb2f58c 100644 --- a/gdb/ns32k-tdep.c +++ b/gdb/ns32k-tdep.c @@ -475,7 +475,6 @@ ns32k_gdbarch_init_32082 (struct gdbarch *gdbarch) set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32082); set_gdbarch_register_name (gdbarch, ns32k_register_name_32082); - set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32082); set_gdbarch_deprecated_register_byte (gdbarch, ns32k_register_byte_32082); } @@ -485,7 +484,6 @@ ns32k_gdbarch_init_32382 (struct gdbarch *gdbarch) set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32382); set_gdbarch_register_name (gdbarch, ns32k_register_name_32382); - set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32382); set_gdbarch_deprecated_register_byte (gdbarch, ns32k_register_byte_32382); } diff --git a/gdb/regcache.c b/gdb/regcache.c index ccc82a35316..d933d59c748 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -943,6 +943,14 @@ register_offset_hack (struct gdbarch *gdbarch, int regnum) return descr->register_offset[regnum]; } +/* Hack to keep code using register_bytes working. */ + +int +deprecated_register_bytes (void) +{ + return current_regcache->descr->sizeof_raw_registers; +} + /* Return the contents of register REGNUM as an unsigned integer. */ ULONGEST diff --git a/gdb/regcache.h b/gdb/regcache.h index 9653dd92e45..ed9c9907fde 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -113,6 +113,10 @@ extern void regcache_raw_collect (const struct regcache *regcache, extern int register_offset_hack (struct gdbarch *gdbarch, int regnum); +/* Similar. The total number of bytes occupied by a regcache. */ + +extern int deprecated_register_bytes (void ); + /* The type of a register. This function is slightly more efficient then its gdbarch vector counterpart since it returns a precomputed diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c index 967ad3ef3f9..7f16c74666a 100644 --- a/gdb/remote-sds.c +++ b/gdb/remote-sds.c @@ -456,10 +456,10 @@ sds_fetch_registers (int regno) { unsigned char buf[PBUFSIZ]; int i, retlen; - char *regs = alloca (DEPRECATED_REGISTER_BYTES); + char *regs = alloca (deprecated_register_bytes ()); /* Unimplemented registers read as all bits zero. */ - memset (regs, 0, DEPRECATED_REGISTER_BYTES); + memset (regs, 0, deprecated_register_bytes ()); buf[0] = 18; buf[1] = 1; @@ -493,7 +493,7 @@ static void sds_prepare_to_store (void) { /* Make sure the entire registers array is valid. */ - deprecated_read_register_bytes (0, (char *) NULL, DEPRECATED_REGISTER_BYTES); + deprecated_read_register_bytes (0, (char *) NULL, deprecated_register_bytes ()); } /* Store register REGNO, or all registers if REGNO == -1, from the contents diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index a121bedc5cd..7f4ed0f3a17 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -466,7 +466,7 @@ static void vx_prepare_to_store (void) { /* Fetch all registers, if any of them are not yet fetched. */ - deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES); + deprecated_read_register_bytes (0, NULL, deprecated_register_bytes ()); } /* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR diff --git a/gdb/remote.c b/gdb/remote.c index 95b0bde567a..30ae26dce96 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -250,8 +250,8 @@ init_remote_state (struct gdbarch *gdbarch) int regnum; struct remote_state *rs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct remote_state); - if (DEPRECATED_REGISTER_BYTES != 0) - rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; + if (deprecated_register_bytes () != 0) + rs->sizeof_g_packet = deprecated_register_bytes (); else rs->sizeof_g_packet = 0; @@ -268,7 +268,7 @@ init_remote_state (struct gdbarch *gdbarch) /* ...name = REGISTER_NAME (regnum); */ /* Compute packet size by accumulating the size of all registers. */ - if (DEPRECATED_REGISTER_BYTES == 0) + if (deprecated_register_bytes () == 0) rs->sizeof_g_packet += register_size (current_gdbarch, regnum); } diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index a7532133463..97a46817943 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -2850,9 +2850,6 @@ sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* The number of real registers is the same whether we are in ISA16(compact) or ISA32(media). */ set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS); - set_gdbarch_deprecated_register_bytes (gdbarch, - ((SIM_SH64_NR_FP_REGS + 1) * 4) - + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8); set_gdbarch_register_name (gdbarch, sh64_register_name); set_gdbarch_register_type (gdbarch, sh64_register_type); diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index a06d75d31ef..79dbafce5dd 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1191,7 +1191,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM); set_gdbarch_register_name (gdbarch, v850_register_name); set_gdbarch_deprecated_register_size (gdbarch, v850_reg_size); - set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE); set_gdbarch_deprecated_register_byte (gdbarch, v850_register_byte); set_gdbarch_deprecated_register_raw_size (current_gdbarch, gdbarch, v850_register_raw_size); set_gdbarch_deprecated_register_virtual_size (gdbarch, v850_register_raw_size); diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index eb965fdaa8f..771a48e0248 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -1127,7 +1127,6 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM); set_gdbarch_register_name (gdbarch, xstormy16_register_name); set_gdbarch_deprecated_register_size (gdbarch, xstormy16_reg_size); - set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE); set_gdbarch_deprecated_register_byte (gdbarch, xstormy16_register_byte); set_gdbarch_deprecated_register_raw_size (gdbarch, xstormy16_register_raw_size); set_gdbarch_deprecated_register_virtual_size (gdbarch, xstormy16_register_raw_size);