Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/vax/vax On a kernel segfault, print the registers f...



details:   https://anonhg.NetBSD.org/src/rev/d53e28dedf95
branches:  trunk
changeset: 773448:d53e28dedf95
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Feb 02 14:30:48 2012 +0000

description:
On a kernel segfault, print the registers from the trapframe.

diffstat:

 sys/arch/vax/vax/trap.c |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 63622599fe69 -r d53e28dedf95 sys/arch/vax/vax/trap.c
--- a/sys/arch/vax/vax/trap.c   Thu Feb 02 14:30:13 2012 +0000
+++ b/sys/arch/vax/vax/trap.c   Thu Feb 02 14:30:48 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.128 2011/07/03 02:18:21 matt Exp $     */
+/*     $NetBSD: trap.c,v 1.129 2012/02/02 14:30:48 matt Exp $     */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -33,7 +33,7 @@
  /* All bugs are subject to removal without further notice */
                
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.128 2011/07/03 02:18:21 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.129 2012/02/02 14:30:48 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -238,7 +238,17 @@
                                        tf->tf_r0 = rv;
                                        return;
                                }
-                               panic("Segv in kernel mode: pc %#lx addr %#lx",
+                               printf("r0=%08lx r1=%08lx r2=%08lx r3=%08lx ",
+                                   tf->tf_r0, tf->tf_r1, tf->tf_r2, tf->tf_r3);
+                               printf("r4=%08lx r5=%08lx r6=%08lx r7=%08lx\n",
+                                   tf->tf_r4, tf->tf_r5, tf->tf_r6, tf->tf_r7);
+                               printf(
+                                   "r8=%08lx r9=%08lx r10=%08lx r11=%08lx\n",
+                                   tf->tf_r8, tf->tf_r9, tf->tf_r10,
+                                   tf->tf_r11);
+                               printf("ap=%08lx fp=%08lx sp=%08lx pc=%08lx\n",
+                                   tf->tf_ap, tf->tf_fp, tf->tf_sp, tf->tf_pc);
+                               panic("SEGV in kernel mode: pc %#lx addr %#lx",
                                    tf->tf_pc, tf->tf_code);
                        }
                        code = SEGV_ACCERR;



Home | Main Index | Thread Index | Old Index