This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Implement get_syscall_trapinfo for aarch64-linux
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 28 Jun 2016 11:04:44 -0000
- Subject: [binutils-gdb] Implement get_syscall_trapinfo for aarch64-linux
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=061fc021d5d110cc37a4c06c4ed94b87be00610a
commit 061fc021d5d110cc37a4c06c4ed94b87be00610a
Author: Yao Qi <yao.qi@linaro.org>
Date: Tue Jun 28 12:02:35 2016 +0100
Implement get_syscall_trapinfo for aarch64-linux
gdb/gdbserver:
2016-06-28 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_get_syscall_trapinfo): New
function.
(the_low_target): Install aarch64_get_syscall_trapinfo.
Diff:
---
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/linux-aarch64-low.c | 19 +++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index cde2370..4c28195 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2016-06-28 Yao Qi <yao.qi@linaro.org>
+ * linux-aarch64-low.c (aarch64_get_syscall_trapinfo): New
+ function.
+ (the_low_target): Install aarch64_get_syscall_trapinfo.
+
+2016-06-28 Yao Qi <yao.qi@linaro.org>
+
* linux-low.c (get_syscall_trapinfo): Remove parameter sysret.
Callers updated.
* linux-low.h (struct linux_target_ops) <get_syscall_trapinfo>:
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index d237bde..7ac68dd 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -570,6 +570,24 @@ aarch64_get_thread_area (int lwpid, CORE_ADDR *addrp)
return 0;
}
+/* Implementation of linux_target_ops method "get_syscall_trapinfo". */
+
+static void
+aarch64_get_syscall_trapinfo (struct regcache *regcache, int *sysno)
+{
+ int use_64bit = register_size (regcache->tdesc, 0) == 8;
+
+ if (use_64bit)
+ {
+ long l_sysno;
+
+ collect_register_by_name (regcache, "x8", &l_sysno);
+ *sysno = (int) l_sysno;
+ }
+ else
+ collect_register_by_name (regcache, "r7", sysno);
+}
+
/* List of condition codes that we need. */
enum aarch64_condition_codes
@@ -2984,6 +3002,7 @@ struct linux_target_ops the_low_target =
aarch64_supports_range_stepping,
aarch64_breakpoint_kind_from_current_state,
aarch64_supports_hardware_single_step,
+ aarch64_get_syscall_trapinfo,
};
void