From owner-p4-projects@FreeBSD.ORG Tue Nov 28 15:35:55 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 051EB16A4A0; Tue, 28 Nov 2006 15:35:55 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB25616A47B for ; Tue, 28 Nov 2006 15:35:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0C2743CA5 for ; Tue, 28 Nov 2006 15:35:50 +0000 (GMT) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kASFZrk4009111 for ; Tue, 28 Nov 2006 15:35:53 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kASFZrxT009108 for perforce@freebsd.org; Tue, 28 Nov 2006 15:35:53 GMT (envelope-from gonzo@FreeBSD.org) Date: Tue, 28 Nov 2006 15:35:53 GMT Message-Id: <200611281535.kASFZrxT009108@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 110622 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2006 15:35:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=110622 Change 110622 by gonzo@gonzo_hq on 2006/11/28 15:34:57 o Brace my debug printfs with "#ifdef"s o Give pc in message about userland memeory fault. Affected files ... .. //depot/projects/mips2/src/sys/mips/mips/trap.c#11 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/mips/trap.c#11 (text+ko) ==== @@ -184,9 +184,10 @@ break; /* TODO: send signal */ - panic("Send signal to userland here... error=%d, va=0x%08x\n", - error, va); + printf("Userland memory access error %d on va=%08x, pc=%08x\n", + error, va, tf->tf_regs[TF_EPC] ); + panic("TODO: signal on memory access errors"); case TrSys: syscall(curthread, tf); goto done; @@ -334,10 +335,13 @@ callp = &p->p_sysent->sv_table[code]; nargs = callp->sy_narg & SYF_ARGMASK; + /* syscallnames is available only of INVARIANTS are on */ +#ifdef INVARIANTS printf("syscall enter thread %p pid %d proc " \ "%s code %d(%s) nargs: %d\n", td, td->td_proc->p_pid, td->td_proc->p_comm, code, syscallnames[code], nargs); +#endif /* Copy arguments from a0..a4 */ for(i = 0; i < MIN(nargs, 4 - args_shift); i++) @@ -425,6 +429,14 @@ frame->tf_regs[TF_EPC] += 4; userret(td, frame); + /* syscallnames is available only of INVARIANTS are on */ +#ifdef INVARIANTS + printf("syscall exit thread %p pid %d proc " \ + "%s code %d(%s) nargs: %d error=%d\n", td, + td->td_proc->p_pid, td->td_proc->p_comm, code, + syscallnames[code], nargs, error); +#endif + CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, td->td_proc->p_pid, td->td_proc->p_comm, code);