Date: Mon, 23 Jan 2017 04:03:12 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312659 - head/sys/powerpc/powerpc Message-ID: <201701230403.v0N43Cmw001652@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Mon Jan 23 04:03:12 2017 New Revision: 312659 URL: https://svnweb.freebsd.org/changeset/base/312659 Log: Avoid using non-zero argument for __builtin_frame_address(). Building kernel with devel/powerpc64-gcc (6.2.0) yields the following error: /usr/src/sys/powerpc/powerpc/db_trace.c:299:20: error: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Werror=frame-address] Work around this by dereferencing the frame address manually instead. PR: 215600 Reported by: Mark Millard <markmi AT dsl-only DOT net> MFC after: 2 weeks Modified: head/sys/powerpc/powerpc/db_trace.c Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Mon Jan 23 02:21:06 2017 (r312658) +++ head/sys/powerpc/powerpc/db_trace.c Mon Jan 23 04:03:12 2017 (r312659) @@ -296,8 +296,12 @@ db_trace_self(void) { db_addr_t addr; - addr = (db_addr_t)__builtin_frame_address(1); - db_backtrace(curthread, addr, -1); + addr = (db_addr_t)__builtin_frame_address(0); + if (addr == 0) { + db_printf("Null frame address\n"); + return; + } + db_backtrace(curthread, *(db_addr_t *)addr, -1); } int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701230403.v0N43Cmw001652>