2002-08-14 Michael Snyder <msnyder@redhat.com>
[deliverable/binutils-gdb.git] / gdb / fbsd-proc.c
index 91746d61786d2f8c6558d93ae38c20aec8874b77..6c47979650a93f7f7133c91e94c80fbd54320c57 100644 (file)
@@ -21,6 +21,7 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "inferior.h"
+#include "gdb_string.h"
 
 #include <sys/procfs.h>
 #include <sys/types.h>
@@ -35,7 +36,7 @@ child_pid_to_exec_file (int pid)
   char *path;
   char *buf;
 
-  asprintf (&path, "/proc/%d/file", pid);
+  xasprintf (&path, "/proc/%d/file", pid);
   buf = xcalloc (MAXPATHLEN, sizeof (char));
   make_cleanup (xfree, path);
   make_cleanup (xfree, buf);
@@ -84,7 +85,7 @@ fbsd_find_memory_regions (int (*func) (CORE_ADDR,
   char protection[4];
   int read, write, exec;
 
-  asprintf (&mapfilename, "/proc/%ld/map", (long) pid);
+  xasprintf (&mapfilename, "/proc/%ld/map", (long) pid);
   mapfile = fopen (mapfilename, "r");
   if (mapfile == NULL)
     error ("Couldn't open %s\n", mapfilename);
@@ -145,7 +146,7 @@ fbsd_make_corefile_notes (bfd *obfd, int *note_size)
   if (get_exec_file (0))
     {
       char *fname = strrchr (get_exec_file (0), '/') + 1;
-      char *psargs = strdup (fname);
+      char *psargs = xstrdup (fname);
 
       if (get_inferior_args ())
        psargs = reconcat (psargs, psargs, " ", get_inferior_args (), NULL);
This page took 0.023856 seconds and 4 git commands to generate.