Implement get_syscall_trapinfo for aarch64-linux
authorYao Qi <yao.qi@linaro.org>
Tue, 28 Jun 2016 11:02:35 +0000 (12:02 +0100)
committerYao Qi <yao.qi@linaro.org>
Tue, 28 Jun 2016 11:03:28 +0000 (12:03 +0100)
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.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-aarch64-low.c

index cde237087f69db03decac31a879de46cbf2f9f77..4c28195fb0eab50b42e1b524c1047638ebcf3df6 100644 (file)
@@ -1,3 +1,9 @@
+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.
index d237bde67fd83c9b1c91e21e6c73eef582c423bc..7ac68dd6e5f4e1f55677408f6f2876df8a3ee579 100644 (file)
@@ -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