From owner-svn-src-head@FreeBSD.ORG Sun Oct 14 17:09:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DCBA7A2; Sun, 14 Oct 2012 17:09:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06C1F8FC0C; Sun, 14 Oct 2012 17:09:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9EH9oGO006241; Sun, 14 Oct 2012 17:09:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9EH9oWD006238; Sun, 14 Oct 2012 17:09:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210141709.q9EH9oWD006238@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Oct 2012 17:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241550 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2012 17:09:51 -0000 Author: kib Date: Sun Oct 14 17:09:50 2012 New Revision: 241550 URL: http://svn.freebsd.org/changeset/base/241550 Log: MFamd64: add machdep.uprintf_signal. MFC after: 1 week Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sun Oct 14 17:08:46 2012 (r241549) +++ head/sys/i386/i386/trap.c Sun Oct 14 17:09:50 2012 (r241550) @@ -195,6 +195,10 @@ TUNABLE_INT("machdep.panic_on_nmi", &pan static int prot_fault_translation = 0; SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, &prot_fault_translation, 0, "Select signal to deliver on protection fault"); +static int uprintf_signal; +SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW, + &uprintf_signal, 0, + "Print debugging information on trap signal to ctty"); /* * Exception, fault, and trap interface to the FreeBSD kernel. @@ -761,6 +765,21 @@ trap(struct trapframe *frame) ksi.ksi_code = ucode; ksi.ksi_addr = (void *)addr; ksi.ksi_trapno = type; + if (uprintf_signal) { + uprintf("pid %d comm %s: signal %d err %x code %d type %d " + "addr 0x%x eip 0x%08x " + "<%02x %02x %02x %02x %02x %02x %02x %02x>\n", + p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr, + frame->tf_eip, + fubyte((void *)(frame->tf_eip + 0)), + fubyte((void *)(frame->tf_eip + 1)), + fubyte((void *)(frame->tf_eip + 2)), + fubyte((void *)(frame->tf_eip + 3)), + fubyte((void *)(frame->tf_eip + 4)), + fubyte((void *)(frame->tf_eip + 5)), + fubyte((void *)(frame->tf_eip + 6)), + fubyte((void *)(frame->tf_eip + 7))); + } trapsignal(td, &ksi); #ifdef DEBUG