Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2006 15:35:53 GMT
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 110622 for review
Message-ID:  <200611281535.kASFZrxT009108@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611281535.kASFZrxT009108>