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 Do not try to get the faulting instructio...



details:   https://anonhg.NetBSD.org/src/rev/9826b426d5e7
branches:  trunk
changeset: 746990:9826b426d5e7
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Aug 26 23:17:03 2009 +0000

description:
Do not try to get the faulting instruction if eip is 0.
This makes 'trace' work when the kernel paniced because it jumped to
a NULL function pointer.

diffstat:

 sys/arch/i386/i386/db_trace.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f6bdc39379d0 -r 9826b426d5e7 sys/arch/i386/i386/db_trace.c
--- a/sys/arch/i386/i386/db_trace.c     Wed Aug 26 22:38:22 2009 +0000
+++ b/sys/arch/i386/i386/db_trace.c     Wed Aug 26 23:17:03 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_trace.c,v 1.61 2009/03/07 22:02:16 ad Exp $ */
+/*     $NetBSD: db_trace.c,v 1.62 2009/08/26 23:17:03 bouyer Exp $     */
 
 /* 
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.61 2009/03/07 22:02:16 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.62 2009/08/26 23:17:03 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -501,7 +501,7 @@
                sym = db_frame_info(frame, callpc, &name, &offset, &is_trap,
                                    &narg);
 
-               if (lastframe == 0 && sym == (db_sym_t)0) {
+               if (lastframe == 0 && sym == (db_sym_t)0 && callpc != 0) {
                        /* Symbol not found, peek at code */
                        int     instr = db_get_value(callpc, 4, false);
 



Home | Main Index | Thread Index | Old Index