diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-08-21 16:51:54 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-08-22 01:28:58 +0200 |
commit | ed650a41c57d824f6503f266f21093d3ee18d21d (patch) | |
tree | 3bb3214616e15d7f2ed34804c6b526e07a4181a1 /i386/i386at/com.c | |
parent | a32b7409276fceedc25962d013afb471e9d4e164 (diff) |
Support invoking the debugger over the serial console
* i386/i386at/com.c (comintr): Invoke the debugger if ctrl-alt-d is
pressed.
* i386/i386at/com.h (kdb_kintr): Add declaration.
Diffstat (limited to 'i386/i386at/com.c')
-rw-r--r-- | i386/i386at/com.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/i386/i386at/com.c b/i386/i386at/com.c index 5e65ad8..619e1af 100644 --- a/i386/i386at/com.c +++ b/i386/i386at/com.c @@ -518,10 +518,35 @@ comintr(int unit) case RECi: case CTIi: /* Character timeout indication */ if (tp->t_state&TS_ISOPEN) { + int escape = 0; while ((line = inb(LINE_STAT(addr))) & iDR) { c = inb(TXRX(addr)); - ttyinput(c, tp); + + if (c == 0x1b) { + escape = 1; + continue; + } + +#if MACH_KDB + if (escape && c == 'D'-'@') + /* ctrl-alt-d pressed, + invoke debugger */ + kdb_kintr(); + else +#endif /* MACH_KDB */ + if (escape) { + ttyinput(0x1b, tp); + ttyinput(c, tp); + } + else + ttyinput(c, tp); + + escape = 0; } + + if (escape) + /* just escape */ + ttyinput(0x1b, tp); } else tt_open_wakeup(tp); break; |