-/* $OpenBSD: trap.c,v 1.62 2017/10/14 04:44:43 jsg Exp $ */
+/* $OpenBSD: trap.c,v 1.63 2018/01/05 11:10:25 pirofti Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
}
if (type == T_PAGEFLT) {
+ static char faultbuf[512];
if (pcb->pcb_onfault != 0) {
KERNEL_UNLOCK();
goto copyfault;
}
- printf("uvm_fault(%p, 0x%lx, 0, %d) -> %x\n",
+ snprintf(faultbuf, sizeof faultbuf,
+ "uvm_fault(%p, 0x%lx, 0, %d) -> %x",
map, fa, ftype, error);
+ printf("%s\n", faultbuf);
+ faultstr = faultbuf;
goto we_re_toast;
}
-/* $OpenBSD: db_command.c,v 1.82 2017/12/13 08:34:04 mpi Exp $ */
+/* $OpenBSD: db_command.c,v 1.83 2018/01/05 11:10:25 pirofti Exp $ */
/* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */
/*
#include <ddb/db_watch.h>
#include <ddb/db_run.h>
#include <ddb/db_sym.h>
+#include <ddb/db_var.h>
#include <ddb/db_variables.h>
#include <ddb/db_interface.h>
#include <ddb/db_extern.h>
{
if (panicstr)
db_printf("%s\n", panicstr);
+ else if (faultstr) {
+ db_printf("kernel page fault\n");
+ db_printf("%s\n", faultstr);
+ db_stack_trace_print(addr, have_addr, 1, modif, db_printf);
+ }
else
db_printf("the kernel did not panic\n"); /* yet */
}
-/* $OpenBSD: subr_prf.c,v 1.92 2017/12/30 20:47:00 guenther Exp $ */
+/* $OpenBSD: subr_prf.c,v 1.93 2018/01/05 11:10:25 pirofti Exp $ */
/* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */
/*-
extern int log_open; /* subr_log: is /dev/klog open? */
const char *panicstr; /* arg to first call to panic (used as a flag
to indicate that panic has already been called). */
+const char *faultstr; /* page fault string */
#ifdef DDB
/*
* Enter ddb on panic.
-/* $OpenBSD: systm.h,v 1.136 2017/12/14 00:41:58 dlg Exp $ */
+/* $OpenBSD: systm.h,v 1.137 2018/01/05 11:10:25 pirofti Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
*/
extern int securelevel; /* system security level */
extern const char *panicstr; /* panic message */
+extern const char *faultstr; /* fault message */
extern const char version[]; /* system version */
extern const char copyright[]; /* system copyright */
extern const char ostype[];