From 5ec4b3f2f460e6a9ad0328149b746b96823271b3 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 22 May 2020 10:12:11 -0700 Subject: [PATCH] SCP: Fix remote console command table ordering to have STEP near the beginning This allowed user entered S to match the SAMPLEOUT command instead of STEP. That then identified a bug in the intended socket output processing to attempt to be written to the undefined debug file. As discussed in #854 --- scp.c | 2 +- sim_console.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index d9b3c2c3..37696d87 100644 --- a/scp.c +++ b/scp.c @@ -13562,7 +13562,7 @@ int Fprintf (FILE *f, const char* fmt, ...) int ret = 0; va_list args; -if (sim_mfile || (f == sim_deb)) { +if (sim_mfile || (sim_deb && (f == sim_deb))) { char stackbuf[STACKBUFSIZE]; int32 bufsize = sizeof(stackbuf); char *buf = stackbuf; diff --git a/sim_console.c b/sim_console.c index 341f7e83..b62bc7b3 100644 --- a/sim_console.c +++ b/sim_console.c @@ -772,11 +772,11 @@ static CTAB allowed_master_remote_cmds[] = { { "ASSIGN", &assign_cmd, 0 }, { "DEASSIGN", &deassign_cmd, 0 }, { "CONTINUE", &x_continue_cmd, 0 }, + { "STEP", &x_step_cmd, 0 }, { "REPEAT", &x_repeat_cmd, 0 }, { "COLLECT", &x_collect_cmd, 0 }, { "SAMPLEOUT",&x_sampleout_cmd, 0 }, { "EXECUTE", &x_execute_cmd, 0 }, - { "STEP", &x_step_cmd, 0 }, { "PWD", &pwd_cmd, 0 }, { "SAVE", &save_cmd, 0 }, { "CD", &set_default_cmd, 0 },