Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/arch/amd64/amd64 Pull up following revision(s) (reque...



details:   https://anonhg.NetBSD.org/src/rev/b4ff50a8a8ea
branches:  netbsd-6
changeset: 775365:b4ff50a8a8ea
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Oct 17 22:34:15 2012 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #604):
        sys/arch/amd64/amd64/db_machdep.c: revision 1.4
Use db_read_value to read the trapframe fields in db_nextframe.
Fixes SIGSEGV on bt in crash(8) when the stack trace ends in syscall,
and probably other problems as well.
ok christos

diffstat:

 sys/arch/amd64/amd64/db_machdep.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r 3597cdb1cdc1 -r b4ff50a8a8ea sys/arch/amd64/amd64/db_machdep.c
--- a/sys/arch/amd64/amd64/db_machdep.c Wed Oct 17 22:30:08 2012 +0000
+++ b/sys/arch/amd64/amd64/db_machdep.c Wed Oct 17 22:34:15 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_machdep.c,v 1.1.16.1 2012/02/23 18:36:06 riz Exp $  */
+/*     $NetBSD: db_machdep.c,v 1.1.16.2 2012/10/17 22:34:15 riz Exp $  */
 
 /* 
  * Mach Operating System
@@ -26,7 +26,7 @@
  * rights to redistribute these changes.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.1.16.1 2012/02/23 18:36:06 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.1.16.2 2012/10/17 22:34:15 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -134,17 +134,20 @@
                tf = (struct trapframe *)argp;
                switch (is_trap) {
                case TRAP:
-                       (*pr)("--- trap (number %d) ---\n", tf->tf_trapno);
+                       (*pr)("--- trap (number %"DDB_EXPR_FMT"u) ---\n",
+                               db_get_value((long)&tf->tf_trapno, 8, false));
                        break;
                case SYSCALL:
-                       (*pr)("--- syscall (number %ld) ---\n", tf->tf_rax);
+                       (*pr)("--- syscall (number %"DDB_EXPR_FMT"u) ---\n",
+                               db_get_value((long)&tf->tf_rax, 8, false));
                        break;
                case INTERRUPT:
                        (*pr)("--- interrupt ---\n");
                        break;
                }
-               *ip = (db_addr_t)tf->tf_rip;
-               fp = (struct x86_64_frame *)tf->tf_rbp;
+               *ip = (db_addr_t)db_get_value((long)&tf->tf_rip, 8, false);
+               fp = (struct x86_64_frame *)
+                       db_get_value((long)&tf->tf_rbp, 8, false);
                if (fp == NULL)
                        return 0;
                *nextframe = (long *)&fp->f_frame;



Home | Main Index | Thread Index | Old Index