ada-lang.c:ada_value_primitive_packed_val: const correctness
[deliverable/binutils-gdb.git] / gdb / obsd-nat.c
index c17a5658fa714ffde40a0aeed1e3f99eaa061e83..72ed10cb0ae00a72d8d7f5f81f087b9435238d54 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for OpenBSD.
 
-   Copyright (C) 2012-2014 Free Software Foundation, Inc.
+   Copyright (C) 2012-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "inferior.h"
 #include "target.h"
 
-#include "gdb_assert.h"
 #include <sys/types.h>
 #include <sys/ptrace.h>
-#include <sys/wait.h>
+#include "gdb_wait.h"
 
 #include "inf-child.h"
 #include "obsd-nat.h"
 
 /* OpenBSD 5.2 and later include rthreads which uses a thread model
-   that maps userlan threads directly onto kernel threads in a 1:1
+   that maps userland threads directly onto kernel threads in a 1:1
    fashion.  */
 
 #ifdef PT_GET_THREAD_FIRST
@@ -51,12 +50,14 @@ obsd_pid_to_str (struct target_ops *ops, ptid_t ptid)
 }
 
 static void
-obsd_find_new_threads (struct target_ops *ops)
+obsd_update_thread_list (struct target_ops *ops)
 {
   pid_t pid = ptid_get_pid (inferior_ptid);
   struct ptrace_thread_state pts;
 
-  if (ptrace(PT_GET_THREAD_FIRST, pid, (caddr_t)&pts, sizeof pts) == -1)
+  prune_threads ();
+
+  if (ptrace (PT_GET_THREAD_FIRST, pid, (caddr_t)&pts, sizeof pts) == -1)
     perror_with_name (("ptrace"));
 
   while (pts.pts_tid != -1)
@@ -71,7 +72,7 @@ obsd_find_new_threads (struct target_ops *ops)
            add_thread (ptid);
        }
 
-      if (ptrace(PT_GET_THREAD_NEXT, pid, (caddr_t)&pts, sizeof pts) == -1)
+      if (ptrace (PT_GET_THREAD_NEXT, pid, (caddr_t)&pts, sizeof pts) == -1)
        perror_with_name (("ptrace"));
     }
 }
@@ -169,7 +170,7 @@ 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_update_thread_list = obsd_update_thread_list;
   t->to_wait = obsd_wait;
   add_target (t);
 }
This page took 0.027307 seconds and 4 git commands to generate.