From 3edcea7de02dada218e11800368a4b22bd3ee3b1 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 16 Jan 2023 16:57:14 -1000 Subject: [PATCH] SCP: Be sure to close (implicitly flushing) debug output on abort() --- scp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index 758acae6..15217d39 100644 --- a/scp.c +++ b/scp.c @@ -2890,7 +2890,7 @@ if (argc > 1) { /* Check for special arg --argc; } } -if (argc > 1) { /* Check for special argument to invoke register test */ +if (argc > 1) { /* Check for special argument to invoke device unit tests */ if (sim_strcasecmp (argv[1], "DeviceUnitTests") == 0) { device_unit_tests = TRUE; /* Remove special argument to avoid confusion later */ @@ -9695,6 +9695,7 @@ do { r = sim_instr(); if (r != SCPE_REMOTE) break; + UPDATE_SIM_TIME; sim_remote_process_command (); /* Process the command and resume processing */ } if ((flag != RU_NEXT) || /* done if not doing NEXT */ @@ -12465,7 +12466,7 @@ UPDATE_SIM_TIME; /* update sim time */ sim_debug (SIM_DBG_ACTIVATE, &sim_scp_dev, "Activating %s delay=%d\n", sim_uname (uptr), event_time); /* event_time being -1 is a special case which specifically pushes the */ -/* specified unit at the head of the event queue */ +/* specified unit at the head of the event queue to run immediately */ if (event_time == -1) { uptr->time = 0; uptr->next = sim_clock_queue; @@ -14005,6 +14006,8 @@ void _sim_scp_abort (const char *msg, const char *file, int linenum) { sim_printf ("%s - aborting from %s:%d\n", msg, file, linenum); sim_flush_buffered_files (); +if (sim_deb) + fclose (sim_deb); abort (); }