aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Langlois <pierre.langlois@arm.com>2015-07-09 16:35:11 +0100
committerPierre Langlois <pierre.langlois@arm.com>2015-07-09 16:35:11 +0100
commitea873d8ea64281250434e198b57373f308c3bddb (patch)
treed8bb50606015ae905bb2bc3eab47a417fe8a6f1c
parent02a2a705aa71646a47c955388491523a989516c5 (diff)
downloadgdb-ea873d8ea64281250434e198b57373f308c3bddb.zip
gdb-ea873d8ea64281250434e198b57373f308c3bddb.tar.gz
gdb-ea873d8ea64281250434e198b57373f308c3bddb.tar.bz2
[AArch64] Implement gdbarch_gen_return_address gdbarch method
This patch implements the 'collect $_ret' command to collect the return address of a function in a tracepoint. It marks the LR register for collection. gdb/ChangeLog: * aarch64-tdep.c: Add ax.h and ax-gdb.h includes. (aarch64_gen_return_address): New function. (aarch64_gdbarch_init): Hook it.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/aarch64-tdep.c16
2 files changed, 22 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5899173..b68b60d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2015-07-09 Pierre Langlois <pierre.langlois@arm.com>
+ * aarch64-tdep.c: Add ax.h and ax-gdb.h includes.
+ (aarch64_gen_return_address): New function.
+ (aarch64_gdbarch_init): Hook it.
+
+2015-07-09 Pierre Langlois <pierre.langlois@arm.com>
+
* aarch64-tdep.c (aarch64_make_stub_cache): Set available_p and
swallow NOT_AVAILABLE_ERROR.
(aarch64_stub_this_id): Call frame_id_build_unavailable_stack if
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index db9ea76..b613532 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -42,6 +42,8 @@
#include "user-regs.h"
#include "language.h"
#include "infcall.h"
+#include "ax.h"
+#include "ax-gdb.h"
#include "aarch64-tdep.h"
@@ -2273,6 +2275,18 @@ aarch64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
*pc = extract_unsigned_integer (buf, X_REGISTER_SIZE, byte_order);
return 1;
}
+
+/* Implement the "gen_return_address" gdbarch method. */
+
+static void
+aarch64_gen_return_address (struct gdbarch *gdbarch,
+ struct agent_expr *ax, struct axs_value *value,
+ CORE_ADDR scope)
+{
+ value->type = register_type (gdbarch, AARCH64_LR_REGNUM);
+ value->kind = axs_lvalue_register;
+ value->u.reg = AARCH64_LR_REGNUM;
+}
/* Return the pseudo register name corresponding to register regnum. */
@@ -2842,6 +2856,8 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (tdep->jb_pc >= 0)
set_gdbarch_get_longjmp_target (gdbarch, aarch64_get_longjmp_target);
+ set_gdbarch_gen_return_address (gdbarch, aarch64_gen_return_address);
+
tdesc_use_registers (gdbarch, tdesc, tdesc_data);
/* Add standard register aliases. */