#endif
/* Stabilize threads (move out of jump pads). */
- stabilize_threads ();
+ target_stabilize_threads ();
/* Detach from the clone lwps first. If the thread group exits just
while we're detaching, we must reap the clone lwps before we're
since for something else in the new run, the thread would now
execute the wrong / random instructions. */
-static void
-linux_stabilize_threads (void)
+void
+linux_process_target::stabilize_threads ()
{
thread_info *thread_stuck = find_thread (stuck_in_jump_pad_callback);
/* Stabilize threads (move out of jump pads). */
if (!non_stop)
- stabilize_threads ();
+ target_stabilize_threads ();
}
else
{
return linux_common_core_of_thread (ptid);
}
-static int
-linux_supports_disable_randomization (void)
+bool
+linux_process_target::supports_disable_randomization ()
{
#ifdef HAVE_PERSONALITY
- return 1;
+ return true;
#else
- return 0;
+ return false;
#endif
}
-static int
-linux_supports_agent (void)
+bool
+linux_process_target::supports_agent ()
{
- return 1;
+ return true;
}
static int
/* This exposes stop-all-threads functionality to other modules. */
-static void
-linux_pause_all (int freeze)
+void
+linux_process_target::pause_all (bool freeze)
{
stop_all_lwps (freeze, NULL);
}
/* This exposes unstop-all-threads functionality to other gdbserver
modules. */
-static void
-linux_unpause_all (int unfreeze)
+void
+linux_process_target::unpause_all (bool unfreeze)
{
unstop_all_lwps (unfreeze, NULL);
}
/* Neither ptrace nor /proc/PID/mem allow accessing memory through a
running LWP. */
if (non_stop)
- linux_pause_all (1);
+ target_pause_all (true);
return 0;
}
/* Neither ptrace nor /proc/PID/mem allow accessing memory through a
running LWP. */
if (non_stop)
- linux_unpause_all (1);
+ target_unpause_all (true);
}
-static int
-linux_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr,
- CORE_ADDR collector,
- CORE_ADDR lockaddr,
- ULONGEST orig_size,
- CORE_ADDR *jump_entry,
- CORE_ADDR *trampoline,
- ULONGEST *trampoline_size,
- unsigned char *jjump_pad_insn,
- ULONGEST *jjump_pad_insn_size,
- CORE_ADDR *adjusted_insn_addr,
- CORE_ADDR *adjusted_insn_addr_end,
- char *err)
+bool
+linux_process_target::supports_fast_tracepoints ()
+{
+ return the_low_target.install_fast_tracepoint_jump_pad != nullptr;
+}
+
+int
+linux_process_target::install_fast_tracepoint_jump_pad
+ (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector,
+ CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry,
+ CORE_ADDR *trampoline, ULONGEST *trampoline_size,
+ unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size,
+ CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end,
+ char *err)
{
return (*the_low_target.install_fast_tracepoint_jump_pad)
(tpoint, tpaddr, collector, lockaddr, orig_size,
err);
}
-static struct emit_ops *
-linux_emit_ops (void)
+emit_ops *
+linux_process_target::emit_ops ()
{
if (the_low_target.emit_ops != NULL)
return (*the_low_target.emit_ops) ();
return NULL;
}
-static int
-linux_get_min_fast_tracepoint_insn_len (void)
+int
+linux_process_target::get_min_fast_tracepoint_insn_len ()
{
return (*the_low_target.get_min_fast_tracepoint_insn_len) ();
}
return ret;
}
+bool
+linux_process_target::supports_qxfer_libraries_svr4 ()
+{
+ return true;
+}
+
struct link_map_offsets
{
/* Offset and size of r_debug.r_version. */
/* Construct qXfer:libraries-svr4:read reply. */
-static int
-linux_qxfer_libraries_svr4 (const char *annex, unsigned char *readbuf,
- unsigned const char *writebuf,
- CORE_ADDR offset, int len)
+int
+linux_process_target::qxfer_libraries_svr4 (const char *annex,
+ unsigned char *readbuf,
+ unsigned const char *writebuf,
+ CORE_ADDR offset, int len)
{
struct process_info_private *const priv = current_process ()->priv;
char filename[PATH_MAX];
#ifdef HAVE_LINUX_BTRACE
+btrace_target_info *
+linux_process_target::enable_btrace (ptid_t ptid,
+ const btrace_config *conf)
+{
+ return linux_enable_btrace (ptid, conf);
+}
+
/* See to_disable_btrace target method. */
-static int
-linux_low_disable_btrace (struct btrace_target_info *tinfo)
+int
+linux_process_target::disable_btrace (btrace_target_info *tinfo)
{
enum btrace_error err;
/* See to_read_btrace target method. */
-static int
-linux_low_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
- enum btrace_read_type type)
+int
+linux_process_target::read_btrace (btrace_target_info *tinfo,
+ buffer *buffer,
+ enum btrace_read_type type)
{
struct btrace_data btrace;
enum btrace_error err;
/* See to_btrace_conf target method. */
-static int
-linux_low_btrace_conf (const struct btrace_target_info *tinfo,
- struct buffer *buffer)
+int
+linux_process_target::read_btrace_conf (const btrace_target_info *tinfo,
+ buffer *buffer)
{
const struct btrace_config *conf;
static linux_process_target the_linux_target;
static process_stratum_target linux_target_ops = {
- NULL,
- linux_pause_all,
- linux_unpause_all,
- linux_stabilize_threads,
- linux_install_fast_tracepoint_jump_pad,
- linux_emit_ops,
- linux_supports_disable_randomization,
- linux_get_min_fast_tracepoint_insn_len,
- linux_qxfer_libraries_svr4,
- linux_supports_agent,
-#ifdef HAVE_LINUX_BTRACE
- linux_enable_btrace,
- linux_low_disable_btrace,
- linux_low_read_btrace,
- linux_low_btrace_conf,
-#else
- NULL,
- NULL,
- NULL,
- NULL,
-#endif
linux_supports_range_stepping,
linux_proc_pid_to_exec_file,
linux_mntns_open_cloexec,