Commit graph

658 commits

Author SHA1 Message Date
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
Mark Pizzolato
8f3e6438a3 SCP: Added the NEXT command. This command provides the ability for a simulator to step over subroutine calls. 2014-04-14 14:22:18 -07:00
Mark Pizzolato
e63fbdce49 SCP: Fix SHOW DEBUG device debug flags output for devices which may have debug settings which set multiple flags. 2014-04-02 04:49:33 -07:00
Mark Pizzolato
6ce8d99cd8 SCP: Added generic output routine sim_printf to output to stdout and sim_log (and sim_deb when enabled)
The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.

Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
2014-03-28 08:20:05 -07:00
Mark Pizzolato
98ac7af6fa PDP11, VAX: Fix differencing virtual disk corruption during creation problems 2014-03-16 01:11:35 -07:00
Mark Pizzolato
9022de500d SCP: Removed the irrelevant sim_deb_PC variable since it duplicates the role sim_PC simulator variable. 2014-03-05 12:53:32 -08:00
Mark Pizzolato
02cb5c2d88 Compiler suggested cleanups.
Mostly silencing noise warnings, but bugs were found in sim_console.c and pdp11_dmc.c
2014-02-14 17:07:45 -08:00
Mark Pizzolato
59d0602b0d PDP8: Add device buffer flush capability and keep track of data written state in the device buffer. Fixes #87
Finishing the last DECtape device which was missed when this functionality was added to pdp11_dt, pdp18b_dt and pdp8_dt
in commits: 2934112a70 and c9e8121c16

Cleaned up the pdp11, pdp18b and other pdp8 implementations to make backporting cleaner.
Made sure that buffer flushing happens correctly when simulation returns to the sim> prompt.
2014-02-12 21:08:18 -08:00
Mark Pizzolato
9068ea0e8e SCP: Fleshing out more of the hierarchical help content. 2014-02-11 14:24:45 -08:00
Mark Pizzolato
545aa85677 SCP: Cleaned up the hierarchical help APIs to follow the same indentation style used in the rest of scp.c. Fixed the help prompt to avoid adding an extra level to the prompt when the current level has no children. 2014-02-10 17:25:07 -08:00
Mark Pizzolato
afcbea251d SCP: Add SHOW -C BREAK to display the currently defined breakpoints as commands which can be used to redefine them later.
Note: This excludes the possibility of there being a -C breakpoint type.  Since there are potentially 26 different breakpoint types, this exclusion is not likely to have a significant impact.
2014-02-07 06:32:21 -08:00
Mark Pizzolato
8d09ebec8b Compiler indicated cleanups to Fix #105 2014-02-05 13:44:36 -08:00
Mark Pizzolato
da134ebb2a SCP: Added detailed help (including switches) for SET DEBUG command and an auto flush of the debug output when instruction execution stops. 2014-02-04 15:45:26 -08:00
Mark Pizzolato
eaae19463c SCP: Initial merge of old style single line help with hierarchical help 2014-02-01 07:04:44 -08:00
Mark Pizzolato
18451806b7 SCP: Added default simulator specific initialization file to be in the current working directory if one isn't found where the simulator binary is located (suggested by Jordi Guillaumes Pons in #101). 2014-01-23 05:15:54 -08:00
Mark Pizzolato
c64aabf51f SCP: Fix for %DATE_WW% and %DATE_WYYYY% computation on the first days of a year after a leap year. 2014-01-16 07:40:35 -08:00
Mark Pizzolato
e1b0a416a9 SCP: Generalized DATE and TIME variable insertion adding support for ISO 8601 date values. Inspired by Christian Gauger-Cosgrove.
ISO 8601 support without requiring C99 strftime functionality.

          %DATE%                yyyy-mm-dd
          %TIME%                 hh:mm:ss
          %DATETIME%       yyyy-mm-ddThh:mm:ss
          %LDATE%               mm/dd/yy (Locale Formatted)
          %LTIME%               hh:mm:ss am/pm (Locale Formatted)
          %CTIME%               Www Mmm dd hh:mm:ss yyyy (Locale Formatted)
          %DATE_YYYY%     yyyy              (0000-9999)
          %DATE_YY%          yy                  (00-99)
          %DATE_MM%       mm               (01-12)
          %DATE_DD%         dd                  (01-31)
          %DATE_WW%       ww                 (01-53)     ISO 8601 week number
          %DATE_WYYYY%  yyyy              (0000-9999) ISO 8601 week year number
          %DATE_D%            d                    (1-7)       ISO 8601 day of week
          %DATE_JJJ%           jjj                   (001-366) day of year
          %TIME_HH%         hh                  (00-23)
          %TIME_MM%        mm               (00-59)
          %TIME_SS%            ss                  (00-59)
2014-01-11 11:13:25 -08:00
Mark Pizzolato
fd4a3acbad Avoid NULL pointer dereference when examining a device with no units. #95 2014-01-09 12:03:51 -08:00
Mark Pizzolato
2ea8a0a30f SCP: Changed command processing variable insertion to format %DATE% as yyyy-mm-dd instead of yyyy/mm/dd and added %STIME% to produce hh_mm_ss. 2014-01-08 12:47:33 -08:00
Mark Pizzolato
2bb502ee64 SCP: Static Analyzer cleanups suggested by Peter Schorn 2013-12-27 07:08:17 -08:00
Mark Pizzolato
7b3e508627 ETHER: Added capability to build working networking support without pcap packet transport (i.e. only using one of the other available packet transports: VDE, TAP, UDP, etc.) 2013-12-19 09:45:51 -08:00
Mark Pizzolato
00afa58bc4 SCP: Added hierarchical help capability (from Timothe Litt) 2013-11-22 06:08:03 -08:00
Mark Pizzolato
e65aa904e7 SCP: Fix various missing log output 2013-11-20 15:09:43 -08:00
Mark Pizzolato
2e85e74699 SCP: Various cleanups.
- Avoid assignments of void * values.  Cast all memory allocation return values to appropriate types.
- Add output to sim_log where missing in various places.
- Fixed issue with lost file positions after a restore for devices which leverage the UNIT_SEQ flag.
2013-11-20 09:13:27 -08:00
Mark Pizzolato
864f0e0d37 SCP: Show device options can be more flexibly formatted and optionally not display anything. 2013-11-16 18:14:09 -08:00
Mark Pizzolato
600d6f5962 SCP: Added a mechanism to allow debugging output to display PC values for simulators which don't have a simple register which contains the PC value. 2013-11-14 10:41:49 -08:00
Mark Pizzolato
b4b274c446 More compiler warnings 2013-11-05 16:55:30 -08:00
Mark Pizzolato
fdb33ce135 Compiler warning cleanup 2013-11-05 16:42:17 -08:00
Mark Pizzolato
b85af46402 SCP: Fixed 'rest of line' argument substitution %* 2013-11-05 10:35:37 -08:00
Mark Pizzolato
f5cfa392d7 SCP: Allow bare % not followed by a digit or a alpha character to be kept while substituting arguments and environment variables in simulator commands. 2013-11-05 10:06:46 -08:00
Mark Pizzolato
6b45d9b2ad SCP/VIDEO: Added support for libSDL2 video capabilities. Changed existing video layer to carry pixels as 32bpp vs 8bpp for more natural behaviors in libSDL2. 2013-10-01 15:55:10 -07:00
Mark Pizzolato
351d748b4a VIDEO: Move all SDL graphics activities to the background video thread 2013-09-26 12:38:17 -07:00
Mark Pizzolato
daed1e576f VAX/QVSS: Proper linking on OSX 2013-09-25 16:39:51 -07:00
Mark Pizzolato
da227959de SCP: Fix HELP SET <device> to properly output to sim_log when logging. Reported in issue #71 2013-09-06 10:02:02 -07:00
Mark Pizzolato
c0bf9073d9 SCP: Added help display for units which can be enabled and disabled 2013-09-05 12:10:59 -07:00
Mark Pizzolato
8555bbb323 SCP: Fix Set Command dispatching and HELP dev SET output
- Fixed set MTAB dispatching to not dispatch to unit specific routines when only a device is specified in the command
 - Fixed HELP dev SET output to avoid displaying SET commands which aren't valid for SHOW only cases
2013-08-23 17:29:32 -07:00
Mark Pizzolato
18461f510b sim_debug: Fixed to produce output when the format string is a bare newline character.
Fixed bitfield output to properly present the prefix when appropriate.

This closes issue #62
2013-08-21 15:00:01 -07:00
Mark Pizzolato
60fbaab9ce Fix time_t complaint when struct timespec doesn't have a time_t seconds value 2013-07-15 05:08:44 -10:00
Mark Pizzolato
572ed3437a Optionally Enriched the info displayed at the beginning of debug message lines as discussed in Issue #66
sim> set debug -r -a -t -p somefile

    -a   produces seconds.msec time format
    -t    produces hh:mm:ss.msec time format
    -r    causes time values displayed to be relative to the wall clock time when the 'set debug' command was issued
    -r   by itself will cause default of -t

    -a and -t can both be specified if desired

    -p   adds display of current PC value to the debug timestamp output

sim> show debug
2013-07-15 04:38:54 -10:00