summaryrefslogtreecommitdiff
path: root/gdbserver/linux-arm-low.cc
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-04-02 15:11:31 +0200
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-04-02 15:11:31 +0200
commit9eedd27d42ceeb6f3765c24972a5c97ce20727cd (patch)
tree5a404f9e0dc938bd6a5cf6563bd385606afa48f6 /gdbserver/linux-arm-low.cc
parentb31cdfa69f4adfc4760da1480c900f5c27421d43 (diff)
downloadbinutils-gdb-9eedd27d42ceeb6f3765c24972a5c97ce20727cd.tar.gz
gdbserver/linux-low: turn 'get_syscall_trapinfo' into a method
gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn the 'get_syscall_trapinfo' linux target op into a method of process_stratum_target. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) <get_syscall_trapinfo> <gdb_catch_this_syscall> <low_supports_catch_syscall> <low_get_syscall_trapinfo>: Declare. * linux-low.cc (get_syscall_trapinfo): Turn into... (linux_process_target::get_syscall_trapinfo): ...this. (linux_process_target::low_get_syscall_trapinfo): Define. (gdb_catch_this_syscall_p): Turn into... (linux_process_target::gdb_catch_this_syscall): ...this. (linux_process_target::low_supports_catch_syscall): Define. Update the callers below. (linux_process_target::wait_1) (linux_process_target::supports_catch_syscall) * linux-x86-low.cc (class x86_target) <low_supports_catch_syscall> <low_get_syscall_trapinfo>: Declare. (x86_target::low_supports_catch_syscall): Define. (x86_get_syscall_trapinfo): Turn into... (x86_target::low_get_syscall_trapinfo): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) <low_supports_catch_syscall> <low_get_syscall_trapinfo>: Declare. (aarch64_target::low_supports_catch_syscall): Define. (aarch64_get_syscall_trapinfo): Turn into... (aarch64_target::low_get_syscall_trapinfo): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) <low_supports_catch_syscall> <low_get_syscall_trapinfo>: Declare. (arm_target::low_supports_catch_syscall): Define. (arm_get_syscall_trapinfo): Turn into... (arm_target::low_get_syscall_trapinfo): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (the_low_target): Remove the op field. * linux-s390-low.cc (the_low_target): Remove the op field.
Diffstat (limited to 'gdbserver/linux-arm-low.cc')
-rw-r--r--gdbserver/linux-arm-low.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/gdbserver/linux-arm-low.cc b/gdbserver/linux-arm-low.cc
index 2e3d00a489a..4577c83bfb0 100644
--- a/gdbserver/linux-arm-low.cc
+++ b/gdbserver/linux-arm-low.cc
@@ -113,6 +113,10 @@ protected:
void low_new_fork (process_info *parent, process_info *child) override;
void low_prepare_to_resume (lwp_info *lwp) override;
+
+ bool low_supports_catch_syscall () override;
+
+ void low_get_syscall_trapinfo (regcache *regcache, int *sysno) override;
};
/* The singleton target ops object. */
@@ -1038,10 +1042,16 @@ arm_target::supports_hardware_single_step ()
return false;
}
-/* Implementation of linux_target_ops method "get_syscall_trapinfo". */
+bool
+arm_target::low_supports_catch_syscall ()
+{
+ return true;
+}
-static void
-arm_get_syscall_trapinfo (struct regcache *regcache, int *sysno)
+/* Implementation of linux target ops method "low_get_syscall_trapinfo". */
+
+void
+arm_target::low_get_syscall_trapinfo (regcache *regcache, int *sysno)
{
if (arm_is_thumb_mode ())
collect_register_by_name (regcache, "r7", sysno);
@@ -1052,7 +1062,7 @@ arm_get_syscall_trapinfo (struct regcache *regcache, int *sysno)
collect_register_by_name (regcache, "pc", &pc);
- if (the_target->read_memory (pc - 4, (unsigned char *) &insn, 4))
+ if (read_memory (pc - 4, (unsigned char *) &insn, 4))
*sysno = UNKNOWN_SYSCALL;
else
{
@@ -1119,7 +1129,6 @@ arm_target::get_regs_info ()
}
struct linux_target_ops the_low_target = {
- arm_get_syscall_trapinfo,
};
/* The linux target ops object. */