aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 78e5c48..6921f64 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -164,6 +164,8 @@ struct gdbarch
gdbarch_pseudo_register_write_ftype *pseudo_register_write;
int num_regs;
int num_pseudo_regs;
+ gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect;
+ gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack;
int sp_regnum;
int pc_regnum;
int ps_regnum;
@@ -314,6 +316,8 @@ struct gdbarch startup_gdbarch =
0, /* pseudo_register_write */
0, /* num_regs */
0, /* num_pseudo_regs */
+ 0, /* ax_pseudo_register_collect */
+ 0, /* ax_pseudo_register_push_stack */
-1, /* sp_regnum */
-1, /* pc_regnum */
-1, /* ps_regnum */
@@ -594,6 +598,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
if (gdbarch->num_regs == -1)
fprintf_unfiltered (log, "\n\tnum_regs");
/* Skip verify of num_pseudo_regs, invalid_p == 0 */
+ /* Skip verify of ax_pseudo_register_collect, has predicate */
+ /* Skip verify of ax_pseudo_register_push_stack, has predicate */
/* Skip verify of sp_regnum, invalid_p == 0 */
/* Skip verify of pc_regnum, invalid_p == 0 */
/* Skip verify of ps_regnum, invalid_p == 0 */
@@ -761,6 +767,18 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: auto_wide_charset = <%s>\n",
host_address_to_string (gdbarch->auto_wide_charset));
fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_ax_pseudo_register_collect_p() = %d\n",
+ gdbarch_ax_pseudo_register_collect_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ax_pseudo_register_collect = <%s>\n",
+ host_address_to_string (gdbarch->ax_pseudo_register_collect));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_ax_pseudo_register_push_stack_p() = %d\n",
+ gdbarch_ax_pseudo_register_push_stack_p (gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ax_pseudo_register_push_stack = <%s>\n",
+ host_address_to_string (gdbarch->ax_pseudo_register_push_stack));
+ fprintf_unfiltered (file,
"gdbarch_dump: believe_pcc_promotion = %s\n",
plongest (gdbarch->believe_pcc_promotion));
fprintf_unfiltered (file,
@@ -1741,6 +1759,54 @@ set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
}
int
+gdbarch_ax_pseudo_register_collect_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->ax_pseudo_register_collect != NULL;
+}
+
+int
+gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->ax_pseudo_register_collect != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_collect called\n");
+ return gdbarch->ax_pseudo_register_collect (gdbarch, ax, reg);
+}
+
+void
+set_gdbarch_ax_pseudo_register_collect (struct gdbarch *gdbarch,
+ gdbarch_ax_pseudo_register_collect_ftype ax_pseudo_register_collect)
+{
+ gdbarch->ax_pseudo_register_collect = ax_pseudo_register_collect;
+}
+
+int
+gdbarch_ax_pseudo_register_push_stack_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->ax_pseudo_register_push_stack != NULL;
+}
+
+int
+gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->ax_pseudo_register_push_stack != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_ax_pseudo_register_push_stack called\n");
+ return gdbarch->ax_pseudo_register_push_stack (gdbarch, ax, reg);
+}
+
+void
+set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
+ gdbarch_ax_pseudo_register_push_stack_ftype ax_pseudo_register_push_stack)
+{
+ gdbarch->ax_pseudo_register_push_stack = ax_pseudo_register_push_stack;
+}
+
+int
gdbarch_sp_regnum (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);