write_pieced_value: Notify memory_changed observers
[deliverable/binutils-gdb.git] / gdb / proc-api.c
index 77c0f712135496dd81e246617828b75e3ababffa..dd9af0d7238c5377a9f0d094100eae73a18910f6 100644 (file)
@@ -1,7 +1,6 @@
 /* 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.
@@ -35,7 +34,6 @@
 #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
@@ -736,7 +733,7 @@ wait_with_trace (int *wstat, char *file, int line)
 }
 
 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)
@@ -787,6 +784,7 @@ Show tracing for /proc api calls."), NULL,
                           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,
This page took 0.024522 seconds and 4 git commands to generate.