Commit graph

850 commits

Author SHA1 Message Date
Mark Pizzolato
9cb93a64f2 SCP: Slow down debug output writes when the debug fd is non blocking
This problem only appears when debug output is prodigious.  That
prodigious activity is already dramatically affecting timing, so adding
additional delays to allow the debug output to catch up won't
make anything worse.

It appears that we could jump over the C runtime implementation of
fwrite() and do an explicit write() system call and retry that until it
succeeds, but this approach would have two negative consequences:
1) it would jump over other buffered data that the C runtime fwrite()
    may have pending due to output produced by other than debug
    activities, thus emitting output out of order.
2) Windows doesn't have a direct system call used by its C runtime
    for write(), but merely implements write() as part of the C runtime
    and as it turns out that write() returns an int vs a ssize_t type
    result.  An explicit cast could address this, but point 1 would still
    be a concern.

As discussed in #957
2020-11-16 11:09:23 -08:00
Mark Pizzolato
b0ac93294e SCP: Add FLUSH_INTERVAL register to override the default 30 second buffer flush
As indirectly discussed for debug output to a file in #957
2020-11-15 14:28:25 -08:00
Mark Pizzolato
ba5e18e963 SCP: Assure that debug output is aways completely written via fwrite
Previously, the status returned by fwrite() while writing debug output
was ignored and all debug output was presumed to be correctly written.

This change tolerates incomplete writes performed by the C runtime
and retries the remaining writes as long as the retries take.

This change completely presumes that the C runtime fwrite() returns
correct information when the data has not been completely written.
That of course will likely depend on the OS level write function
returning correct informatoin from the write() system call that
fwrite() depends on.

Timing concerns while emitting debug output have always been a
problem since even composing any debug output is likely to be much
more work than basic instruction execution off the current single
instruction.  Clock calibration probably will be fundamentally unreliable.

As discussed in #957
2020-11-13 22:29:32 -08:00
Mark Pizzolato
f9ce5ae8ff SCP: Add whitespace ignore option to file and string content comparisons 2020-11-01 16:27:47 -08:00
Mark Pizzolato
462f5a51b8 SCP: Extend file compare functionality to expose where file differences start 2020-11-01 14:58:47 -08:00
Mark Pizzolato
6748a2c66f SCP: Extend TYPE/CAT command to support offset and line count limit 2020-11-01 14:54:12 -08:00
Mark Pizzolato
ddcc280a17 CONSOLE: Add binary mode option when opening the LOG file. 2020-11-01 09:47:22 -08:00
Mark Pizzolato
9c1f4beae3 SCP: Migrate to use SCP internal timer base reference 2020-10-29 13:06:36 -07:00
Mark Pizzolato
37f2b341d0 SCP: Fix compiler warning about unused variable. 2020-10-27 12:53:40 -07:00
Mark Pizzolato
33e3e7f493 SCP: Fix event dispatching when sim_interval is negative
- When sim_interval is negative (vs 0), more "time" has passed than
  when the first unit event on the queue was supposed to fire.  To
  properly handle this and dispatch this and other events which should
  have fired, time is temporarily backed up to when it was supposed
  to have fired and the event is dispatched.  If it schedules other
  events those will then properly be scheduled relative to the time is
  has fired.  This approach avoids events slipping forward in time.
- Add unit test to exercise event dispatching activities.
2020-10-27 08:33:24 -07:00
Mark Pizzolato
dceadb393e SCP: Add internal & cross platform support for tar and curl commands 2020-10-20 02:50:34 -07:00
Mark Pizzolato
c8a8cca7a3 SCP: Add optional per line multiplexer log files to periodic flushing 2020-10-20 02:47:33 -07:00
Mark Pizzolato
f1a513b8bf SCP: Expedite simulator detection of WRU delivery by signal 2020-10-19 12:28:11 -07:00
Mark Pizzolato
31606161ce SCP: Avoid potential compiler warnings
Essentially all are non-functional problems but silencing them is a good idea
2020-10-09 05:09:41 -07:00
Mark Pizzolato
9ef15802f0 SCP: Report name of device that returns an error from its initial reset call 2020-10-05 17:48:37 -07:00
Mark Pizzolato
18472dc666 SCP: Avoid dual output of HELP output in remote console sessions
As reported in #931
2020-09-29 13:38:24 -07:00
Mark Pizzolato
2a75aa630c SCP: Ignore subsequent SIGTERM receipt after initial receipt.
The OS may signal SIGTERM more than once before ultimately
issuing a SIGKILL.  The initial SIGTERM will stop execution and
initiate optional simulator cleanup.  Ignoring follow up SIGTERMs
will allow as much cleanup as possible to be achieved and thus
allow the simulator to complete its cleanup and exit or ultimately
exit die due to receipt of SIGKILL.

Likewise for SIGHUP on hosts that can issue SIGHUP.
2020-09-17 14:00:10 -07:00
Mark Pizzolato
5a9cd144d3 SCP: Save global switches before dispatching to DEVICE reset routines 2020-09-15 04:44:22 -07:00
Mark Pizzolato
60e5484541 SCP: Allow flexible switch presence on TESTLIB commands 2020-08-22 18:35:30 -07:00
Mark Pizzolato
76bf686648 SCP: Restore -D option for TESTLIB command
Adding the automatic detach_all ended up always clearing the switches.
2020-08-21 12:31:30 -07:00
Mark Pizzolato
407696ccc3 SCP: Allow overlapping input and result string while parsing glyphs 2020-08-21 12:09:17 -07:00
Mark Pizzolato
b9b8a496d6 SCP: Properly process program -T switch to invoke all library tests 2020-08-21 12:06:11 -07:00
Mark Pizzolato
dca1c45e80 SCP: Assure that library unit tests are run under reasonable conditions. 2020-08-16 06:40:49 -07:00
Larry Baker
4041894b67 TAPE: Fix potential crash in library unit tests
Improper declaration of state variables referenced in setjmp/longjmp.
2020-08-15 16:21:02 -07:00
Mark Pizzolato
961e1b0513 SCP: Move GET_SWITCHES and GET_RADIX macros from scp.c to scp.h 2020-08-11 07:27:51 -07:00
Mark Pizzolato
892f7d5636 SCP: Avoid additional potential buffer overflow formatting debug repeat count
As reported in #915
2020-07-16 14:46:15 -07:00
Mark Pizzolato
a6198d8fad SCP: Avoid potential buffer overflow when formatting debug repeat count
As reported in #915
2020-07-15 20:15:21 -07:00
Mark Pizzolato
166852935d SCP: Fix corner case formatting for long device name support 2020-07-08 12:48:11 -07:00
Mark Pizzolato
9711fc017b SCP: Silence potential compiler warning 2020-06-27 18:52:25 -07:00
Mark Pizzolato
fe4a2a28b6 SCP: Support output formatting when long DEVICE names are defined
As discussed in #901
2020-06-26 22:49:30 -07:00
Mark Pizzolato
1764e9fd08 SCP: Rework REGister Sanity Checks to reject 0 bit wide register definitions 2020-06-22 16:37:02 -07:00
Mark Pizzolato
09ae6da2cc SCP: Accommodate negative sim_interval while processing event queue
As discussed in #886
2020-06-15 02:29:05 -07:00
Mark Pizzolato
3e5bd84523 makefile, Visual Studio build: Report uncommitted changes in commit-id 2020-06-08 14:16:49 -07:00
Mark Pizzolato
65778c7664 REMOTE_CONSOLE: Make STEP behavior consistent in master mode
As discussed in #866
2020-06-06 08:40:49 -07:00
Mark Pizzolato
f519513f50 SCP, HP2100, HP3000, I650: Move one time initialization activities to cpu_reset
The paradigm of using a "weak" linker reference to find what was
previously the vm_init_routine() doesn't work reliably on all compile
environments supported by the simulators.  This has been reported
in #794 and it came up again in #862.  This change assures that
it will not come up again AND it reliably solves the problem with
Visual Studio compilers (and linker) that randomly chooses whether
to have the desired effect or not.

Of the 82 simulators which are currently part of simh, only these
three used the sim_vm_init() interface, so removing it had relatively
minor impact.
2020-05-26 06:25:01 -07:00
Mark Pizzolato
5b793198c6 SCP: Flush stdout after writing command prompt
Possibly address problem discussed in #861
2020-05-24 16:11:01 -07:00
Mark Pizzolato
5ec4b3f2f4 SCP: Fix remote console command table ordering to have STEP near the beginning
This allowed user entered S to match the SAMPLEOUT command instead
of STEP.  That then identified a bug in the intended socket output
processing to attempt to be written to the undefined debug file.

As discussed in #854
2020-05-22 10:12:11 -07:00
Mark Pizzolato
ca51776ec7 SCP: Enable global message suppression by library code
The global variable sim_show_message as 0 will suppress message
output which may be needed from time to time by library code.
2020-05-22 10:11:40 -07:00
Mark Pizzolato
6fdd917ee8 SCP: Properly handle MTAB entries with MTAB_QUOTE values 2020-05-18 16:41:21 -07:00
Mark Pizzolato
275cc417fe SCP: Add HELP info about debugging DO processing and expression evaluation
- Removed incorrect addition of SCP related DEBUG flags to the CPU
  DEVICE debug options.
2020-05-15 05:14:50 -07:00
Mark Pizzolato
345b87034a SCP: Document -Q for DELETE/RM command and suppress "file not found" with -Q 2020-05-13 05:48:04 -07:00
Mark Pizzolato
20aa661c43 SCP: Parse switches on file operation commands
DELETE, DIR, MKDIR, TYPE, COPY, etc.

This allows -Q to suppress output if desired.
2020-05-12 08:25:10 -07:00
Mark Pizzolato
8edb55ac87 SCP: During expression evaluation, make lookups (REG, Env) consistent
Both REGister and Environment Variable name lookup now do a precise
name lookup with the presented name followed by an upcased name
lookup.
2020-05-12 03:57:22 -07:00
Mark Pizzolato
c3fef9befc SCP: Fix expression evaluation of empty string to numeric value
Previously, numeric values incorrectly had a string representation of
"".  This allowed arbitrary equality comparisons to succeed in unexpected
ways.

Reported by Robert Sancho Villas
2020-05-11 16:23:26 -07:00
Mark Pizzolato
781c73fe21 SCP: Fix != comparison in memory search compare logic (Roberto Sancho Villa) 2020-05-11 06:53:27 -07:00
Mark Pizzolato
df63d4ff9f SCP: Reject undefined device with TESTLIB command
Also remove some otherwise unused variables (assignments but never used).
2020-05-05 12:57:43 -07:00
Mark Pizzolato
7082e212ea DISK: Avoid autosizing if file system can't be determined
Add DISKINFO command to display information about a disk container file.
2020-04-29 13:21:12 -07:00
Mark Pizzolato
b561de671b SCP: Cleanup C++ compile of changed help string management 2020-04-21 21:43:41 -07:00
Mark Pizzolato
2b68660876 SCP: Add a TESTLIB command to invoke sim_* library test on devices
- Previously invoking a simulator with -T was the only way to invoke the
  library tests for ALL devices.  That still works now with the additional
  flexibility to invoke a specific device's test from the sim> prompt.
- Adding TESTLIB help text encountered a maximum constant string length
  limit in the C compiler.  Reworked to allow multiple strings which are then
  concatenated on the first HELP command invocation.
2020-04-17 17:22:43 -07:00
Mark Pizzolato
35780cf5e2 SCP: Enhance SCP library testing to report and stop on errors 2020-04-11 13:03:00 -07:00