watchpoint-unaligned.exp: Use skip_hw_watchpoint_tests
[deliverable/binutils-gdb.git] / gdb / obsd-nat.c
index e4a98ae91e25ad097627263d55c6e99f0331caf2..91bed717a56bd18af3eb90ee616497522743e276 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for OpenBSD.
 
-   Copyright (C) 2012-2014 Free Software Foundation, Inc.
+   Copyright (C) 2012-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -35,8 +35,8 @@
 
 #ifdef PT_GET_THREAD_FIRST
 
-static char *
-obsd_pid_to_str (struct target_ops *ops, ptid_t ptid)
+const char *
+obsd_nat_target::pid_to_str (ptid_t ptid)
 {
   if (ptid_get_lwp (ptid) != 0)
     {
@@ -49,12 +49,14 @@ obsd_pid_to_str (struct target_ops *ops, ptid_t ptid)
   return normal_pid_to_str (ptid);
 }
 
-static void
-obsd_find_new_threads (struct target_ops *ops)
+void
+obsd_nat_target::update_thread_list ()
 {
   pid_t pid = ptid_get_pid (inferior_ptid);
   struct ptrace_thread_state pts;
 
+  prune_threads ();
+
   if (ptrace (PT_GET_THREAD_FIRST, pid, (caddr_t)&pts, sizeof pts) == -1)
     perror_with_name (("ptrace"));
 
@@ -75,9 +77,9 @@ obsd_find_new_threads (struct target_ops *ops)
     }
 }
 
-static ptid_t
-obsd_wait (struct target_ops *ops,
-          ptid_t ptid, struct target_waitstatus *ourstatus, int options)
+ptid_t
+obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
+                      int options)
 {
   pid_t pid;
   int status, save_errno;
@@ -163,22 +165,4 @@ obsd_wait (struct target_ops *ops,
   return ptid;
 }
 
-void
-obsd_add_target (struct target_ops *t)
-{
-  /* Override some methods to support threads.  */
-  t->to_pid_to_str = obsd_pid_to_str;
-  t->to_find_new_threads = obsd_find_new_threads;
-  t->to_wait = obsd_wait;
-  add_target (t);
-}
-
-#else
-
-void
-obsd_add_target (struct target_ops *t)
-{
-  add_target (t);
-}
-
 #endif /* PT_GET_THREAD_FIRST */
This page took 0.023793 seconds and 4 git commands to generate.