Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/powerpc Support



details:   https://anonhg.NetBSD.org/src/rev/746f6e73e361
branches:  trunk
changeset: 520154:746f6e73e361
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Thu Jan 03 22:15:06 2002 +0000

description:
Support
  t/t   PID
on the powerpc. (remember to use 0tPID if pid is in decimal...)

diffstat:

 sys/arch/powerpc/powerpc/db_trace.c |  23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 88bf366aafcc -r 746f6e73e361 sys/arch/powerpc/powerpc/db_trace.c
--- a/sys/arch/powerpc/powerpc/db_trace.c       Thu Jan 03 21:52:26 2002 +0000
+++ b/sys/arch/powerpc/powerpc/db_trace.c       Thu Jan 03 22:15:06 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_trace.c,v 1.16 2001/12/31 18:29:07 dbj Exp $        */
+/*     $NetBSD: db_trace.c,v 1.17 2002/01/03 22:15:06 jhawk Exp $      */
 /*     $OpenBSD: db_trace.c,v 1.3 1997/03/21 02:10:48 niklas Exp $     */
 
 /* 
@@ -31,6 +31,7 @@
 
 #include <sys/param.h>
 #include <sys/proc.h>
+#include <sys/user.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -128,7 +129,25 @@
        }
 
        if (have_addr) {
-               frame = (db_addr_t)addr;
+               if (trace_thread) {
+                       struct proc *p;
+                       struct user *u;
+
+                       (*pr)("trace: pid %d ", (int)addr);
+                       p = pfind(addr);
+                       if (p == NULL) {
+                               (*pr)("not found\n");
+                               return;
+                       }       
+                       if (!(p->p_flag&P_INMEM)) {
+                               (*pr)("swapped out\n");
+                               return;
+                       }
+                       u = p->p_addr;
+                       frame = (db_addr_t)u->u_pcb.pcb_sp;
+                       (*pr)("at %p\n", frame);
+               } else
+                       frame = (db_addr_t)addr;
        } else {
                frame = (db_addr_t)ddb_regs.r[1];
        }



Home | Main Index | Thread Index | Old Index