SIMH Obsolete Fixes =================== OBSOLETE FIXES -------------- The following modifications to the SCP framework are no longer used: 1. PROBLEM: The DO -E command continues to execute commands after a VM error. VERSION: 3.8-1 OBSERVATION: According to the manual, when invoking a DO command file and specifying the -E switch, "command processing (including nested command invocations) will be aborted if any error is encountered." Errors that occur as a result of commands, e.g., an invalid unit name supplied to the ATTACH command, correctly terminate the DO command. However, errors that occur when running the simulated CPU (e.g., a host I/O error) do not; the error is printed on the console, but the command file continues to execute. CAUSE: When the -E switch is specified, the DO command processor checks the return status from each command invoked and aborts execution of the command file if the return is not SCPE_OK. When a RUN, GO, STEP, CONT, or BOOT command is invoked, the run command processor calls the VM-provided instruction execution function to start the simulation. When simulation is stopped, the instruction executor returns a status code to indicate why execution has stopped. The reason might be a VM-defined condition (e.g., execution of a "halt" instruction) or a system condition (e.g., a host file system I/O error). The run command processor uses this code to print an error message, but then returns SCPE_OK to the caller. As the DO command processor never sees the error message, it continues to execute commands. RESOLUTION: Modify sim_defs.h to define SCPE_VMERROR and SCPE_VMSTOP as SCPE_BASE-1 and -2, respectively. Modify "run_cmd" (scp.c) to return either SCPE_VMSTOP (for all VM stops and for SCPE_STEP) or SCPE_ERROR (for all system errors). Modify the error checker "do_cmd" to continue if the return status is a VM stop and abort if it is a VM or system error. STATUS: Local patch created 2012-03-18. 3. ENHANCEMENT: Add commands to halt simulation after a specified delay when a given text string is output to the console and to specify a response string to use for the next console input. VERSION: 3.3-0 OBSERVATION: Many repetitive tasks, such as system boot-up, might be automated if SIMH could detect prompts from the simulated program and supply responses. This capability would be especially useful for automating long and tedious interactions, such as running diagnostics or system generations. While sophisticated third-party tools exist for this purpose (e.g., "expect"), many tasks require only simple prompt-and-response interactions. The SET CONSOLE HALT command halts execution of the simulated program when a specified string of characters have been seen in the console output stream. The syntax is: SET {-A}{-I} CONSOLE HALT= At the end of each output line (delineated by a line-feed character, octal 12), the line is searched for the presence of the specified . If the is present anywhere in the line, the simulated program is halted with a "Console halt" stop message. The message will be suppressed if the simulator RUN (or GO or CONTINUE or STEP) command originated in a DO command file that was not invoked with -V. If the -A ("anchored") switch is specified, the must start at the beginning of the output line for a successful match to occur. If the -I ("immediate") switch is specified, a successful match will occur as soon as the is seen in the output stream; matching is not delayed until the line-feed is seen. Control characters may be specified in the by the two-character escape sequence "~c", where "c" is the key that would be pressed with the CONTROL key. For example, "~m" would designate CONTROL-M (carriage return). To specify a literal "~", use "~~". A console halt condition remains in effect until replaced by another or until cancelled with: SET CONSOLE NOHALT The current console halt matching string may be displayed with: SHOW CONSOLE HALT The SET CONSOLE RESPONSE command specifies characters to be supplied to the program running under simulation as though they were typed at the console. The syntax is: SET CONSOLE RESPONSE= The response string may contain escaped control characters. The characters of the response string are supplied to the console terminal handler until the entire string is consumed. A pending console response may be cancelled with: SET CONSOLE NORESPONSE The pending console response may be displayed with: SHOW CONSOLE RESPONSE As the console is not buffered, a delay is typically required between the prompt output and the response input. When a successful console halt match occurs, the simulated program is halted after a delay specified by: SET CONSOLE DELAY= where is an instruction count. This delay is initially zero but generally must be set to allow the simulated program enough time to issue a read to the console before the response is supplied. If the delay is too short, the response characters will be lost. The current console halt delay may be displayed with: SHOW CONSOLE DELAY RESOLUTION: Modify "sim_console.c" to add the above commands. STATUS: Local patch created 2004-11-15. PROBLEM: A console halt occurs a second time if an anchored halt string occurs a second time in the output buffer. VERSION: 3.8-1 OBSERVATION: The RTE File Manager outputs a colon as a prompt character. Attempting to halt when the prompt appears with "set -a -i console halt=:" work as expected. However, if the line that is input in response also contains a colon, a second console halt occurs. This is unexpected, because the match should be anchored to the start of the line. CAUSE: The output buffer is cleared only when a line feed is output. The prompt writes a colon to the first character of the buffer, and this matches the halt criteria. When the program is resumed, characters 2-N are written to the buffer as they are echoed from the keyboard. When a second colon is entered, the criteria test is triggered, and because the first character still contains a colon, the halt criteria matches again. RESOLUTION: Change the anchored halt criteria test in sim_putchar and sim_putchar_s (sim_console.c) to test not only that the match string starts at the start of the output buffer, but also that the string lengths are equal. STATUS: Local patch created 2011-12-22. 4. ENHANCEMENT: Recast and generalize console halts as string breakpoints. VERSION: 3.9-0 OBSERVATION: A console halt causes a simulator stop when a specified string is output. This is analogous to a data breakpoint that causes a simulator stop when a specified memory location is read or written, or to a an instruction breakpoint that stops when a specified PC location is reached. Rather than having a separate command with special syntax, the BREAK command should be extended to accept string as well as numeric parameters. This would permit multiple string breakpoints to be active simultaneously and string breakpoints to have actions. At the same time, the command syntax should be improved to allow multiple strings in the same command and the output device unit to be specified. The old commands: SET {-A}{-I} CONSOLE HALT= SET CONSOLE DELAY= ...are recast to the single command: BREAK {} {AFTER=} {{[]}{,...}{;{;...}}} ...where specifies whose output is examined, specifies the number of event ticks that elapse before the stop occurs, is a string of characters to match that are enclosed in single (') or double (") quotes and may contain escapes of the form \", \', \r, \n, or \nnn (octal) that are replaced with their character representations, and specifies the number of times the string is matched before the stop occurs. If omitted, defaults to the console, defaults to 0 (i.e., the stop occurs immediately after the last character of the string is matched), and defaults to 1. Specifying BREAK AFTER with no quoted string sets a persistent simulator stop delay that is used for subsequent string BREAKs that do not specify an AFTER delay. Specifying BREAK AFTER with a quoted string sets the delay for that command only; subsequent BREAKs revert to the perisistent delay. The -A (anchored) and -I (immediate) switches are not supported directly by BREAK. String matches are always unanchored and immediate. Anchored mode may be emulated by specifying a leading "\r\n" in the match string. Deferred (non-immediate) matching may be emulated by specifying a trailing "\r\n" in the match string. To remove breakpoints, the old command: SET CONSOLE NOHALT ...is recast to: NOBREAK {} {{,...}} In this initial (re)implementation, only one string breakpoint may be active at a time, and must be omitted. The NOBREAK command accepts only an empty , which removes the string breakpoint. NOBREAK ALL also removes the string breakpoint. The SIMH 4.0 "EXPECT" command has an unintuitive name and uses an odd syntax but performs essentially the same operation. RESOLUTION: Modify "brk_cmd" (scp.c) to extend the BREAK and NOBREAK syntax to cover string breakpoints, and modify "sim_set_halt" and "sim_set_delay" (sim_console.c) to handle the extensions. STATUS: Local patches created 2017-10-??. 5. ENHANCEMENT: Generalize console replies. VERSION: 3.9-0 OBSERVATION: A console reply supplies characters to the console poll routine in lieu of keyboard input. To accommodate string breakpoints that may be set on disparate output units, the old command: SET CONSOLE RESPONSE= ...is recast to: REPLY {} {AFTER=} {} ...where specifies whose input is supplied, specifies the number of event ticks that elapse before the first character is input, and is a string of characters to supply that are enclosed in single (') or double (") quotes and may contain escapes of the form \", \', \r, \n, or \nnn (octal) that are replaced with their character representations. If omitted, defaults to the console, and defaults to 0 (i.e., the first character is supplied immediately after resuming simulation). Specifying REPLY AFTER with no quoted string sets a persistent simulator reply delay that is used for subsequent REPLYs that do not specify an AFTER delay. Specifying REPLY AFTER with a quoted string sets the delay for that command only; subsequent REPLYs revert to the perisistent delay. To clear a pending reply, the old command: SET CONSOLE NORESPONSE ...is recast to: NOREPLY {} In this initial (re)implementation, must be omitted from both commands. The SIMH 4.0 "SEND" command has an unintuitive name and uses an odd syntax but performs essentially the same operation. RESOLUTION: Add "reply_cmd" (scp.c) to extend the SET CONSOLE RESPONSE syntax. Modify "sim_set_response" and add "sim_set_after" (sim_console.c) to handle the extensions. STATUS: Local patches created 2017-10-??. ——————————————————————————————————————————————————————————————————————————————— xxx. PROBLEM: VERSION: 3.11-0 OBSERVATION: CAUSE: RESOLUTION: STATUS: Local patch created xxx. ENHANCEMENT: VERSION: 3.11-0 OBSERVATION: RESOLUTION: STATUS: Local patch created