Commit graph

296 commits

Author SHA1 Message Date
Mark Pizzolato
d615bd0f58 SCP: Only report DO file context when run_cmd completes if the completion status is not a simulator specific error code and not due to a STEP, EXPECT or STOP completion.
The commands which operate through run_cmd (GO, STEP, CONTINUE, BOOT, RUN) will all exit with a status which is NOT SCPE_OK.  Most of the exit status values will be 100% normal and not indicative of a true error, so producing error message context is not necessary or desired.
2015-01-08 22:10:31 -08:00
Mark Pizzolato
3fe61c53a5 SCP: Provide an API to display alternate error message text while returning SCPE status. 2015-01-08 22:10:30 -08:00
Mark Pizzolato
de9fc84fd4 SCP: added flexibility to search specifier parsing to fallback to register value format if the VM supplied parse_sym() doesn't handle the value provided. 2014-12-29 14:03:43 -08:00
Mark Pizzolato
9e1e32584b SCP: Avoid redundant log and debug output 2014-12-29 03:41:32 -08:00
Mark Pizzolato
1d530cc48d SCP: Enhanced ASSERT/IF to support expressions which test memory contents. Also enhanced EXAMINE's search capabilities to be able to match multi-byte patterns for VMs which are byte addressable. 2014-12-25 06:19:59 -08:00
Mark Pizzolato
47a0576f09 SCP: Revert prior commit since it was the wrong approach 2014-12-25 06:15:52 -08:00
Mark Pizzolato
0a96584fdf SCP: Added special EXAMINE reference variable "$" usable in conditional expression for the ASSERT and IF commands 2014-12-23 03:09:40 -08:00
Mark Pizzolato
88d644258e SCP: Allow the VM to print simulator stop message information in lieu of, or in addition to, the default message.
The current implementation of "run_cmd" in scp.c calls "fprint_stopped_gen" (via "fprint_stopped") to print the message associated with the "sim_instr" return status.  Messages associated with VM stops must be provided to the SCP via the "sim_stop_messages" array.

"fprint_stopped_gen" prints the status message in a rigid format: the message string, a comma, the program counter register name, a colon, the current PC value, and the instruction at that address in symbolic format.

For example:

       HALT instruction, P: 24713 (LDA 1)

Only the message string is under the control of the VM.  If additional information is needed, it can only be added before the first comma.

The HP2100 simulator does this for halt instructions, which contain device select code and flag hold/clear bit fields that, in practice, are used to communicate to the operator the significance of the particular halt encountered, rather than to affect the device interface:

       HALT instruction 102077, P: 24713 (LDA 1)

To implement this, the simulator must define the message as a variable and then copy the formatted octal value into the buffer at the appropriate location before returning from "sim_instr".

However, if the VM wants to display a different register value, e.g.:

       Self test #13 complete, STAT: 000020

...this cannot be done without also displaying the program counter, which may be irrelevant for the given stop condition.
2014-12-18 11:16:27 -08:00
Mark Pizzolato
42e7d48c82 SCP: Fixes Cannot show radix, etc. for a device that has no modifiers and SET and SHOW responses for invalid entry are inconsistent. from Dave Bryan
001. PROBLEM:  Cannot show radix, etc. for a device that has no modifiers.

     OBSERVATION:  The default data radix for a device may be set with the SET
     <dev> OCT|DEC|HEX command.  However, if the device does not have a modifier
     table, SHOW <dev> RADIX is rejected with "No settable parameters".

     The same problem occurs for SHOW <dev> DEBUG and SHOW <dev> NAMES.  For a
     device that provides debug printouts, SHOW <dev> MOD will list "DEBUG,
     NODEBUG" among the modifiers, and the SHOW <dev> DEBUG command will display
     the current debug status.  However, if the device does not contain a
     modifier table, SHOW <dev> MOD and SHOW <dev> DEBUG will report "No
     settable parameters", even though SET <dev> DEBUG is accepted and works as
     expected.  For such a device, SHOW MOD will show "DEBUG, NODEBUG" as
     acceptable modifiers.

002. PROBLEM:  SET and SHOW responses for invalid entry are inconsistent.

     OBSERVATION:  Entering SET <dev> <mod> where <mod> is not defined in the
     device's modifier table displays "Non-existent parameter."  Entering SHOW
     with the same parameters displays "Invalid argument."

     Similarly, entering SET <dev> DEBUG for a device that does not have
     debugging capability displays "Command not allowed."  Entering SHOW with
     the same parameters displays nothing.

     In both cases, the messages displayed should be the same for the same
     error.
2014-12-17 21:00:38 -08:00
Mark Pizzolato
e87d40c600 SCP: Add a -Q option to ATTACH -R and ATTACH -N to suppress success status messages. From Dave Bryan 2014-12-17 20:21:17 -08:00
Mark Pizzolato
95740f1f2d SCP: Add a "-N" (new file) option to the SET LOG and SET DEBUG commands. From Dave Bryan. 2014-12-17 20:07:28 -08:00
Mark Pizzolato
03800ae725 SCP: Stop calls VM-provided address printer for PC without REG_VMAD from Dave Bryan
OBSERVATION:  For a simulator stop, sim_vm_fprint_addr (if defined) is
     called to print the value of the program counter, regardless of whether or
     not the register was defined with REG_VMAD.  However, displaying the PC
     value with "examine" calls sim_vm_fprint_addr only if the REG_VMAD flag is
     present.  The displayed value of the PC should be the same in both cases.
2014-12-16 09:02:57 -08:00
Mark Pizzolato
e35081db1f SCP: Avoid duplicate output when run_cmd completes just as is done in sim_printf() 2014-12-16 07:56:21 -08:00
Mark Pizzolato
4f41c53674 SCP: Fixed potential out of bounds array reference while expanding command arguments.
Avoid race condition while producing debug header output from multiple threads.
2014-12-14 13:21:32 -08:00
Mark Pizzolato
d1b5e3aa27 SCP: Add the # character at the beginning of a line as a comment character. Requested by Kevin Handy 2014-12-05 16:29:17 -08:00
Mark Pizzolato
1f20041b58 SCP: Added expansion of special built-in environment variable DATE_YC which is the century of the current date. 2014-12-03 10:39:19 -08:00
Mark Pizzolato
cd9a499c94 SCP: Fixed EXPECT processing to properly cleanup after matches. Added display of expect buffer to SHOW EXPECT and extended expect match debugging output. 2014-12-03 09:58:31 -08:00
Mark Pizzolato
45859ffe34 SCP: Fixed SEND command to properly support a bare AFTER=n argument. 2014-12-03 07:36:53 -08:00
Mark Pizzolato
4eed007607 SCP: Restructured timer/co-scheduling activities to support co-scheduling on specific timers 2014-12-02 05:33:59 -08:00
François Revol
a0c7f99a5e scp: avoid redefining MAX
On Haiku, we end up including <sys/param.h> from sim_sock.h which
defines MAX.
2014-11-10 20:58:56 +01:00
Mark Pizzolato
94486c1286 SCP: Updated documentation and help text 2014-10-31 05:13:55 -07:00
Mark Pizzolato
a4c50567d7 Compiler suggested cleanup. 2014-10-29 09:17:07 -07:00
Mark Pizzolato
4938c02d95 SCP: Fixed expect match checking when testing regular expressions to avoid NUL bytes in the output stream.
This is necessary since the RegEx api only takes simple C NUL terminated strings.
2014-10-29 00:46:50 -07:00
Mark Pizzolato
6368a217fb SCP: Fixed SET and SHOW command parsing to more generally allow value operations against the default device (CPU) both with and without value oriented modifiers 2014-10-28 08:39:14 -07:00
Mark Pizzolato
c548b34772 Compiler suggested cleanups. 2014-10-27 17:14:28 -07:00
Mark Pizzolato
2e1167d4a0 Compiler suggested cleanups - mostly const fixups 2014-10-26 17:06:24 -07:00
Mark Pizzolato
4dbac410da SCP: Added const declarations to various APIs to reflect the appropriate usage. Moved parameter values for run_cmd and exdep_cmd to scp.h 2014-10-26 14:52:22 -07:00
Mark Emmer
f6e750471a SCP: Fix SEND <dev>:line when after=nn and delay=nn not specified
For a command like:  SEND MUX:0 "abc"
in which a device is specified but there are no after=nn and delay=nn parameters, the code neglected to update cptr, resulting in an illegal argument error condition.
2014-10-26 13:42:49 -06:00
Mark Pizzolato
b4fb149b8d SCP: Fix help text for expect command. 2014-10-25 15:21:55 -07:00
Mark Pizzolato
e8358703be SCP: Fix NOEXPECT to actually delete a single indicated expect rule. Allow expect actions to be provided. Fix match buffer management when expect regular expressions are in use. 2014-10-25 11:14:36 -07:00
Mark Pizzolato
ebf4e0cb64 SCP: Add support for legacy form of console expect and send string commands (from Dave Bryan) 2014-10-23 05:58:43 -07:00
Mark Pizzolato
3256c10c77 General cleanup migrate to using sim_printf vs separate calls to printf and fprintf(sim_log). 2014-10-22 17:12:14 -07:00
Mark Pizzolato
bff7521c56 SCP: Migrate more output written to sim_log to use sim_printf. 2014-10-22 13:25:42 -07:00
Mark Pizzolato
6c5a700191 SCP: Added numeric value comparisons to IF and ASSERT compares.
Compare operations will do a literal compare of basic string values unless the all of each string contains numeric data.  If numeric data is there then a numeric comparison will be made.  For example:

	If "+1" == "1" echo equal

will display equal, while the simple string comparison will be not-equal.
2014-10-22 11:54:08 -07:00
Mark Pizzolato
1f9d21ad2e SCP: Added IF command and string comparision behaviors to the ASSERT and IF command operations. 2014-10-22 11:28:28 -07:00
Mark Pizzolato
916bab3c2a SCP: Cleaned up help for EXPECT and SEND commands. Added optional case insensitive match option to regular expression EXPECT rules. 2014-10-22 11:27:38 -07:00
Mark Pizzolato
5a4bbbad8d SCP: Extended EXPECT and SEND to have more flexible activation delays
- EXPECT will now tolerate a HALTAFTER=n parameter which delay the simulator stopping execution for n instructions.  Unpredictable behavior will happen if multiple EXPECT conditions see matching data before the first actualy halt occurs.
- SEND has an AFTER=n argument which delays the initial stuffed data from being input for at least n instructions.  It also has a DELAY=m argument which specifies the minimum number of instructions which must execute between stuffed input data.
- Changed run_cmd() to no longer clear pending breakpoint actions before starting instruction execution.
- Added a -Q switch to the commands which dispatch through run_cmd() (RUN, STEP, NEXT, GO, BOOT, etc.).  This switch will suppress status output when execution stops.  This will allow sequences of breakpoint action commands to silently execute when needed.
2014-10-20 16:47:33 -07:00
Mark Pizzolato
5af6210ed9 SCP: Add RegEx support to EXPECT string processing 2014-10-20 04:42:25 -07:00
Mark Pizzolato
ddc29fb2c9 SCP: Added debugging support for EXPECT and SEND activities. Fixed SEND buffer queuing bug. 2014-10-17 11:34:06 -07:00
Mark Pizzolato
02e90de6a4 SCP: Added EXPECT and SEND commands to react to data from and inject data into the simulated console port (and other MUX ports)
Ideas based on Dave Bryan's console halt efforts.

	sim> SEND {<mux>:line} {DELAY=n,}"string"

Where <mux> is the name of the device pointed to by the TMXR structure.  If <mux>:line isn't specified, then the console device is implicitly being referenced.
Delay is optional and once set persists for subsequent SEND operations to the same device.  Delay defaults to 1000.  The DELAY value is a minimum number of instructions which must execute before the next character in the provided string will be injected to the console port.  The DELAY value has effect between the characters delivered as well.  "string" requires quotes and within the quoted string, common C escape character syntax is available (\r\r\t, etc.).

Each device (console, and each line in each mux) has a separate value for DELAY.

An arbitrary number of 'expect' conditions can be defined.  The command syntax is:

              sim> EXPECT {<mux>:line} {[cnt]} "matchstring" {actioncommand {; actioncommand ...}}

Where <mux> is the name of the device pointed to by the TMXR structure.  If <mux>:line isn't specified, then the console device is implicitly being referenced.
"matchstring" requires quotes and within the quoted string, common C escape character syntax is available (\r\r\t, etc.).  The quotes used can be single or double quotes, but the closing quote must match the opening quote.  The match string might be extended to allow the use of perl style regular expressions in the "matchstring" when a -R switch is specified on the command line.

              sim> EXPECT "Enter Color: "  SEND "Red\r"; g

A specific 'expect' condition can be removed with:

              sim> NOEXPECT {<mux>:line} "matchstring"

All 'expect' conditions can be removed with:

              sim> NOEXPECT {<mux>:line}

'expect' conditions can be examined with:

              sim> SHOW EXPECT {<mux>:line}

Expect rules are one-shots (i.e. they disappear once a match has occurred) unless they are explicitly described as persistent with the -P switch.
The -C switch is available when defining expect rules.  The effect of a rule defined with the -C flag is that when an expect match occurs for that rule, ALL rules are cleared for that device (console or <mux>:line).
2014-10-14 10:49:24 -07:00
Mark Pizzolato
d0865d37f5 SCP: Fix recently revised breakpoint setup to behave properly breakpoint action is NULL 2014-10-11 04:19:15 -07:00
Mark Pizzolato
0b1050853e SCP: Allow for the potential of a breakpoint action to remove the establishing breakpoint while still completing pending actions 2014-10-10 08:03:22 -07:00
Mark Pizzolato
f355749eb5 SCP: Provide a way to display an arbitrary buffer contents as hex in debug output 2014-09-17 09:08:12 -07:00
Mark Pizzolato
1e0b83ca10 SCP: Avoid building sim_video code when it isn't used by a simulator.
This results in smaller simulator binaries.
2014-09-16 11:05:31 -07:00
Mark Pizzolato
b8dc8f01b5 SCP: Fix to have sim_printf expand newlines to CRLF when writing to stdout with the simulator running. Allow sim_debug to be called with a NULL device pointer and return producing no output. 2014-09-16 09:18:57 -07:00
Mark Pizzolato
2c0cedcc9c PDP11, VAX: Added ability to set the size of RAUSER devices to be n binary MB (1024*1024) with the -B switch. Added SHOW -B to display drive capacities in binary MB using the SHOW -B switch. 2014-05-16 15:13:56 -07:00
Mark Pizzolato
f4771affe7 SCP: Fix SET VERIFY which didn't work while processing command procedures 2014-05-16 05:49:42 -07:00
Mark Pizzolato
e8114cf088 SCP: Fix errant display of NEXT warning on first STEP command. From Peter Schorn
Better display in SHOW VERSION of full compiler name on OSX when using the clang LLVM compilers
Change stray non-ascii quote characters in comments.
2014-04-18 04:58:27 -07:00
Mark Pizzolato
92e3acb2f3 SCP: Added the rest of the NEXT command repeat count support. 2014-04-17 13:17:14 -07:00
Mark Pizzolato
7fc8922a48 SCP: Added a repeat count for the NEXT command 2014-04-17 13:07:01 -07:00