Move free_all_objfiles to program_space
[deliverable/binutils-gdb.git] / gdb / fbsd-nat.c
index 184d63939f475c8bf6c01a90dca225eae3f11e91..0274ff542eaf419a605884a2a18f0e51ba8bdd59 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "common/byte-vector.h"
+#include "gdbsupport/byte-vector.h"
 #include "gdbcore.h"
 #include "inferior.h"
 #include "regcache.h"
 #include "regset.h"
+#include "gdbarch.h"
 #include "gdbcmd.h"
 #include "gdbthread.h"
-#include "common/gdb_wait.h"
+#include "gdbsupport/gdb_wait.h"
 #include "inf-ptrace.h"
 #include <sys/types.h>
 #include <sys/procfs.h>
@@ -37,7 +38,7 @@
 #include <libutil.h>
 #endif
 #if !defined(HAVE_KINFO_GETVMMAP)
-#include "common/filestuff.h"
+#include "gdbsupport/filestuff.h"
 #endif
 
 #include "elf-bfd.h"
@@ -831,8 +832,8 @@ fbsd_nat_target::xfer_partial (enum target_object object,
 }
 
 #ifdef PT_LWPINFO
-static int debug_fbsd_lwp;
-static int debug_fbsd_nat;
+static bool debug_fbsd_lwp;
+static bool debug_fbsd_nat;
 
 static void
 show_fbsd_lwp_debug (struct ui_file *file, int from_tty,
@@ -897,10 +898,9 @@ fbsd_nat_target::thread_alive (ptid_t ptid)
   return true;
 }
 
-/* Convert PTID to a string.  Returns the string in a static
-   buffer.  */
+/* Convert PTID to a string.  */
 
-const char *
+std::string
 fbsd_nat_target::pid_to_str (ptid_t ptid)
 {
   lwpid_t lwp;
@@ -908,11 +908,9 @@ fbsd_nat_target::pid_to_str (ptid_t ptid)
   lwp = ptid.lwp ();
   if (lwp != 0)
     {
-      static char buf[64];
       int pid = ptid.pid ();
 
-      xsnprintf (buf, sizeof buf, "LWP %d of process %d", lwp, pid);
-      return buf;
+      return string_printf ("LWP %d of process %d", lwp, pid);
     }
 
   return normal_pid_to_str (ptid);
@@ -1350,8 +1348,8 @@ fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
                                        "FLWP: deleting thread for LWP %u\n",
                                        pl.pl_lwpid);
                  if (print_thread_events)
-                   printf_unfiltered (_("[%s exited]\n"), target_pid_to_str
-                                      (wptid));
+                   printf_unfiltered (_("[%s exited]\n"),
+                                      target_pid_to_str (wptid).c_str ());
                  delete_thread (thr);
                }
              if (ptrace (PT_CONTINUE, pid, (caddr_t) 1, 0) == -1)
This page took 0.0259 seconds and 4 git commands to generate.