aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-interp.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2013-03-12 18:50:39 +0000
committerKeith Seitz <keiths@redhat.com>2013-03-12 18:50:39 +0000
commitee0475543fab82b9ea1348922c2662a8ae172116 (patch)
treedb4e5ad05c7bf02712c91f43bc8acc8a966542f3 /gdb/mi/mi-interp.c
parentbbc13ae3db19a3276ba029c838682f81d10f859a (diff)
downloadgdb-ee0475543fab82b9ea1348922c2662a8ae172116.zip
gdb-ee0475543fab82b9ea1348922c2662a8ae172116.tar.gz
gdb-ee0475543fab82b9ea1348922c2662a8ae172116.tar.bz2
* mi/mi-cmds.h (mi_execute_command): Make "cmd" const.
* mi/mi-interp.c (mi_interpreter_exec): Make "command" const. Remove temporary copy of input string. (mi_execute_command_wrapper): Make "cmd" const. * mi/mi-main.c (mi_execute_command): Make "string_ptr" const. * mi/mi-parse.c (mi_parse_argv): Make "args" const. Use const strings. (mi_parse): Make "cmd" const. Use const strings. * mi/mi-parse.h (mi_parse): Make "cmd" const.
Diffstat (limited to 'gdb/mi/mi-interp.c')
-rw-r--r--gdb/mi/mi-interp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index d1fe33c..2702f4f 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -41,7 +41,7 @@
/* These are the interpreter setup, etc. functions for the MI
interpreter. */
-static void mi_execute_command_wrapper (char *cmd);
+static void mi_execute_command_wrapper (const char *cmd);
static void mi_execute_command_input_handler (char *cmd);
static void mi_command_loop (int mi_version);
@@ -217,10 +217,7 @@ mi_interpreter_suspend (void *data)
static struct gdb_exception
mi_interpreter_exec (void *data, const char *command)
{
- char *tmp = alloca (strlen (command) + 1);
-
- strcpy (tmp, command);
- mi_execute_command_wrapper (tmp);
+ mi_execute_command_wrapper (command);
return exception_none;
}
@@ -309,7 +306,7 @@ mi_interp_query_hook (const char *ctlstr, va_list ap)
}
static void
-mi_execute_command_wrapper (char *cmd)
+mi_execute_command_wrapper (const char *cmd)
{
mi_execute_command (cmd, stdin == instream);
}