From ad9cd1b51c79afb94b5815ddbbdc19f8fb01ee84 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 24 Apr 2012 12:16:38 -0700 Subject: [PATCH 01/45] Numerous Control Flow Fixes: Fixed do file line numbers in messages to properly track after nested do command files. Generalized do file command echoing to always include the do file line number Fixed SET ON which was broken when SET ON INHERIT and SET ON NOINHERIT was added. Fixed ON INHERIT behaviors for global ini files. Added SET QUIET and SET NOQUIET commands Added -Q flag to DO command file processing which sets quiet mode while that command file executes Changed generic include file name to simh.ini from simh.rc to be consistent with other include files Changed generic include file to come from the user HOME or HOMEPATH directory and if not found, the current default directory Fixed format string used to provide quotes around arguments containing spaces while producing %* expansion. Fixed return from do_cmd to return the status from the last command executed --- scp.c | 212 +++++++++++++++++++++++++++++++++-------------------- sim_defs.h | 1 + 2 files changed, 133 insertions(+), 80 deletions(-) diff --git a/scp.c b/scp.c index 5c80a8f6..cb919b73 100644 --- a/scp.c +++ b/scp.c @@ -408,8 +408,10 @@ 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_quiet (int32 flag, char *cptr); t_stat set_asynch (int32 flag, char *cptr); t_stat do_cmd_label (int32 flag, char *cptr, char *label); +void int_handler (int signal); /* Global data */ @@ -446,7 +448,7 @@ 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_goto_line[MAX_DO_NEST_LVL+1]; /* 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 */ @@ -455,6 +457,7 @@ 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 char *sim_do_label[MAX_DO_NEST_LVL+1]; static t_stat sim_last_cmd_stat; /* Command Status */ @@ -653,9 +656,13 @@ static CTAB cmd_table[] = { "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 verbose re-enables display of command file processed commands\n" "set noverify disables display of command file processed commands\n" + "set noverbose 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 quiet disables suppression of some output and messages\n" + "set noquiet re-enables suppression of some output and messages\n" "set OCT|DEC|HEX set device display radix\n" "set ENABLED enable device\n" "set DISABLED disable device\n" @@ -688,7 +695,7 @@ static CTAB cmd_table[] = { "sh{ow} {arg,...} show unit parameters\n" "sh{ow} on show on condition actions\n" }, { "DO", &do_cmd, 1, - "do {-V} {-O} {-E} {arg,arg...}\b" + "do {-V} {-O} {-E} {-Q} {arg,arg...}\b" " process command file\n" }, { "GOTO", &goto_cmd, 1, "goto