+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * remote-sim.h (sim_do_command): Add const to cmd.
+
2014-03-05 Alan Modra <amodra@gmail.com>
Update copyright notice.
Simulators should be prepared to deal with any combination of NULL
or empty CMD. */
-void sim_do_command (SIM_DESC sd, char *cmd);
+void sim_do_command (SIM_DESC sd, const char *cmd);
/* Complete a command based on the available sim commands. Returns an
array of possible matches. */
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * wrapper.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* wrapper.c (sim_load): Add const to prog.
void
sim_do_command (sd, cmd)
SIM_DESC sd ATTRIBUTE_UNUSED;
- char *cmd ATTRIBUTE_UNUSED;
+ const char *cmd ATTRIBUTE_UNUSED;
{
(*sim_callback->printf_filtered)
(sim_callback,
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_load): Add const to prog.
}
void
-sim_do_command (SIM_DESC sd, char *cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
{
/* Nothing there yet; it's all an error. */
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-command.c (sim_do_command): Add const to cmd.
+ * sim-options.c (sim_args_command): Add const to cmd.
+ * sim-options.h (sim_args_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* sim-hload.c (sim_load): Add const to prog.
which add custom options via sim_add_option_table(). */
void
-sim_do_command (SIM_DESC sd, char *cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
{
if (sim_args_command (sd, cmd) != SIM_RC_OK)
sim_io_eprintf (sd, "Unknown sim command: \"%s\". Try \"sim help\".\n",
}
SIM_RC
-sim_args_command (SIM_DESC sd, char *cmd)
+sim_args_command (SIM_DESC sd, const char *cmd)
{
/* something to do? */
if (cmd == NULL)
/* Try to parse the command as if it is an option, Only fail when
totally unsuccessful */
-SIM_RC sim_args_command (SIM_DESC sd, char *cmd);
+SIM_RC sim_args_command (SIM_DESC sd, const char *cmd);
#endif /* SIM_OPTIONS_H */
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_load): Add const to prog.
void
sim_do_command (sd, cmd)
SIM_DESC sd;
- char *cmd;
+ const char *cmd;
{
(*cr16_callback->printf_filtered) (cr16_callback, "sim_do_command: %s\n",cmd);
}
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_load): Add const to prog.
void
sim_do_command (sd, cmd)
SIM_DESC sd;
- char *cmd;
+ const char *cmd;
{
(*d10v_callback->printf_filtered) (d10v_callback, "sim_do_command: %s\n",cmd);
}
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * interf.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* interf.c (sim_load): Add const to prog.
void
sim_do_command(sd, cmd)
SIM_DESC sd;
- char *cmd;
+ const char *cmd;
{
exec_cmd(&sregs, cmd);
}
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * gdb-if.c (sim_do_command): Add const to cmd. Move args
+ to top and add const. Call strdup on cmd and free at end.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* gdb-if.c (sim_load): Add const to prog.
}
void
-sim_do_command (SIM_DESC sd, char *cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
{
- check_desc (sd);
+ const char *args;
+ char *p = strdup (cmd);
- char *p = cmd;
+ check_desc (sd);
/* Skip leading whitespace. */
while (isspace (*p))
/* Null-terminate the command word, and record the start of any
further arguments. */
- char *args;
if (*p)
{
*p = '\0';
else
printf ("The 'sim' command expects either 'trace' or 'verbose'"
" as a subcommand.\n");
+
+ free (p);
}
char **
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_load): Add const to prog.
void
sim_do_command (sd, cmd)
SIM_DESC sd;
- char * cmd;
+ const char *cmd;
{
/* Nothing there yet; it's all an error. */
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_load): Add const to prog.
}
void
-sim_do_command (SIM_DESC sd, char * cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
{
/* Nothing there yet; it's all an error. */
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_load): Add const to prog.
void
sim_do_command (sd, cmd)
SIM_DESC sd;
- char * cmd;
+ const char *cmd;
{
if (sim_args_command (sd, cmd) != SIM_RC_OK)
sim_io_printf (sd,
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * sim_calls.c (sim_do_command): Add const to cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* sim_calls.c (sim_load): Add const to prog.
}
void
-sim_do_command (SIM_DESC sd, char *cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
{
TRACE(trace_gdb, ("sim_do_commands(cmd=%s) called\n",
cmd ? cmd : "(null)"));
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * gdb-if.c (sim_do_command): Add const to cmd. Move args
+ to top and add const. Call strdup on cmd and free at end.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* gdb-if.c (sim_load): Add const to prog.
command. */
void
-sim_do_command (SIM_DESC sd, char *cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
{
- char *args;
+ const char *args;
+ char *p = strdup (cmd);
check_desc (sd);
}
else
{
- char *p = cmd;
-
/* Skip leading whitespace. */
while (isspace (*p))
p++;
else
printf ("The 'sim' command expects either 'trace' or 'verbose'"
" as a subcommand.\n");
+
+ free (p);
}
/* Stub for command completion. */
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * gdb-if.c (sim_do_command): Add const to cmd. Move args
+ to top and add const. Call strdup on cmd and free at end.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* gdb-if.c (sim_load): Add const to prog.
}
void
-sim_do_command (SIM_DESC sd, char *cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
{
- check_desc (sd);
+ const char *args;
+ char *p = strdup (cmd);
- char *p = cmd;
+ check_desc (sd);
/* Skip leading whitespace. */
while (isspace (*p))
/* Null-terminate the command word, and record the start of any
further arguments. */
- char *args;
if (*p)
{
*p = '\0';
else
printf ("The 'sim' command expects either 'trace' or 'verbose'"
" as a subcommand.\n");
+
+ free (p);
}
char **
+2014-03-10 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (parse_and_set_memory_size): Add const to str.
+ (sim_do_command): Add const to cmd and sms_cmd.
+
2014-03-05 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_load): Add const to prog.
#define UNDEF(x)
#endif
-static void parse_and_set_memory_size (char *str);
+static void parse_and_set_memory_size (const char *str);
static int IOMEM (int addr, int write, int value);
static struct loop_bounds get_loop_bounds (int, int, unsigned char *,
unsigned char *, int, int);
static void
parse_and_set_memory_size (str)
- char *str;
+ const char *str;
{
int n;
void
sim_do_command (sd, cmd)
SIM_DESC sd;
- char *cmd;
+ const char *cmd;
{
- char *sms_cmd = "set-memory-size";
+ const char *sms_cmd = "set-memory-size";
int cmdsize;
if (cmd == NULL || *cmd == '\0')