Add option ALT_BREAK_TO_DEBUGGER.

Implement the Solaris way to break into DDB over a serial console
instead of sending a break.  Sending the character sequence
CR ~ ^b will break the kernel into DDB (if DDB is enabled).

Reviewed by:	peter
This commit is contained in:
Paul Saab 2000-06-14 06:41:33 +00:00
parent 425f741b1d
commit 26b6ea69c3
5 changed files with 69 additions and 0 deletions

View File

@ -1242,6 +1242,11 @@ options BREAK_TO_DEBUGGER #a BREAK on a comconsole goes to
#DDB, if available.
options CONSPEED=9600 #default speed for serial console (default 9600)
# Solaris implements a new BREAK which is initiated by a character
# sequence CR ~ ^b which is similar to a familiar pattern used on
# Sun servers by the Remote Console.
options ALT_BREAK_TO_DEBUGGER
# Options for sio:
options COM_ESP #code for Hayes ESP
options COM_MULTIPORT #code for some cards with shared IRQs

View File

@ -427,6 +427,7 @@ METEOR_DEALLOC_ABOVE opt_meteor.h
COM_ESP opt_sio.h
COM_MULTIPORT opt_sio.h
BREAK_TO_DEBUGGER opt_comconsole.h
ALT_BREAK_TO_DEBUGGER opt_comconsole.h
# Include tweaks for running under the SimOS machine simulator.
SIMOS opt_simos.h

View File

@ -1868,6 +1868,35 @@ siointr1(com)
recv_data = 0;
else
recv_data = inb(com->data_port);
#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER)
/*
* Solaris implements a new BREAK which is initiated
* by a character sequence CR ~ ^b which is similar
* to a familiar pattern used on Sun servers by the
* Remote Console.
*/
#define KEY_CRTLB 2 /* ^B */
#define KEY_CR 13 /* CR '\r' */
#define KEY_TILDE 126 /* ~ */
if (com->unit == comconsole) {
static int brk_state1 = 0, brk_state2 = 0;
if (recv_data == KEY_CR) {
brk_state1 = recv_data;
brk_state2 = 0;
} else if (brk_state1 == KEY_CR && (recv_data == KEY_TILDE || recv_data == KEY_CRTLB)) {
if (recv_data == KEY_TILDE)
brk_state2 = recv_data;
else if (brk_state2 == KEY_TILDE && recv_data == KEY_CRTLB) {
breakpoint();
brk_state1 = brk_state2 = 0;
goto cont;
} else
brk_state2 = 0;
} else
brk_state1 = 0;
}
#endif
if (line_status & (LSR_BI | LSR_FE | LSR_PE)) {
/*
* Don't store BI if IGNBRK or FE/PE if IGNPAR.

View File

@ -1242,6 +1242,11 @@ options BREAK_TO_DEBUGGER #a BREAK on a comconsole goes to
#DDB, if available.
options CONSPEED=9600 #default speed for serial console (default 9600)
# Solaris implements a new BREAK which is initiated by a character
# sequence CR ~ ^b which is similar to a familiar pattern used on
# Sun servers by the Remote Console.
options ALT_BREAK_TO_DEBUGGER
# Options for sio:
options COM_ESP #code for Hayes ESP
options COM_MULTIPORT #code for some cards with shared IRQs

View File

@ -1868,6 +1868,35 @@ siointr1(com)
recv_data = 0;
else
recv_data = inb(com->data_port);
#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER)
/*
* Solaris implements a new BREAK which is initiated
* by a character sequence CR ~ ^b which is similar
* to a familiar pattern used on Sun servers by the
* Remote Console.
*/
#define KEY_CRTLB 2 /* ^B */
#define KEY_CR 13 /* CR '\r' */
#define KEY_TILDE 126 /* ~ */
if (com->unit == comconsole) {
static int brk_state1 = 0, brk_state2 = 0;
if (recv_data == KEY_CR) {
brk_state1 = recv_data;
brk_state2 = 0;
} else if (brk_state1 == KEY_CR && (recv_data == KEY_TILDE || recv_data == KEY_CRTLB)) {
if (recv_data == KEY_TILDE)
brk_state2 = recv_data;
else if (brk_state2 == KEY_TILDE && recv_data == KEY_CRTLB) {
breakpoint();
brk_state1 = brk_state2 = 0;
goto cont;
} else
brk_state2 = 0;
} else
brk_state1 = 0;
}
#endif
if (line_status & (LSR_BI | LSR_FE | LSR_PE)) {
/*
* Don't store BI if IGNBRK or FE/PE if IGNPAR.