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
This commit is contained in:
Justin Hibbits 2017-01-23 04:03:12 +00:00
parent 792e2f09ee
commit 8d2f50dba6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312659

View File

@ -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