Constify some commands in ax-gdb.c
authorTom Tromey <tom@tromey.com>
Tue, 12 Sep 2017 21:00:06 +0000 (15:00 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 27 Sep 2017 14:44:46 +0000 (08:44 -0600)
gdb/ChangeLog
2017-09-27  Tom Tromey  <tom@tromey.com>

* ax-gdb.c (maint_agent_printf_command, agent_command)
(agent_eval_command): Constify.

gdb/ChangeLog
gdb/ax-gdb.c

index 08705c0340ce1426231b3f80a3f89cb73208128c..cd6e3e48167f25393a24c80574feb83288ef8695 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-27  Tom Tromey  <tom@tromey.com>
+
+       * ax-gdb.c (maint_agent_printf_command, agent_command)
+       (agent_eval_command): Constify.
+
 2017-09-27  Tom Tromey  <tom@tromey.com>
 
        * tracepoint.c (info_scope_command): Constify.
index c4bf2a688e3396f0d8ab1188c6b04b0a29b7cd9e..52ca081a8280d66befa4195720062e0ba261dd5f 100644 (file)
@@ -158,8 +158,6 @@ static void gen_expr_binop_rest (struct expression *exp,
                                 struct axs_value *value,
                                 struct axs_value *value1,
                                 struct axs_value *value2);
-
-static void agent_command (char *exp, int from_tty);
 \f
 
 /* Detecting constant expressions.  */
@@ -2661,7 +2659,7 @@ agent_command_1 (const char *exp, int eval)
 }
 
 static void
-agent_command (char *exp, int from_tty)
+agent_command (const char *exp, int from_tty)
 {
   agent_command_1 (exp, 0);
 }
@@ -2671,7 +2669,7 @@ agent_command (char *exp, int from_tty)
    expression.  */
 
 static void
-agent_eval_command (char *exp, int from_tty)
+agent_eval_command (const char *exp, int from_tty)
 {
   agent_command_1 (exp, 1);
 }
@@ -2680,12 +2678,11 @@ agent_eval_command (char *exp, int from_tty)
    that does a printf, and display the resulting expression.  */
 
 static void
-maint_agent_printf_command (char *exp, int from_tty)
+maint_agent_printf_command (const char *cmdrest, int from_tty)
 {
   struct cleanup *old_chain = 0;
   struct expression *argvec[100];
   struct frame_info *fi = get_current_frame ();        /* need current scope */
-  const char *cmdrest;
   const char *format_start, *format_end;
   struct format_piece *fpieces;
   int nargs;
@@ -2697,11 +2694,9 @@ maint_agent_printf_command (char *exp, int from_tty)
   if (overlay_debugging)
     error (_("GDB can't do agent expression translation with overlays."));
 
-  if (exp == 0)
+  if (cmdrest == 0)
     error_no_arg (_("expression to translate"));
 
-  cmdrest = exp;
-
   cmdrest = skip_spaces (cmdrest);
 
   if (*cmdrest++ != '"')