# $Id: openbsd-ddb_console.diff,v 1.1 2001/12/07 18:49:29 jcs Exp $ # # stupid hack to ddb in openbsd to jump to the console on a panic, before # printing any debugging info # # note that this will not switch out of x11 and even seems to break it when # trying, not that it matters much, since the machine is already in a panic # # by joshua stein # Index: db_trap.c =================================================================== RCS file: /cvs/src/sys/ddb/db_trap.c,v retrieving revision 1.10 diff -u -r1.10 db_trap.c --- db_trap.c 6 Nov 2001 19:53:18 -0000 1.10 +++ db_trap.c 25 Nov 2001 08:30:06 -0000 @@ -48,6 +48,8 @@ #include #include +#include + void db_trap(type, code) int type, code; @@ -57,6 +59,9 @@ bkpt = IS_BREAKPOINT_TRAP(type, code); watchpt = IS_WATCHPOINT_TRAP(type, code); + + /* switch to the console before printing anything */ + wsdisplay_switchtoconsole(); if (db_stop_at_pc(DDB_REGS, &bkpt)) { if (db_inst_count) {