From owner-svn-src-all@freebsd.org Wed Jul 26 17:39:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D9F7DAB7BF; Wed, 26 Jul 2017 17:39:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB6536E652; Wed, 26 Jul 2017 17:39:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6QHdBYp099181; Wed, 26 Jul 2017 17:39:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6QHdBJ3099180; Wed, 26 Jul 2017 17:39:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201707261739.v6QHdBJ3099180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 26 Jul 2017 17:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321571 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 321571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jul 2017 17:39:12 -0000 Author: andrew Date: Wed Jul 26 17:39:10 2017 New Revision: 321571 URL: https://svnweb.freebsd.org/changeset/base/321571 Log: Pass the last exception trap frame to kdb_trap. This allows show registers in ddb to show the traps registers, and not the registers from within the panic call. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Jul 26 17:38:29 2017 (r321570) +++ head/sys/arm64/arm64/trap.c Wed Jul 26 17:39:10 2017 (r321571) @@ -265,6 +265,7 @@ print_registers(struct trapframe *frame) void do_el1h_sync(struct thread *td, struct trapframe *frame) { + struct trapframe *oframe; uint32_t exception; uint64_t esr, far; @@ -281,6 +282,18 @@ do_el1h_sync(struct thread *td, struct trapframe *fram "do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td, esr, frame->tf_elr, frame); + oframe = td->td_frame; + + switch (exception) { + case EXCP_BRK: + case EXCP_WATCHPT_EL1: + case EXCP_SOFTSTP_EL1: + break; + default: + td->td_frame = frame; + break; + } + switch(exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: @@ -313,7 +326,8 @@ do_el1h_sync(struct thread *td, struct trapframe *fram case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB - kdb_trap(exception, 0, frame); + kdb_trap(exception, 0, + (td->td_frame != NULL) ? td->td_frame : frame); #else panic("No debugger in kernel.\n"); #endif @@ -323,6 +337,8 @@ do_el1h_sync(struct thread *td, struct trapframe *fram panic("Unknown kernel exception %x esr_el1 %lx\n", exception, esr); } + + td->td_frame = oframe; } /*