aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/nto-low.cc
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-02-17 16:11:55 +0100
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-02-20 17:35:08 +0100
commit6eeb5c5531f0238d367a2f3f1520ae3e2401f7ea (patch)
tree78bd9c69913ee64f4fc7ba3cb18a4beb2d09e854 /gdbserver/nto-low.cc
parent22aa6223a0f6f7b8f5439166de2bbbb940ca9804 (diff)
downloadgdb-6eeb5c5531f0238d367a2f3f1520ae3e2401f7ea.zip
gdb-6eeb5c5531f0238d367a2f3f1520ae3e2401f7ea.tar.gz
gdb-6eeb5c5531f0238d367a2f3f1520ae3e2401f7ea.tar.bz2
gdbserver: turn target ops 'stopped_by_watchpoint' and 'stopped_data_address' into methods
gdbserver/ChangeLog: 2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Turn process_stratum_target's stopped_by_watchpoint and stopped_data_address ops into methods of process_target. * target.h (struct process_stratum_target): Remove the target ops. (class process_target): Add the target ops. * target.cc (process_target::stopped_by_watchpoint): Define. (process_target::stopped_data_address): Define. Update the derived classes and callers below. * remote-utils.cc (prepare_resume_reply): Update. * linux-low.cc (linux_target_ops): Update. (linux_stopped_by_watchpoint): Turn into ... (linux_process_target::stopped_by_watchpoint): ... this. (linux_stopped_data_address): Turn into ... (linux_process_target::stopped_data_address): ... this. * linux-low.h (class linux_process_target): Update. * lynx-low.cc (lynx_target_ops): Update. * nto-low.cc (nto_target_ops): Update. (nto_stopped_by_watchpoint): Turn into ... (nto_process_target::stopped_by_watchpoint): ... this. (nto_stopped_data_address): Turn into ... (nto_process_target::stopped_data_address): ... this. * nto-low.h (class nto_process_target): Update. * win32-low.cc (win32_target_ops): Update. (win32_stopped_by_watchpoint): Turn into ... (win32_process_target::stopped_by_watchpoint): ... this. (win32_stopped_data_address): Turn into ... (win32_process_target::stopped_data_address): ... this. * win32-low.h (class win32_process_target): Update.
Diffstat (limited to 'gdbserver/nto-low.cc')
-rw-r--r--gdbserver/nto-low.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/gdbserver/nto-low.cc b/gdbserver/nto-low.cc
index 3e10436..53020a2 100644
--- a/gdbserver/nto-low.cc
+++ b/gdbserver/nto-low.cc
@@ -878,12 +878,12 @@ nto_process_target::supports_hardware_single_step ()
/* Check if the reason of stop for current thread (CURRENT_INFERIOR) is
a watchpoint.
- Return 1 if stopped by watchpoint, 0 otherwise. */
+ Return true if stopped by watchpoint, false otherwise. */
-static int
-nto_stopped_by_watchpoint (void)
+bool
+nto_process_target::stopped_by_watchpoint ()
{
- int ret = 0;
+ bool ret = false;
TRACE ("%s\n", __func__);
if (nto_inferior.ctl_fd != -1 && current_thread != NULL)
@@ -899,7 +899,7 @@ nto_stopped_by_watchpoint (void)
err = devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status,
sizeof (status), 0);
if (err == EOK && (status.flags & watchmask))
- ret = 1;
+ ret = true;
}
}
TRACE ("%s: %s\n", __func__, ret ? "yes" : "no");
@@ -910,8 +910,8 @@ nto_stopped_by_watchpoint (void)
Return inferior's instruction pointer value, or 0 on error. */
-static CORE_ADDR
-nto_stopped_data_address (void)
+CORE_ADDR
+nto_process_target::stopped_data_address ()
{
CORE_ADDR ret = (CORE_ADDR)0;
@@ -956,8 +956,6 @@ nto_sw_breakpoint_from_kind (int kind, int *size)
static nto_process_target the_nto_target;
static process_stratum_target nto_target_ops = {
- nto_stopped_by_watchpoint,
- nto_stopped_data_address,
NULL, /* nto_read_offsets */
NULL, /* thread_db_set_tls_address */
hostio_last_error_from_errno,