Check return value of bfd_new_link_order
[binutils-gdb.git] / gdb / obsd-nat.c
index e4a98ae91e25ad097627263d55c6e99f0331caf2..e2336a0579ec18f4f20dd1da97312b1c1b5c755d 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for OpenBSD.
 
-   Copyright (C) 2012-2014 Free Software Foundation, Inc.
+   Copyright (C) 2012-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -35,7 +35,7 @@
 
 #ifdef PT_GET_THREAD_FIRST
 
-static char *
+static const char *
 obsd_pid_to_str (struct target_ops *ops, ptid_t ptid)
 {
   if (ptid_get_lwp (ptid) != 0)
@@ -50,11 +50,13 @@ 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;
 
+  prune_threads ();
+
   if (ptrace (PT_GET_THREAD_FIRST, pid, (caddr_t)&pts, sizeof pts) == -1)
     perror_with_name (("ptrace"));
 
@@ -168,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);
 }