aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog52
-rw-r--r--gdb/ax-gdb.c3
-rw-r--r--gdb/dwarf2-frame.c3
-rw-r--r--gdb/eval.c3
-rw-r--r--gdb/findvar.c9
-rw-r--r--gdb/frame.c2
-rw-r--r--gdb/gdbarch-selftests.c3
-rw-r--r--gdb/gdbarch.h8
-rwxr-xr-xgdb/gdbarch.sh8
-rw-r--r--gdb/h8300-tdep.c3
-rw-r--r--gdb/i386-tdep.c4
-rw-r--r--gdb/infcmd.c19
-rw-r--r--gdb/m68hc11-tdep.c5
-rw-r--r--gdb/mdebugread.c8
-rw-r--r--gdb/mi/mi-main.c10
-rw-r--r--gdb/mips-tdep.c9
-rw-r--r--gdb/nds32-tdep.c2
-rw-r--r--gdb/regcache.c21
-rw-r--r--gdb/rs6000-tdep.c7
-rw-r--r--gdb/stabsread.c8
-rw-r--r--gdb/stack.c3
-rw-r--r--gdb/target-descriptions.c3
-rw-r--r--gdb/trad-frame.c2
-rw-r--r--gdb/tui/tui-regs.c10
-rw-r--r--gdb/user-regs.c14
-rw-r--r--gdb/xtensa-tdep.c22
26 files changed, 122 insertions, 119 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 190d760..0e9b0a1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,55 @@
+2018-10-21 Simon Marchi <simon.marchi@ericsson.com>
+
+ * gdbarch.sh (gdbarch_num_cooked_regs): New.
+ * gdbarch.h: Re-generate.
+ * ax-gdb.c (gen_expr): Use gdbarch_num_cooked_regs.
+ * dwarf2-frame.c (dwarf2_frame_cache): Likewise.
+ * eval.c (evaluate_subexp_standard): Likewise.
+ * findvar.c (value_of_register): Likewise.
+ (value_of_register_lazy): Likewise.
+ (address_from_register): Likewise.
+ * frame.c (get_frame_register_bytes): Likewise.
+ * gdbarch-selftests.c (register_to_value_test): Likewise.
+ * h8300-tdep.c (h8300_register_type): Likewise.
+ * i386-tdep.c (i386_dbx_reg_to_regnum): Likewise.
+ (i386_svr4_reg_to_regnum): Likewise.
+ * infcmd.c (default_print_registers_info): Likewise.
+ (registers_info): Likewise.
+ (print_vector_info): Likewise.
+ (default_print_float_info): Likewise.
+ * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise.
+ * mdebugread.c (mdebug_reg_to_regnum): Likewise.
+ * mi/mi-main.c (mi_cmd_data_list_register_names): Likewise.
+ (mi_cmd_data_list_changed_registers): Likewise.
+ (mi_cmd_data_list_register_values): Likewise.
+ (mi_cmd_data_write_register_values): Likewise.
+ (mi_cmd_trace_frame_collected): Likewise.
+ * mips-tdep.c (print_gp_register_row): Likewise.
+ (mips_print_registers_info): Likewise.
+ * nds32-tdep.c (nds32_gdbarch_init): Likewise.
+ * regcache.c (init_regcache_descr): Likewise.
+ (register_size): Likewise.
+ (register_dump::dump): Likewise.
+ (cooked_read_test): Likewise.
+ (cooked_write_test): Likewise.
+ * rs6000-tdep.c (rs6000_register_sim_regno): Likewise.
+ (rs6000_gdbarch_init): Likewise.
+ * stabsread.c (stab_reg_to_regnum): Likewise.
+ * stack.c (info_frame_command): Likewise.
+ * target-descriptions.c (tdesc_register_name): Likewise.
+ * trad-frame.c (trad_frame_alloc_saved_regs): Likewise.
+ * tui/tui-regs.c (tui_show_register_group): Likewise.
+ * user-regs.c (user_reg_map_name_to_regnum): Likewise.
+ (user_reg_map_regnum_to_name): Likewise.
+ (value_of_user_reg): Likewise.
+ (maintenance_print_user_registers): Likewise.
+ * xtensa-tdep.c (xtensa_find_register_by_name): Likewise.
+ (xtensa_register_name): Likewise.
+ (xtensa_register_type): Likewise.
+ (xtensa_reg_to_regnum): Likewise.
+ (xtensa_pseudo_register_read): Likewise.
+ (xtensa_pseudo_register_write): Likewise.
+
2018-10-21 Simon Marchi <simon.marchi@polymtl.ca>
* amd64-tdep.c (amd64_pseudo_register_read_value): Use
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 9abd939..ef053f7 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -2036,8 +2036,7 @@ gen_expr (struct expression *exp, union exp_element **pc,
internal_error (__FILE__, __LINE__,
_("Register $%s not available"), name);
/* No support for tracing user registers yet. */
- if (reg >= gdbarch_num_regs (ax->gdbarch)
- + gdbarch_num_pseudo_regs (ax->gdbarch))
+ if (reg >= gdbarch_num_cooked_regs (ax->gdbarch))
error (_("'%s' is a user-register; "
"GDB cannot yet trace user-register contents."),
name);
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 2d61167..2201c63 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -972,8 +972,7 @@ static struct dwarf2_frame_cache *
dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
- const int num_regs = gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
+ const int num_regs = gdbarch_num_cooked_regs (gdbarch);
struct dwarf2_frame_cache *cache;
struct dwarf2_fde *fde;
CORE_ADDR entry_pc;
diff --git a/gdb/eval.c b/gdb/eval.c
index 5ee5990..047aba5 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1395,8 +1395,7 @@ evaluate_subexp_standard (struct type *expect_type,
So for these registers, we fetch the register value regardless
of the evaluation mode. */
if (noside == EVAL_AVOID_SIDE_EFFECTS
- && regno < gdbarch_num_regs (exp->gdbarch)
- + gdbarch_num_pseudo_regs (exp->gdbarch))
+ && regno < gdbarch_num_cooked_regs (exp->gdbarch))
val = value_zero (register_type (exp->gdbarch, regno), not_lval);
else
val = value_of_register (regno, get_selected_frame (NULL));
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 41ffedd..3169348 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -267,8 +267,7 @@ value_of_register (int regnum, struct frame_info *frame)
/* User registers lie completely outside of the range of normal
registers. Catch them early so that the target never sees them. */
- if (regnum >= gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch))
+ if (regnum >= gdbarch_num_cooked_regs (gdbarch))
return value_of_user_reg (regnum, frame);
reg_val = value_of_register_lazy (frame, regnum);
@@ -287,8 +286,7 @@ value_of_register_lazy (struct frame_info *frame, int regnum)
struct value *reg_val;
struct frame_info *next_frame;
- gdb_assert (regnum < (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch)));
+ gdb_assert (regnum < gdbarch_num_cooked_regs (gdbarch));
gdb_assert (frame != NULL);
@@ -957,8 +955,7 @@ address_from_register (int regnum, struct frame_info *frame)
struct type *type = builtin_type (gdbarch)->builtin_data_ptr;
struct value *value;
CORE_ADDR result;
- int regnum_max_excl = (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch));
+ int regnum_max_excl = gdbarch_num_cooked_regs (gdbarch);
if (regnum < 0 || regnum >= regnum_max_excl)
error (_("Invalid register #%d, expecting 0 <= # < %d"), regnum,
diff --git a/gdb/frame.c b/gdb/frame.c
index 0dc2cb7..4624ead 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1416,7 +1416,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
/* Ensure that we will not read beyond the end of the register file.
This can only ever happen if the debug information is bad. */
maxsize = -offset;
- numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ numregs = gdbarch_num_cooked_regs (gdbarch);
for (i = regnum; i < numregs; i++)
{
int thissize = register_size (gdbarch, i);
diff --git a/gdb/gdbarch-selftests.c b/gdb/gdbarch-selftests.c
index 73a3124..4486056 100644
--- a/gdb/gdbarch-selftests.c
+++ b/gdb/gdbarch-selftests.c
@@ -116,8 +116,7 @@ register_to_value_test (struct gdbarch *gdbarch)
= make_scoped_restore (&inferior_ptid, mock_ptid);
struct frame_info *frame = get_current_frame ();
- const int num_regs = (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch));
+ const int num_regs = gdbarch_num_cooked_regs (gdbarch);
/* Test gdbarch methods register_to_value and value_to_register with
different combinations of register numbers and types. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index fc2f1a8..2cb6961 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1806,4 +1806,12 @@ extern unsigned int gdbarch_debug;
extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
+/* Return the number of cooked registers (raw + pseudo) for ARCH. */
+
+static inline int
+gdbarch_num_cooked_regs (gdbarch *arch)
+{
+ return gdbarch_num_regs (arch) + gdbarch_num_pseudo_regs (arch);
+}
+
#endif
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 670ac30..bbfa8d2 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -1632,6 +1632,14 @@ extern unsigned int gdbarch_debug;
extern void gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file);
+/* Return the number of cooked registers (raw + pseudo) for ARCH. */
+
+static inline int
+gdbarch_num_cooked_regs (gdbarch *arch)
+{
+ return gdbarch_num_regs (arch) + gdbarch_num_pseudo_regs (arch);
+}
+
#endif
EOF
exec 1>&2
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 5a4802c..2334582 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1128,8 +1128,7 @@ h8300_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
static struct type *
h8300_register_type (struct gdbarch *gdbarch, int regno)
{
- if (regno < 0 || regno >= gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch))
+ if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
internal_error (__FILE__, __LINE__,
_("h8300_register_type: illegal register number %d"),
regno);
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index a6994aa..a34a337 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -518,7 +518,7 @@ i386_dbx_reg_to_regnum (struct gdbarch *gdbarch, int reg)
}
/* This will hopefully provoke a warning. */
- return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ return gdbarch_num_cooked_regs (gdbarch);
}
/* Convert SVR4 DWARF register number REG to the appropriate register number
@@ -575,7 +575,7 @@ i386_svr4_reg_to_regnum (struct gdbarch *gdbarch, int reg)
int regnum = i386_svr4_dwarf_reg_to_regnum (gdbarch, reg);
if (regnum == -1)
- return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ return gdbarch_num_cooked_regs (gdbarch);
return regnum;
}
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index da0cb34..27177a4 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2387,8 +2387,7 @@ default_print_registers_info (struct gdbarch *gdbarch,
int regnum, int print_all)
{
int i;
- const int numregs = gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
+ const int numregs = gdbarch_num_cooked_regs (gdbarch);
for (i = 0; i < numregs; i++)
{
@@ -2475,8 +2474,7 @@ registers_info (const char *addr_exp, int fpregs)
/* User registers lie completely outside of the range of
normal registers. Catch them early so that the target
never sees them. */
- if (regnum >= gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch))
+ if (regnum >= gdbarch_num_cooked_regs (gdbarch))
{
struct value *regval = value_of_user_reg (regnum, frame);
const char *regname = user_reg_map_regnum_to_name (gdbarch,
@@ -2515,8 +2513,7 @@ registers_info (const char *addr_exp, int fpregs)
int regnum;
for (regnum = 0;
- regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
+ regnum < gdbarch_num_cooked_regs (gdbarch);
regnum++)
{
if (gdbarch_register_reggroup_p (gdbarch, regnum, group))
@@ -2558,10 +2555,7 @@ print_vector_info (struct ui_file *file,
int regnum;
int printed_something = 0;
- for (regnum = 0;
- regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
- regnum++)
+ for (regnum = 0; regnum < gdbarch_num_cooked_regs (gdbarch); regnum++)
{
if (gdbarch_register_reggroup_p (gdbarch, regnum, vector_reggroup))
{
@@ -3110,10 +3104,7 @@ default_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
int regnum;
int printed_something = 0;
- for (regnum = 0;
- regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
- regnum++)
+ for (regnum = 0; regnum < gdbarch_num_cooked_regs (gdbarch); regnum++)
{
if (gdbarch_register_reggroup_p (gdbarch, regnum, float_reggroup))
{
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 1490ee2..b6e8f00 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -854,10 +854,7 @@ m68hc11_frame_unwind_cache (struct frame_info *this_frame,
/* Adjust all the saved registers so that they contain addresses and not
offsets. */
- for (i = 0;
- i < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch) - 1;
- i++)
+ for (i = 0; i < gdbarch_num_cooked_regs (gdbarch); i++)
if (trad_frame_addr_p (info->saved_regs, i))
{
info->saved_regs[i].addr += this_base;
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 62de80e..26687f6 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -537,13 +537,9 @@ mdebug_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
{
int regno = gdbarch_ecoff_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
- if (regno < 0
- || regno >= (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch)))
+ if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
{
- reg_value_complaint (regno,
- gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch),
+ reg_value_complaint (regno, gdbarch_num_cooked_regs (gdbarch),
SYMBOL_PRINT_NAME (sym));
regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index f6fbebc..5562935 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -890,7 +890,7 @@ mi_cmd_data_list_register_names (const char *command, char **argv, int argc)
debugged. */
gdbarch = get_current_arch ();
- numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ numregs = gdbarch_num_cooked_regs (gdbarch);
ui_out_emit_list list_emitter (uiout, "register-names");
@@ -949,7 +949,7 @@ mi_cmd_data_list_changed_registers (const char *command, char **argv, int argc)
debugged. */
gdbarch = this_regs->arch ();
- numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ numregs = gdbarch_num_cooked_regs (gdbarch);
ui_out_emit_list list_emitter (uiout, "changed-registers");
@@ -1076,7 +1076,7 @@ mi_cmd_data_list_register_values (const char *command, char **argv, int argc)
frame = get_selected_frame (NULL);
gdbarch = get_frame_arch (frame);
- numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ numregs = gdbarch_num_cooked_regs (gdbarch);
ui_out_emit_list list_emitter (uiout, "register-values");
@@ -1164,7 +1164,7 @@ mi_cmd_data_write_register_values (const char *command, char **argv, int argc)
regcache = get_current_regcache ();
gdbarch = regcache->arch ();
- numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ numregs = gdbarch_num_cooked_regs (gdbarch);
if (argc == 0)
error (_("-data-write-register-values: Usage: -data-write-register-"
@@ -2638,7 +2638,7 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc)
frame = get_selected_frame (NULL);
gdbarch = get_frame_arch (frame);
- numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ numregs = gdbarch_num_cooked_regs (gdbarch);
for (regnum = 0; regnum < numregs; regnum++)
{
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index bf44c52..2c87262 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -6497,8 +6497,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
/* For GP registers, we print a separate row of names above the vals. */
for (col = 0, regnum = start_regnum;
- col < ncols && regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
+ col < ncols && regnum < gdbarch_num_cooked_regs (gdbarch);
regnum++)
{
if (*gdbarch_register_name (gdbarch, regnum) == '\0')
@@ -6536,8 +6535,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
/* Now print the values in hex, 4 or 8 to the row. */
for (col = 0, regnum = start_regnum;
- col < ncols && regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
+ col < ncols && regnum < gdbarch_num_cooked_regs (gdbarch);
regnum++)
{
if (*gdbarch_register_name (gdbarch, regnum) == '\0')
@@ -6603,8 +6601,7 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
/* Do all (or most) registers. */
{
regnum = gdbarch_num_regs (gdbarch);
- while (regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch))
+ while (regnum < gdbarch_num_cooked_regs (gdbarch))
{
if (mips_float_register_p (gdbarch, regnum))
{
diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
index b616cc9..05b82de 100644
--- a/gdb/nds32-tdep.c
+++ b/gdb/nds32-tdep.c
@@ -2099,7 +2099,7 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Add NDS32 register aliases. To avoid search in user register name space,
user_reg_map_name_to_regnum is not used. */
- maxregs = (gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch));
+ maxregs = gdbarch_num_cooked_regs (gdbarch);
for (i = 0; i < ARRAY_SIZE (nds32_register_aliases); i++)
{
int regnum, j;
diff --git a/gdb/regcache.c b/gdb/regcache.c
index b2f9b05..38ad7ba 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -86,8 +86,7 @@ init_regcache_descr (struct gdbarch *gdbarch)
/* Total size of the register space. The raw registers are mapped
directly onto the raw register cache while the pseudo's are
either mapped onto raw-registers or memory. */
- descr->nr_cooked_registers = gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
+ descr->nr_cooked_registers = gdbarch_num_cooked_regs (gdbarch);
/* Fill in a table of register types. */
descr->register_type
@@ -163,9 +162,7 @@ register_size (struct gdbarch *gdbarch, int regnum)
struct regcache_descr *descr = regcache_descr (gdbarch);
int size;
- gdb_assert (regnum >= 0
- && regnum < (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch)));
+ gdb_assert (regnum >= 0 && regnum < gdbarch_num_cooked_regs (gdbarch));
size = descr->sizeof_register[regnum];
return size;
}
@@ -1311,8 +1308,7 @@ register_dump::dump (ui_file *file)
long register_offset = 0;
gdb_assert (descr->nr_cooked_registers
- == (gdbarch_num_regs (m_gdbarch)
- + gdbarch_num_pseudo_regs (m_gdbarch)));
+ == gdbarch_num_cooked_regs (m_gdbarch));
for (regnum = -1; regnum < descr->nr_cooked_registers; regnum++)
{
@@ -1637,9 +1633,7 @@ cooked_read_test (struct gdbarch *gdbarch)
mock_target.reset ();
/* Then, read all raw and pseudo registers, and don't expect calling
to_{fetch,store}_registers. */
- for (int regnum = 0;
- regnum < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
- regnum++)
+ for (int regnum = 0; regnum < gdbarch_num_cooked_regs (gdbarch); regnum++)
{
if (register_size (gdbarch, regnum) == 0)
continue;
@@ -1665,9 +1659,7 @@ cooked_read_test (struct gdbarch *gdbarch)
readonly regcache. */
mock_target.reset ();
- for (int regnum = 0;
- regnum < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
- regnum++)
+ for (int regnum = 0; regnum < gdbarch_num_cooked_regs (gdbarch); regnum++)
{
if (register_size (gdbarch, regnum) == 0)
continue;
@@ -1762,8 +1754,7 @@ cooked_write_test (struct gdbarch *gdbarch)
readwrite_regcache readwrite (gdbarch);
- const int num_regs = (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch));
+ const int num_regs = gdbarch_num_cooked_regs (gdbarch);
for (auto regnum = 0; regnum < num_regs; regnum++)
{
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index ce01be5..80d8504 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -357,9 +357,7 @@ rs6000_register_sim_regno (struct gdbarch *gdbarch, int reg)
if (tdep->sim_regno == NULL)
init_sim_regno_table (gdbarch);
- gdb_assert (0 <= reg
- && reg <= gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch));
+ gdb_assert (0 <= reg && reg <= gdbarch_num_cooked_regs (gdbarch));
sim_regno = tdep->sim_regno[reg];
if (sim_regno >= 0)
@@ -6475,8 +6473,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
cur_reg += 32;
}
- gdb_assert (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch) == cur_reg);
+ gdb_assert (gdbarch_num_cooked_regs (gdbarch) == cur_reg);
/* Register the ravenscar_arch_ops. */
if (mach == bfd_mach_ppc_e500)
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 368293d..d355e54 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -616,13 +616,9 @@ stab_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
{
int regno = gdbarch_stab_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
- if (regno < 0
- || regno >= (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch)))
+ if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
{
- reg_value_complaint (regno,
- gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch),
+ reg_value_complaint (regno, gdbarch_num_cooked_regs (gdbarch),
SYMBOL_PRINT_NAME (sym));
regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */
diff --git a/gdb/stack.c b/gdb/stack.c
index 9b0e740..87b493f 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1553,8 +1553,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
}
count = 0;
- numregs = gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
+ numregs = gdbarch_num_cooked_regs (gdbarch);
for (i = 0; i < numregs; i++)
if (i != sp_regnum
&& gdbarch_register_reggroup_p (gdbarch, i, all_reggroup))
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 087de14..bdd29c0 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -854,12 +854,11 @@ tdesc_register_name (struct gdbarch *gdbarch, int regno)
{
struct tdesc_reg *reg = tdesc_find_register (gdbarch, regno);
int num_regs = gdbarch_num_regs (gdbarch);
- int num_pseudo_regs = gdbarch_num_pseudo_regs (gdbarch);
if (reg != NULL)
return reg->name.c_str ();
- if (regno >= num_regs && regno < num_regs + num_pseudo_regs)
+ if (regno >= num_regs && regno < gdbarch_num_cooked_regs (gdbarch))
{
struct tdesc_arch_data *data
= (struct tdesc_arch_data *) gdbarch_data (gdbarch, tdesc_data);
diff --git a/gdb/trad-frame.c b/gdb/trad-frame.c
index a3484d2..cced08a 100644
--- a/gdb/trad-frame.c
+++ b/gdb/trad-frame.c
@@ -48,7 +48,7 @@ struct trad_frame_saved_reg *
trad_frame_alloc_saved_regs (struct gdbarch *gdbarch)
{
int regnum;
- int numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ int numregs = gdbarch_num_cooked_regs (gdbarch);
struct trad_frame_saved_reg *this_saved_regs
= FRAME_OBSTACK_CALLOC (numregs, struct trad_frame_saved_reg);
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 12382cd..57a9000 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -206,10 +206,7 @@ tui_show_register_group (struct reggroup *group,
/* See how many registers must be displayed. */
nr_regs = 0;
- for (regnum = 0;
- regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
- regnum++)
+ for (regnum = 0; regnum < gdbarch_num_cooked_regs (gdbarch); regnum++)
{
const char *name;
@@ -253,10 +250,7 @@ tui_show_register_group (struct reggroup *group,
/* Now set the register names and values. */
pos = 0;
- for (regnum = 0;
- regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
- regnum++)
+ for (regnum = 0; regnum < gdbarch_num_cooked_regs (gdbarch); regnum++)
{
struct tui_gen_win_info *data_item_win;
struct tui_data_element *data;
diff --git a/gdb/user-regs.c b/gdb/user-regs.c
index 4dd67a6..c9e8c0d 100644
--- a/gdb/user-regs.c
+++ b/gdb/user-regs.c
@@ -138,8 +138,7 @@ user_reg_map_name_to_regnum (struct gdbarch *gdbarch, const char *name,
specific register override the user registers. */
{
int i;
- int maxregs = (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch));
+ int maxregs = gdbarch_num_cooked_regs (gdbarch);
for (i = 0; i < maxregs; i++)
{
@@ -165,8 +164,7 @@ user_reg_map_name_to_regnum (struct gdbarch *gdbarch, const char *name,
if ((len < 0 && strcmp (reg->name, name))
|| (len == strlen (reg->name)
&& strncmp (reg->name, name, len) == 0))
- return gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch) + nr;
+ return gdbarch_num_cooked_regs (gdbarch) + nr;
}
}
@@ -192,8 +190,7 @@ usernum_to_user_reg (struct gdbarch *gdbarch, int usernum)
const char *
user_reg_map_regnum_to_name (struct gdbarch *gdbarch, int regnum)
{
- int maxregs = (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch));
+ int maxregs = gdbarch_num_cooked_regs (gdbarch);
if (regnum < 0)
return NULL;
@@ -213,8 +210,7 @@ struct value *
value_of_user_reg (int regnum, struct frame_info *frame)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
- int maxregs = (gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch));
+ int maxregs = gdbarch_num_cooked_regs (gdbarch);
struct user_reg *reg = usernum_to_user_reg (gdbarch, regnum - maxregs);
gdb_assert (reg != NULL);
@@ -230,7 +226,7 @@ maintenance_print_user_registers (const char *args, int from_tty)
int regnum;
regs = (struct gdb_user_regs *) gdbarch_data (gdbarch, user_regs_data);
- regnum = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ regnum = gdbarch_num_cooked_regs (gdbarch);
fprintf_unfiltered (gdb_stdout, " %-11s %3s\n", "Name", "Nr");
for (reg = regs->first; reg != NULL; reg = reg->next, ++regnum)
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index 3b32bcf..4f29557 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -234,9 +234,7 @@ xtensa_find_register_by_name (struct gdbarch *gdbarch, const char *name)
{
int i;
- for (i = 0; i < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
- i++)
+ for (i = 0; i < gdbarch_num_cooked_regs (gdbarch); i++)
if (strcasecmp (gdbarch_tdep (gdbarch)->regmap[i].name, name) == 0)
return i;
@@ -249,8 +247,7 @@ static const char *
xtensa_register_name (struct gdbarch *gdbarch, int regnum)
{
/* Return the name stored in the register map. */
- if (regnum >= 0 && regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch))
+ if (regnum >= 0 && regnum < gdbarch_num_cooked_regs (gdbarch))
return gdbarch_tdep (gdbarch)->regmap[regnum].name;
internal_error (__FILE__, __LINE__, _("invalid register %d"), regnum);
@@ -276,8 +273,7 @@ xtensa_register_type (struct gdbarch *gdbarch, int regnum)
return builtin_type (gdbarch)->builtin_data_ptr;
/* Return the stored type for all other registers. */
- else if (regnum >= 0 && regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch))
+ else if (regnum >= 0 && regnum < gdbarch_num_cooked_regs (gdbarch))
{
xtensa_register_t* reg = &tdep->regmap[regnum];
@@ -352,9 +348,7 @@ xtensa_reg_to_regnum (struct gdbarch *gdbarch, int regnum)
if (regnum >= 0 && regnum < 16)
return gdbarch_tdep (gdbarch)->a0_base + regnum;
- for (i = 0;
- i < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
- i++)
+ for (i = 0; i < gdbarch_num_cooked_regs (gdbarch); i++)
if (regnum == gdbarch_tdep (gdbarch)->regmap[i].target_number)
return i;
@@ -585,9 +579,7 @@ xtensa_pseudo_register_read (struct gdbarch *gdbarch,
return REG_VALID;
}
/* Pseudo registers. */
- else if (regnum >= 0
- && regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch))
+ else if (regnum >= 0 && regnum < gdbarch_num_cooked_regs (gdbarch))
{
xtensa_register_t *reg = &gdbarch_tdep (gdbarch)->regmap[regnum];
xtensa_register_type_t type = reg->type;
@@ -670,9 +662,7 @@ xtensa_pseudo_register_write (struct gdbarch *gdbarch,
return;
}
/* Pseudo registers. */
- else if (regnum >= 0
- && regnum < gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch))
+ else if (regnum >= 0 && regnum < gdbarch_num_cooked_regs (gdbarch))
{
xtensa_register_t *reg = &gdbarch_tdep (gdbarch)->regmap[regnum];
xtensa_register_type_t type = reg->type;