While experimenting with switching on warnings for the rx simulator I
discovered this bug. In sim_do_command we get passed a 'const char *'
argument. We create a copy of this string to work with locally, but
then while processing this we accidentally switch back to reference
the original string.
sim/rx/ChangeLog:
* gdb-if.c (sim_do_command): Work with a copy of the command.
+2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb-if.c (sim_do_command): Work with a copy of the command.
+
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb-if.c (sim_memory_map): New function.
p++;
/* Find the extent of the command word. */
- for (p = cmd; *p; p++)
+ for (; *p != '\0'; p++)
if (isspace (*p))
break;
/* Null-terminate the command word, and record the start of any
further arguments. */
- if (*p)
+ if (*p != '\0')
{
*p = '\0';
args = p + 1;