diff --git a/scp.c b/scp.c index 779345c2..ace333cc 100644 --- a/scp.c +++ b/scp.c @@ -99,6 +99,7 @@ 27-Sep-04 RMS Fixed comma-separation options in set (David Bryan) 09-Sep-04 RMS Added -p option for RESET 13-Aug-04 RMS Qualified RESTORE detach with SIM_SW_REST + 17-Jul-04 JDB DO cmd file open failure retries with ".sim" appended 17-Jul-04 RMS Added ECHO command (Dave Bryan) 12-Jul-04 RMS Fixed problem ATTACHing to read only files (John Dundas) @@ -238,7 +239,7 @@ #define SSH_SH 1 /* show */ #define SSH_CL 2 /* clear */ -#define MAX_DO_NEST_LVL 10 /* DO cmd nesting level */ +#define MAX_DO_NEST_LVL 20 /* DO cmd nesting level */ #define SRBSIZ 1024 /* save/restore buffer */ #define SIM_BRK_INILNT 4096 /* bpt tbl length */ #define SIM_BRK_ALLTYP 0xFFFFFFFF @@ -400,8 +401,12 @@ t_stat dep_addr (int32 flag, char *cptr, t_addr addr, DEVICE *dptr, UNIT *uptr, int32 dfltinc); t_stat step_svc (UNIT *ptr); void sub_args (char *instr, char *tmpbuf, int32 maxstr, char *do_arg[]); +t_stat shift_args (char *do_arg[], size_t arg_count); t_stat set_on (int32 flag, char *cptr); +t_stat set_verify (int32 flag, char *cptr); +t_stat set_message (int32 flag, char *cptr); t_stat set_asynch (int32 flag, char *cptr); +t_stat do_cmd_label (int32 flag, char *cptr, char *label); /* Global data */ @@ -438,11 +443,15 @@ FILEREF *sim_log_ref = NULL; /* log file file referen FILE *sim_deb = NULL; /* debug file */ FILEREF *sim_deb_ref = NULL; /* debug file file reference */ static FILE *sim_gotofile; /* the currently open do file */ +static int32 sim_goto_line; /* the current line number in the currently open do file */ static int32 sim_do_echo = 0; /* the echo status of the currently open do file */ +static int32 sim_show_message = 1; /* the message display status of the currently open do file */ +static int32 sim_on_inherit = 0; /* the inherit status of on state and conditions when executing do files */ int32 sim_do_depth = 0; static int32 sim_on_check[MAX_DO_NEST_LVL+1]; static char *sim_on_actions[MAX_DO_NEST_LVL+1][SCPE_MAX_ERR+1]; +static char sim_do_filename[MAX_DO_NEST_LVL+1][CBUFSIZE]; static t_stat sim_last_cmd_stat; /* Command Status */ @@ -604,7 +613,9 @@ static CTAB cmd_table[] = { "set console DEL specify console delete char\n" "set console PCHAR specify console printable chars\n" "set console TELNET=port specify console telnet port\n" - "set console TELNET=LOG specify console telnet logging\n" + "set console TELNET=LOG=log_file\n" + " specify console telnet logging to the\n" + " specified destination {LOG,STDOUT,DEBUG or filename)\n" "set console TELNET=NOLOG disables console telnet logging\n" "set console TELNET=BUFFERED[=bufsize]\n" " specify console telnet buffering\n" @@ -613,10 +624,19 @@ static CTAB cmd_table[] = { "set console TELNET=UNBUFFERED\n" " disables console telnet buffering\n" "set console NOTELNET disable console telnet\n" - "set console LOG enable console logging\n" + "set console LOG=log_file enable console logging to the\n" + " specified destination {STDOUT,DEBUG or filename)\n" "set console NOLOG disable console logging\n" - "set console DEBUG enable console debugging\n" + "set console DEBUG=dbg_file\n" + " enable console debugging to the\n" + " specified destination {LOG,STDOUT or filename)\n" "set console NODEBUG disable console debugging\n" + "set log log_file specify the log destination\n" + " (STDOUT,DEBUG or filename)\n" + "set nolog disables any currently active logging\n" + "set debug debug_file specify the debug destination\n" + " (STDOUT,LOG or filename)\n" + "set nodebug disables any currently active debug output\n" "set break set breakpoints\n" "set nobreak clear breakpoints\n" "set throttle {x{M|K|%}}|{x/t}\n" @@ -625,6 +645,14 @@ static CTAB cmd_table[] = { "set asynch enable asynchronous I/O\n" "set noasynch disable asynchronous I/O\n" "set environment name=val set environment variable\n" + "set on enables error checking after command execution\n" + "set noon disables error checking after command execution\n" + "set on inherit enables inheritance of ON state and actions into do command files\n" + "set on noinherit disables inheritance of ON state and actions into do command files\n" + "set verify re-enables display of command file processed commands\n" + "set noverify disables display of command file processed commands\n" + "set message re-enables display of command file error messages\n" + "set nomessage disables display of command file error messages\n" "set OCT|DEC|HEX set device display radix\n" "set ENABLED enable device\n" "set DISABLED disable device\n" @@ -634,8 +662,6 @@ static CTAB cmd_table[] = { "set ENABLED enable unit\n" "set DISABLED disable unit\n" "set arg{,arg...} set unit parameters (see show modifiers)\n" - "set on enables error checking after command execution\n" - "set noon disables error checking after command execution\n" }, { "SHOW", &show_cmd, 0, "sh{ow} br{eak} show breakpoints\n" @@ -659,15 +685,25 @@ static CTAB cmd_table[] = { "sh{ow} {arg,...} show unit parameters\n" "sh{ow} on show on condition actions\n" }, { "DO", &do_cmd, 1, - "do {arg,arg...} process command file\n" }, + "do {-V} {-O} {-E} {arg,arg...}\b" + " process command file\n" }, { "GOTO", &goto_cmd, 1, "goto