/* Machine independent support for SVR4 /proc (process file system) for GDB.
- Copyright (C) 1999-2001, 2003, 2005, 2007-2012 Free Software
- Foundation, Inc.
+ Copyright (C) 1999-2017 Free Software Foundation, Inc.
Written by Michael Snyder at Cygnus Solutions.
Based on work by Fred Fish, Stu Grossman, Geoff Noer, and others.
#define _STRUCTURED_PROC 1
#endif
-#include <stdio.h>
#include <sys/types.h>
#include <sys/procfs.h>
#ifdef HAVE_SYS_PROC_H
struct trans {
long value; /* The numeric value */
- char *name; /* The equivalent symbolic value */
- char *desc; /* Short description of value */
+ const char *name; /* The equivalent symbolic value */
+ const char *desc; /* Short description of value */
};
static int procfs_trace = 0;
static FILE *procfs_file = NULL;
-static char *procfs_filename = "procfs_trace";
+static char *procfs_filename;
static void
prepare_to_trace (void)
{
if (procfs_trace) /* if procfs tracing turned on */
if (procfs_file == NULL) /* if output file not yet open */
- if (procfs_filename != NULL) /* if output filename known */
- procfs_file = fopen (procfs_filename, "a"); /* open output file */
+ procfs_file = fopen (procfs_filename, "a"); /* open output file */
}
static void
}
void
-procfs_note (char *msg, char *file, int line)
+procfs_note (const char *msg, const char *file, int line)
{
prepare_to_trace ();
if (procfs_trace)
NULL, /* FIXME: i18n: */
&setlist, &showlist);
+ procfs_filename = xstrdup ("procfs_trace");
add_setshow_filename_cmd ("procfs-file", no_class, &procfs_filename, _("\
Set filename for /proc tracefile."), _("\
Show filename for /proc tracefile."), NULL,