Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/i386 Use frame_dump if TRAP_SIGDEBUG is enabled
details: https://anonhg.NetBSD.org/src/rev/84967c79e12a
branches: trunk
changeset: 352070:84967c79e12a
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Tue Mar 14 07:02:53 2017 +0000
description:
Use frame_dump if TRAP_SIGDEBUG is enabled
This unbreaks the build of i386 ALL kernel.
diffstat:
sys/arch/i386/i386/trap.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diffs (51 lines):
diff -r d689ad344229 -r 84967c79e12a sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Tue Mar 14 06:37:39 2017 +0000
+++ b/sys/arch/i386/i386/trap.c Tue Mar 14 07:02:53 2017 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: trap.c,v 1.285 2017/03/09 00:16:51 chs Exp $ */
+/* $NetBSD: trap.c,v 1.286 2017/03/14 07:02:53 ozaki-r Exp $ */
/*-
* Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.285 2017/03/09 00:16:51 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.286 2017/03/14 07:02:53 ozaki-r Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -421,6 +421,11 @@
case T_SEGNPFLT|T_USER:
case T_STKFLT|T_USER:
case T_ALIGNFLT|T_USER:
+#ifdef TRAP_SIGDEBUG
+ printf("pid %d.%d (%s): BUS/SEGV (%#x) at eip %#x addr %#lx\n",
+ p->p_pid, l->l_lid, p->p_comm, type, frame->tf_eip, rcr2());
+ frame_dump(frame, pcb);
+#endif
KSI_INIT_TRAP(&ksi);
ksi.ksi_addr = (void *)rcr2();
@@ -463,6 +468,11 @@
case T_PRIVINFLT|T_USER: /* privileged instruction fault */
case T_FPOPFLT|T_USER: /* coprocessor operand fault */
+#ifdef TRAP_SIGDEBUG
+ printf("pid %d.%d (%s): ILL at eip %#x addr %#lx\n",
+ p->p_pid, l->l_lid, p->p_comm, frame->tf_eip, rcr2());
+ frame_dump(frame, pcb);
+#endif
KSI_INIT_TRAP(&ksi);
ksi.ksi_signo = SIGILL;
ksi.ksi_addr = (void *) frame->tf_eip;
@@ -679,6 +689,7 @@
printf("pid %d.%d (%s): signal %d at eip %#x addr %#lx "
"error %d\n", p->p_pid, l->l_lid, p->p_comm, ksi.ksi_signo,
frame->tf_eip, va, error);
+ frame_dump(frame, pcb);
#endif
(*p->p_emul->e_trapsignal)(l, &ksi);
break;
Home |
Main Index |
Thread Index |
Old Index