diff options
author | Justin Hibbits <jhibbits@FreeBSD.org> | 2017-01-23 04:03:12 +0000 |
---|---|---|
committer | Justin Hibbits <jhibbits@FreeBSD.org> | 2017-01-23 04:03:12 +0000 |
commit | 8d2f50dba65df499770397f305d07d25f9fe4776 (patch) | |
tree | b51785a48f5ac621ad1a4324ea15e5172683ba8a /sys/powerpc | |
parent | 792e2f09ee6eedb3ee3e875a29af0a32d54f6732 (diff) | |
download | src-8d2f50dba65df499770397f305d07d25f9fe4776.tar.gz src-8d2f50dba65df499770397f305d07d25f9fe4776.zip |
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
Notes
Notes:
svn path=/head/; revision=312659
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/powerpc/db_trace.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/powerpc/powerpc/db_trace.c b/sys/powerpc/powerpc/db_trace.c index 357695575ec1..ceecacfe534d 100644 --- a/sys/powerpc/powerpc/db_trace.c +++ b/sys/powerpc/powerpc/db_trace.c @@ -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 |