#include "defs.h"
#include "gdbcore.h"
#include "inferior.h"
+#include "gdb_string.h"
#include <sys/procfs.h>
#include <sys/types.h>
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);
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);
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);