Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 sparc64/db_trace.c: Don't dereferen...



details:   https://anonhg.NetBSD.org/src/rev/ac3cc3cbcf93
branches:  trunk
changeset: 373226:ac3cc3cbcf93
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Jan 24 23:23:31 2023 +0000

description:
sparc64/db_trace.c: Don't dereference; use db_read_bytes.

Makes crash(8) and ddb match, and avoids crashing in ddb when you
feed in a bad lwp pointer!

diffstat:

 sys/arch/sparc64/sparc64/db_trace.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (31 lines):

diff -r 30c8ffca271b -r ac3cc3cbcf93 sys/arch/sparc64/sparc64/db_trace.c
--- a/sys/arch/sparc64/sparc64/db_trace.c       Tue Jan 24 23:23:12 2023 +0000
+++ b/sys/arch/sparc64/sparc64/db_trace.c       Tue Jan 24 23:23:31 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_trace.c,v 1.56 2023/01/24 23:23:12 riastradh Exp $ */
+/*     $NetBSD: db_trace.c,v 1.57 2023/01/24 23:23:31 riastradh Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.56 2023/01/24 23:23:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.57 2023/01/24 23:23:31 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -127,12 +127,8 @@
                        }
                        (*pr)("lid %d ", l.l_lid);
                        pcb = lwp_getpcb(&l);
-#ifndef _KERNEL
                        db_read_bytes((db_addr_t)&pcb->pcb_sp,
                            sizeof(frame), (char *)&frame);
-#else
-                       frame = (vaddr_t)pcb->pcb_sp;
-#endif
                        (*pr)("at %p\n", frame);
                } else {
                        frame = (vaddr_t)addr;



Home | Main Index | Thread Index | Old Index