[PATCH 4/8] gdb/s390: Fill gen_return_address hook.

Marcin Kościelnicki
2016-01-24T12:12:33Z

gdb/ChangeLog:

* s390-linux-tdep.c (s390_gen_return_address): New function.
(s390_gdbarch_init): Fill gen_return_address hook.
---
gdb/ChangeLog | 5 +++++
gdb/s390-linux-tdep.c | 11 +++++++++++
2 files changed, 16 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2cfd088..e0eb258 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2016-01-24 Marcin KoÅ›cielnicki <koriakin@0x04.net>

+ * s390-linux-tdep.c (s390_gen_return_address): New function.
+ (s390_gdbarch_init): Fill gen_return_address hook.
+
+2016-01-24 Marcin KoÅ›cielnicki <koriakin@0x04.net>
+
* s390-linux-tdep.c (s390_ax_pseudo_register_collect): New function.
(s390_ax_pseudo_register_push_stack): New function.
(s390_gdbarch_init): Fill ax_pseudo_register_collect and
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 00ff388..48801d2 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -617,6 +617,16 @@ s390_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
return 0;
}

+static void
+s390_gen_return_address (struct gdbarch *gdbarch,
+ struct agent_expr *ax, struct axs_value *value,
+ CORE_ADDR scope)
+{
+ value->type = register_type (gdbarch, S390_R14_REGNUM);
+ value->kind = axs_lvalue_register;
+ value->u.reg = S390_R14_REGNUM;
+}
+

/* A helper for s390_software_single_step, decides if an instruction
is a partial-execution instruction that needs to be executed until
@@ -7960,6 +7970,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
s390_ax_pseudo_register_collect);
set_gdbarch_ax_pseudo_register_push_stack
(gdbarch, s390_ax_pseudo_register_push_stack);
+ set_gdbarch_gen_return_address (gdbarch, s390_gen_return_address);
tdesc_use_registers (gdbarch, tdesc, tdesc_data);
set_gdbarch_register_name (gdbarch, s390_register_name);

--
2.7.0