From: Andrew Cagney Date: Tue, 13 Mar 2001 23:31:14 +0000 (+0000) Subject: Eliminate ARCH_NUM_REGS. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a728f04251098dd0e74a2aea1e4d8e841e7fb404;p=binutils-gdb.git Eliminate ARCH_NUM_REGS. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 224fc5d6a8f..f9de7cf7486 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,21 @@ +2001-03-08 Andrew Cagney + + * inferior.h (ARCH_NUM_REGS): Delete definition. + * stack.c (frame_info): Use NUM_REGS, not ARCH_NUM_REGS. + * regcache.c (registers_changed): Ditto. + (registers_fetched): Ditto. + * infptrace.c (fetch_inferior_registers): Ditto. + (store_inferior_registers): Ditto. + * infcmd.c (do_registers_info): Ditto. + (registers_info): Ditto. + * i386-linux-nat.c (old_fetch_inferior_registers): Ditto. + (old_store_inferior_registers): Ditto. + * gdbserver/low-linux.c (register_addr): Ditto. + * gdbserver/low-hppabsd.c (register_addr): Ditto. + * core-aout.c: Don't include "inferior.h". + (fetch_core_registers): Use NUM_REGS not ARCH_NUM_REGS. + (register_addr): Ditto. + 2001-03-13 Fernando Nasser From Steven Johnson diff --git a/gdb/core-aout.c b/gdb/core-aout.c index 4ef64ea2168..0329302dc1e 100644 --- a/gdb/core-aout.c +++ b/gdb/core-aout.c @@ -38,7 +38,6 @@ #include #include "gdbcore.h" #include "value.h" /* For supply_register. */ -#include "inferior.h" /* For ARCH_NUM_REGS. */ #include "regcache.h" /* These are needed on various systems to expand REGISTER_U_ADDR. */ @@ -82,7 +81,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, CORE_ADDR addr; int bad_reg = -1; CORE_ADDR reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */ - int numregs = ARCH_NUM_REGS; + int numregs = NUM_REGS; /* If u.u_ar0 was an absolute address in the core file, relativize it now, so we can use it as an offset into core_reg_sect. When we're done, @@ -118,7 +117,7 @@ register_addr (int regno, CORE_ADDR blockend) { CORE_ADDR addr; - if (regno < 0 || regno >= ARCH_NUM_REGS) + if (regno < 0 || regno >= NUM_REGS) error ("Invalid register number %d.", regno); REGISTER_U_ADDR (addr, blockend, regno); diff --git a/gdb/gdbserver/low-hppabsd.c b/gdb/gdbserver/low-hppabsd.c index ae91592b66e..c4bc025242b 100644 --- a/gdb/gdbserver/low-hppabsd.c +++ b/gdb/gdbserver/low-hppabsd.c @@ -150,7 +150,7 @@ register_addr (int regno, CORE_ADDR blockend) { CORE_ADDR addr; - if (regno < 0 || regno >= ARCH_NUM_REGS) + if (regno < 0 || regno >= NUM_REGS) error ("Invalid register number %d.", regno); REGISTER_U_ADDR (addr, blockend, regno); diff --git a/gdb/gdbserver/low-linux.c b/gdb/gdbserver/low-linux.c index 56fe12f9599..eb5512881f2 100644 --- a/gdb/gdbserver/low-linux.c +++ b/gdb/gdbserver/low-linux.c @@ -541,7 +541,7 @@ register_addr (int regno, CORE_ADDR blockend) { CORE_ADDR addr; - if (regno < 0 || regno >= ARCH_NUM_REGS) + if (regno < 0 || regno >= NUM_REGS) error ("Invalid register number %d.", regno); REGISTER_U_ADDR (addr, blockend, regno); diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 47e78708a24..62fe3d4191b 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -192,7 +192,7 @@ old_fetch_inferior_registers (int regno) } else { - for (regno = 0; regno < ARCH_NUM_REGS; regno++) + for (regno = 0; regno < NUM_REGS; regno++) { fetch_register (regno); } @@ -254,7 +254,7 @@ old_store_inferior_registers (int regno) } else { - for (regno = 0; regno < ARCH_NUM_REGS; regno++) + for (regno = 0; regno < NUM_REGS; regno++) { store_register (regno); } diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 1a954837104..96a0fdd0de5 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1467,7 +1467,7 @@ void do_registers_info (int regnum, int fpregs) { register int i; - int numregs = ARCH_NUM_REGS; + int numregs = NUM_REGS; for (i = 0; i < numregs; i++) { @@ -1591,7 +1591,7 @@ registers_info (char *addr_exp, int fpregs) end = addr_exp; while (*end != '\0' && *end != ' ' && *end != '\t') ++end; - numregs = ARCH_NUM_REGS; + numregs = NUM_REGS; regnum = target_map_name_to_register (addr_exp, end - addr_exp); if (regnum >= 0) diff --git a/gdb/inferior.h b/gdb/inferior.h index 1523f41069f..5db89ee2871 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -51,15 +51,6 @@ extern void write_inferior_status_register (struct inferior_status *inf_status, int regno, LONGEST val); -/* This macro gives the number of registers actually in use by the - inferior. This may be less than the total number of registers, - perhaps depending on the actual CPU in use or program being run. - FIXME: This could be replaced by the new MULTI_ARCH capability. */ - -#ifndef ARCH_NUM_REGS -#define ARCH_NUM_REGS NUM_REGS -#endif - extern void set_sigint_trap (void); extern void clear_sigint_trap (void); diff --git a/gdb/infptrace.c b/gdb/infptrace.c index 0393c042005..0a3e34db152 100644 --- a/gdb/infptrace.c +++ b/gdb/infptrace.c @@ -423,7 +423,7 @@ fetch_inferior_registers (int regno) } else { - for (regno = 0; regno < ARCH_NUM_REGS; regno++) + for (regno = 0; regno < NUM_REGS; regno++) { fetch_register (regno); } @@ -487,7 +487,7 @@ store_inferior_registers (int regno) } else { - for (regno = 0; regno < ARCH_NUM_REGS; regno++) + for (regno = 0; regno < NUM_REGS; regno++) { store_register (regno); } diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index b1e8c28c82d..6567642ad4f 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,11 @@ +2001-03-08 Andrew Cagney + + * mi-main.c (mi_cmd_data_list_register_names): Use NUM_REGS, not + ARCH_NUM_REGS. + (mi_cmd_data_list_changed_registers): Ditto. + (mi_cmd_data_list_register_values): Ditto. + (mi_cmd_data_write_register_values): Ditto. + 2001-03-06 Kevin Buettner * gdbmi.texinfo, mi-cmd-disas.c, mi-cmd-stack.c, mi-cmd-var.c, diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 5851d710289..a7c23c0cd13 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -271,7 +271,7 @@ mi_cmd_data_list_register_names (char *command, char **argv, int argc) case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. */ - numregs = ARCH_NUM_REGS; + numregs = NUM_REGS; ui_out_list_begin (uiout, "register-names"); @@ -321,7 +321,7 @@ mi_cmd_data_list_changed_registers (char *command, char **argv, int argc) case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. */ - numregs = ARCH_NUM_REGS; + numregs = NUM_REGS; ui_out_list_begin (uiout, "changed-registers"); @@ -415,7 +415,7 @@ mi_cmd_data_list_register_values (char *command, char **argv, int argc) case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. */ - numregs = ARCH_NUM_REGS; + numregs = NUM_REGS; if (argc == 0) { @@ -562,7 +562,7 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc) case, some entries of REGISTER_NAME will change depending upon the particular processor being debugged. */ - numregs = ARCH_NUM_REGS; + numregs = NUM_REGS; if (argc == 0) { diff --git a/gdb/regcache.c b/gdb/regcache.c index d853218fb6c..7b462dedcc9 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -163,7 +163,7 @@ registers_changed (void) gdb gives control to the user (ie watchpoints). */ alloca (0); - for (i = 0; i < ARCH_NUM_REGS; i++) + for (i = 0; i < NUM_REGS; i++) set_register_cached (i, 0); /* Assume that if all the hardware regs have changed, @@ -185,7 +185,7 @@ registers_fetched (void) { int i; - for (i = 0; i < ARCH_NUM_REGS; i++) + for (i = 0; i < NUM_REGS; i++) set_register_cached (i, 1); /* Do not assume that the pseudo-regs have also been fetched. Fetching all real regs might not account for all pseudo-regs. */ diff --git a/gdb/stack.c b/gdb/stack.c index 77b7602225d..ebeb4d6311e 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1001,7 +1001,7 @@ frame_info (char *addr_exp, int from_tty) print_address_numeric (fi->saved_regs[SP_REGNUM], 1, gdb_stdout); printf_filtered ("\n"); count = 0; - numregs = ARCH_NUM_REGS; + numregs = NUM_REGS; for (i = 0; i < numregs; i++) if (fi->saved_regs[i] && i != SP_REGNUM) { diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 0265da75fb5..53623b06137 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,7 @@ +2001-03-08 Andrew Cagney + + * tuiRegs.c: Use NUM_REGS, not ARCH_NUM_REGS. + 2001-03-06 Kevin Buettner * tui-file.h: Update/correct copyright notice. diff --git a/gdb/tui/tuiRegs.c b/gdb/tui/tuiRegs.c index b0f55ef9a46..b3ec49bc5cc 100644 --- a/gdb/tui/tuiRegs.c +++ b/gdb/tui/tuiRegs.c @@ -717,7 +717,7 @@ _tuiSetSpecialRegsContent (refreshValuesOnly) endRegNum = FP0_REGNUM - 1; #if 0 endRegNum = (-1); - for (i = START_SPECIAL_REGS; (i < ARCH_NUM_REGS && endRegNum < 0); i++) + for (i = START_SPECIAL_REGS; (i < NUM_REGS && endRegNum < 0); i++) if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) endRegNum = i - 1; #endif @@ -750,7 +750,7 @@ _tuiSetGeneralAndSpecialRegsContent (refreshValuesOnly) endRegNum = FP0_REGNUM - 1; #if 0 endRegNum = (-1); - for (i = 0; (i < ARCH_NUM_REGS && endRegNum < 0); i++) + for (i = 0; (i < NUM_REGS && endRegNum < 0); i++) if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) endRegNum = i - 1; #endif @@ -781,12 +781,12 @@ _tuiSetFloatRegsContent (dpyType, refreshValuesOnly) startRegNum = FP0_REGNUM; #if 0 startRegNum = (-1); - for (i = ARCH_NUM_REGS - 1; (i >= 0 && startRegNum < 0); i--) + for (i = NUM_REGS - 1; (i >= 0 && startRegNum < 0); i--) if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) != TYPE_CODE_FLT) startRegNum = i + 1; #endif ret = _tuiSetRegsContent (startRegNum, - ARCH_NUM_REGS - 1, + NUM_REGS - 1, selected_frame, dpyType, refreshValuesOnly);