aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 2d4510e..e0953ff 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -145,6 +145,7 @@ struct gdbarch
gdbarch_read_sp_ftype *read_sp;
gdbarch_write_sp_ftype *write_sp;
int num_regs;
+ int num_pseudo_regs;
int sp_regnum;
int fp_regnum;
int pc_regnum;
@@ -292,6 +293,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
generic_get_saved_register,
0,
0,
@@ -479,6 +481,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->num_regs == -1))
internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
+ /* Skip verify of num_pseudo_regs, invalid_p == 0 */
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->sp_regnum == -1))
internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid");
@@ -775,6 +778,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: NUM_REGS # %s\n",
XSTRING (NUM_REGS));
#endif
+#ifdef NUM_PSEUDO_REGS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
+ XSTRING (NUM_PSEUDO_REGS));
+#endif
#ifdef SP_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: SP_REGNUM # %s\n",
@@ -1348,6 +1356,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: NUM_REGS = %ld\n",
(long) NUM_REGS);
#endif
+#ifdef NUM_PSEUDO_REGS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: NUM_PSEUDO_REGS = %ld\n",
+ (long) NUM_PSEUDO_REGS);
+#endif
#ifdef SP_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: SP_REGNUM = %ld\n",
@@ -2169,6 +2182,22 @@ set_gdbarch_num_regs (struct gdbarch *gdbarch,
}
int
+gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
+{
+ /* Skip verify of num_pseudo_regs, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
+ return gdbarch->num_pseudo_regs;
+}
+
+void
+set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
+ int num_pseudo_regs)
+{
+ gdbarch->num_pseudo_regs = num_pseudo_regs;
+}
+
+int
gdbarch_sp_regnum (struct gdbarch *gdbarch)
{
if (gdbarch->sp_regnum == -1)