From owner-svn-src-all@freebsd.org Tue Dec 13 19:36:07 2016 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 25765C76F22; Tue, 13 Dec 2016 19:36:07 +0000 (UTC) (envelope-from jhb@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 E987E120E; Tue, 13 Dec 2016 19:36:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDJa6oR091338; Tue, 13 Dec 2016 19:36:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDJa6QQ091337; Tue, 13 Dec 2016 19:36:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612131936.uBDJa6QQ091337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 13 Dec 2016 19:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310030 - head/sys/mips/mips X-SVN-Group: head 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: Tue, 13 Dec 2016 19:36:07 -0000 Author: jhb Date: Tue Dec 13 19:36:05 2016 New Revision: 310030 URL: https://svnweb.freebsd.org/changeset/base/310030 Log: Use register_t instead of uintptr_t for register values in backtraces. This fixes backtraces from DDB in n32 kernels as uintptr_t is only a uint32_t. In particular, the upper 32-bits of each register value were treated as the register's value breaking both the output of register values, but also the values of 'ra' and 'sp' required to walk up to the previous frame. Sponsored by: DARPA / AFRL Modified: head/sys/mips/mips/db_trace.c Modified: head/sys/mips/mips/db_trace.c ============================================================================== --- head/sys/mips/mips/db_trace.c Tue Dec 13 19:27:31 2016 (r310029) +++ head/sys/mips/mips/db_trace.c Tue Dec 13 19:36:05 2016 (r310030) @@ -139,8 +139,8 @@ stacktrace_subr(register_t pc, register_ * of these registers is valid, e.g. obtained from the stack */ int valid_args[4]; - uintptr_t args[4]; - uintptr_t va, subr; + register_t args[4]; + register_t va, subr; unsigned instr, mask; unsigned int frames = 0; int more, stksize, j; @@ -379,7 +379,7 @@ done: if (j > 0) (*printfn)(","); if (valid_args[j]) - (*printfn)("%x", args[j]); + (*printfn)("%jx", (uintmax_t)(u_register_t)args[j]); else (*printfn)("?"); }