syscalls_to_catch = std::move (proc->syscalls_to_catch);
/* Delete the execing process and all its threads. */
- the_target->pt->mourn (proc);
+ the_target->mourn (proc);
current_thread = NULL;
/* Create a new process/lwp/thread. */
static int
linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{
- return the_target->pt->read_memory (memaddr, myaddr, len);
+ return the_target->read_memory (memaddr, myaddr, len);
}
/* Copy LEN bytes from inferior's memory starting at MEMADDR
return can_hardware_single_step ();
}
-static int
-linux_supports_software_single_step (void)
+bool
+linux_process_target::supports_software_single_step ()
{
return can_software_single_step ();
}
return (*the_low_target.supports_range_stepping) ();
}
+bool
+linux_process_target::supports_pid_to_exec_file ()
+{
+ return true;
+}
+
+char *
+linux_process_target::pid_to_exec_file (int pid)
+{
+ return linux_proc_pid_to_exec_file (pid);
+}
+
+bool
+linux_process_target::supports_multifs ()
+{
+ return true;
+}
+
+int
+linux_process_target::multifs_open (int pid, const char *filename,
+ int flags, mode_t mode)
+{
+ return linux_mntns_open_cloexec (pid, filename, flags, mode);
+}
+
+int
+linux_process_target::multifs_unlink (int pid, const char *filename)
+{
+ return linux_mntns_unlink (pid, filename);
+}
+
+ssize_t
+linux_process_target::multifs_readlink (int pid, const char *filename,
+ char *buf, size_t bufsiz)
+{
+ return linux_mntns_readlink (pid, filename, buf, bufsiz);
+}
+
#if defined PT_GETDSBT || defined PTRACE_GETFDPIC
struct target_loadseg
{
the_low_target.process_qsupported (features, count);
}
-static int
-linux_supports_catch_syscall (void)
+bool
+linux_process_target::supports_catch_syscall ()
{
return (the_low_target.get_syscall_trapinfo != NULL
&& linux_supports_tracesysgood ());
}
-static int
-linux_get_ipa_tdesc_idx (void)
+int
+linux_process_target::get_ipa_tdesc_idx ()
{
if (the_low_target.get_ipa_tdesc_idx == NULL)
return 0;
/* Implementation of the target_ops method "breakpoint_kind_from_pc". */
-static int
-linux_breakpoint_kind_from_pc (CORE_ADDR *pcptr)
+int
+linux_process_target::breakpoint_kind_from_pc (CORE_ADDR *pcptr)
{
if (the_low_target.breakpoint_kind_from_pc != NULL)
return (*the_low_target.breakpoint_kind_from_pc) (pcptr);
else
- return default_breakpoint_kind_from_pc (pcptr);
+ return process_stratum_target::breakpoint_kind_from_pc (pcptr);
}
/* Implementation of the target_ops method "sw_breakpoint_from_kind". */
-static const gdb_byte *
-linux_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+linux_process_target::sw_breakpoint_from_kind (int kind, int *size)
{
gdb_assert (the_low_target.sw_breakpoint_from_kind != NULL);
/* Implementation of the target_ops method
"breakpoint_kind_from_current_state". */
-static int
-linux_breakpoint_kind_from_current_state (CORE_ADDR *pcptr)
+int
+linux_process_target::breakpoint_kind_from_current_state (CORE_ADDR *pcptr)
{
if (the_low_target.breakpoint_kind_from_current_state != NULL)
return (*the_low_target.breakpoint_kind_from_current_state) (pcptr);
else
- return linux_breakpoint_kind_from_pc (pcptr);
+ return breakpoint_kind_from_pc (pcptr);
+}
+
+const char *
+linux_process_target::thread_name (ptid_t thread)
+{
+ return linux_proc_tid_get_name (thread);
+}
+
+#if USE_THREAD_DB
+bool
+linux_process_target::thread_handle (ptid_t ptid, gdb_byte **handle,
+ int *handle_len)
+{
+ return thread_db_thread_handle (ptid, handle, handle_len);
}
+#endif
/* Default implementation of linux_target_ops method "set_pc" for
32-bit pc register which is literally named "pc". */
gdb_assert (wordsize == 4 || wordsize == 8);
- while (the_target->pt->read_auxv (offset, data, 2 * wordsize) == 2 * wordsize)
+ while (the_target->read_auxv (offset, data, 2 * wordsize) == 2 * wordsize)
{
if (wordsize == 4)
{
static linux_process_target the_linux_target;
-static process_stratum_target linux_target_ops = {
- linux_proc_pid_to_exec_file,
- linux_mntns_open_cloexec,
- linux_mntns_unlink,
- linux_mntns_readlink,
- linux_breakpoint_kind_from_pc,
- linux_sw_breakpoint_from_kind,
- linux_proc_tid_get_name,
- linux_breakpoint_kind_from_current_state,
- linux_supports_software_single_step,
- linux_supports_catch_syscall,
- linux_get_ipa_tdesc_idx,
-#if USE_THREAD_DB
- thread_db_thread_handle,
-#else
- NULL,
-#endif
- &the_linux_target,
-};
-
#ifdef HAVE_LINUX_REGSETS
void
initialize_regsets_info (struct regsets_info *info)
struct sigaction sigchld_action;
memset (&sigchld_action, 0, sizeof (sigchld_action));
- set_target_ops (&linux_target_ops);
+ set_target_ops (&the_linux_target);
linux_ptrace_init_warnings ();
linux_proc_init_warnings ();