1
0
mirror of https://github.com/simh/simh.git synced 2026-01-11 23:52:58 +00:00

SCP: CONSOLE Cleanup and DBGSIGNAL help

- Add HELP language for SET CONSOLE DBGSIGNAL|NODBGSIGNAL.
- Remove obsolete sim_os_poll_kbd_ready platform specific routines
  which were only used with the never functional asynchronous TMXR
  code which has been otherwise removed everywhere else.
- Cleanup DBGSIGNAL related code comments

-
This commit is contained in:
Mark Pizzolato 2025-03-20 17:12:50 -10:00
parent 474f84244d
commit fed5342f44
2 changed files with 9 additions and 76 deletions

5
scp.c
View File

@ -1363,7 +1363,7 @@ static const char simh_help1[] =
"+SET CONSOLE WRU=value specify console drop to simh character\n"
"+SET CONSOLE BRK=value specify console Break character\n"
"+SET CONSOLE DEL=value specify console delete character\n"
#if (defined(__GNUC__) && !defined(__OPTIMIZE__) && !defined(_WIN32))/* Debug build? */
#if (defined(__GNUC__) && !defined(_WIN32))/* Debug build? */
"+SET CONSOLE DBGINT=value specify SIGINT character in debugger\n"
#endif
"+SET CONSOLE PCHAR=bitmask bit mask of printable characters in\n"
@ -1389,6 +1389,9 @@ static const char simh_help1[] =
"++++++++ specify console serial port and optionally\n"
"++++++++ the port config (i.e. ;9600-8n1)\n"
"+SET CONSOLE NOSERIAL disable console serial session\n"
"+SET CONSOLE DBSIGNAL enable gdb debugger signals via the\n"
"++++++++ specified DBGINT character\n"
"+SET CONSOLE NODBSIGNAL disable gdb debugger signals\n"
/***************** 80 character line width template *************************/
#define HLP_SET_REMOTE "*Commands SET REMOTE"
"3Remote\n"

View File

@ -148,9 +148,6 @@ int setenv(const char *envname, const char *envval, int overwrite);
/* Forward Declarations of Platform specific routines */
static t_stat sim_os_poll_kbd (void);
#if defined(SIM_ASYNCH_IO) && defined(SIM_ASYNCH_MUX)
static t_bool sim_os_poll_kbd_ready (int ms_timeout);
#endif
static t_stat sim_os_putchar (int32 out);
static t_stat sim_os_ttinit (void);
static t_stat sim_os_ttrun (void);
@ -2995,7 +2992,7 @@ if (cptr != NULL && *cptr != '\0') /* too many arguments? */
fprintf(st, "%s interrupts to the debugger.\n", sim_dbg_signal ? "Delivering" : "Not delivering");
#else
fprintf(st, "Debugger interrupt not supported.\n");
fprintf(st, "Debugger interrupt not supported on this platform.\n");
#endif
return SCPE_OK;
@ -3430,29 +3427,6 @@ if (response = buffered_character) {
return sim_os_poll_kbd_data ();
}
static t_bool sim_os_poll_kbd_ready (int ms_timeout)
{
unsigned int status, term[2];
unsigned char buf[4];
IOSB iosb;
term[0] = 0; term[1] = 0;
status = sys$qiow (EFN, tty_chan,
IO$_READLBLK | IO$M_NOECHO | IO$M_NOFILTR | IO$M_TIMED | IO$M_TRMNOECHO,
&iosb, 0, 0, buf, 1, (ms_timeout+999)/1000, term, 0, 0);
if ((status != SS$_NORMAL) || (iosb.status != SS$_NORMAL))
return FALSE;
if (buf[0] == sim_int_char)
buffered_character = SCPE_STOP;
else
if (sim_brk_char && (buf[0] == sim_brk_char))
buffered_character = SCPE_BREAK;
else
buffered_character = (buf[0] | SCPE_KFLAG);
return TRUE;
}
static t_stat sim_os_putchar (int32 out)
{
unsigned int status;
@ -3675,18 +3649,6 @@ if ((sim_brk_char && ((c & 0177) == sim_brk_char)) || (c & SCPE_BREAK))
return c | SCPE_KFLAG;
}
static t_bool sim_os_poll_kbd_ready (int ms_timeout)
{
sim_debug (DBG_TRC, &sim_con_telnet, "sim_os_poll_kbd_ready()\n");
if ((std_input == NULL) || /* No keyboard for */
(std_input == INVALID_HANDLE_VALUE)) { /* background processes */
Sleep (ms_timeout);
return FALSE;
}
return (WAIT_OBJECT_0 == WaitForSingleObject (std_input, ms_timeout));
}
#define BELL_CHAR 7 /* Bell Character */
#define BELL_INTERVAL_MS 500 /* No more than 2 Bell Characters Per Second */
#define ESC_CHAR 033 /* Escape Character */
@ -3843,8 +3805,8 @@ sim_debug (DBG_TRC, &sim_con_telnet, "sim_os_ttrun() - BSDTTY\n");
if (sim_dbg_signal) {
if (sim_dbg_int_char == 0)
sim_dbg_int_char = sim_int_char + 1; /* Set a reasonable default */
runtchars.t_intrc = sim_dbg_int_char; /* let debugger get SIGINT with next highest char */
sim_dbg_int_char = sim_int_char + 1; /* Set a reasonable default for the DBGINT char */
runtchars.t_intrc = sim_dbg_int_char; /* let debugger get SIGINT with the DBGINT char */
if (!sigint_message_issued) {
char sigint_name[8];
@ -3918,22 +3880,6 @@ if (sim_int_char && (buf[0] == sim_int_char))
return (buf[0] | SCPE_KFLAG);
}
static t_bool sim_os_poll_kbd_ready (int ms_timeout)
{
fd_set readfds;
struct timeval timeout;
if (!isatty (0)) { /* skip if !tty */
sim_os_ms_sleep (ms_timeout);
return FALSE;
}
FD_ZERO (&readfds);
FD_SET (0, &readfds);
timeout.tv_sec = (ms_timeout*1000)/1000000;
timeout.tv_usec = (ms_timeout*1000)%1000000;
return (1 == select (1, &readfds, NULL, NULL, &timeout));
}
static t_stat sim_os_putchar (int32 out)
{
char c;
@ -4035,8 +3981,8 @@ runtty.c_cc[VINTR] = sim_int_char; /* in case changed */
#endif
if (sim_dbg_signal) {
if (sim_dbg_int_char == 0)
sim_dbg_int_char = sim_int_char + 1; /* Set a reasonable default */
runtty.c_cc[VINTR] = sim_dbg_int_char; /* let debugger get SIGINT with next highest char */
sim_dbg_int_char = sim_int_char + 1; /* Set a reasonable default for the DBGINT char */
runtty.c_cc[VINTR] = sim_dbg_int_char; /* let debugger get SIGINT with the DBGINT char */
if (!sigint_message_issued) {
char sigint_name[8];
@ -4101,22 +4047,6 @@ if (sim_int_char && (buf[0] == sim_int_char))
return (buf[0] | SCPE_KFLAG);
}
static t_bool sim_os_poll_kbd_ready (int ms_timeout)
{
fd_set readfds;
struct timeval timeout;
if (!sim_ttisatty()) { /* skip if !tty */
sim_os_ms_sleep (ms_timeout);
return FALSE;
}
FD_ZERO (&readfds);
FD_SET (0, &readfds);
timeout.tv_sec = (ms_timeout*1000)/1000000;
timeout.tv_usec = (ms_timeout*1000)%1000000;
return (1 == select (1, &readfds, NULL, NULL, &timeout));
}
static t_stat sim_os_putchar (int32 out)
{
char c;