Fix M68HC11_NUM_REGS
[deliverable/binutils-gdb.git] / gdb / proc-api.c
index 72746ce466a897eb8637b41f9492b7b400cfcadd..a03caa1d4eb7e1299e97f6208e6926d9e15350ea 100644 (file)
 
 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
-set_procfs_trace_cmd (char *args, int from_tty, struct cmd_list_element *c)
+set_procfs_trace_cmd (const char *args,
+                     int from_tty, struct cmd_list_element *c)
 {
 #if 0  /* not sure what I might actually need to do here, if anything */
   if (procfs_file)
@@ -81,7 +81,8 @@ set_procfs_trace_cmd (char *args, int from_tty, struct cmd_list_element *c)
 }
 
 static void
-set_procfs_file_cmd (char *args, int from_tty, struct cmd_list_element *c)
+set_procfs_file_cmd (const char *args,
+                    int from_tty, struct cmd_list_element *c)
 {
   /* Just changed the filename for procfs tracing.
      If a file was already open, close it.  */
@@ -734,7 +735,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)
@@ -769,10 +770,6 @@ proc_prettyfprint_status (long flags, int why, int what, int thread)
     }
 }
 
-
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-extern void _initialize_proc_api (void);
-
 void
 _initialize_proc_api (void)
 {
@@ -785,6 +782,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.026053 seconds and 4 git commands to generate.