summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorPedro Giffuni <pfg@apache.org>2015-11-25 22:08:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-11-30 17:22:58 +0000
commit0bd3aa40f5095e13d10f73076d8528178d146664 (patch)
tree02308810e414f918d552d537c7818b46d2ee4f3c /sal
parenta1a8aa8ef80066dd2fbabbf136dde874c864db8b (diff)
i66807 - Fix GCC warning in backtrace.c
The Bugzilla issue has another fix for sparc but I have no way ot test it. (cherry picked from commit 24e9542bcfaec3b49e5e825bf36d4bf524d69080)
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/backtrace.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index 1b664d69995b..522cb6f9463c 100644
--- a/sal/osl/unx/backtrace.c
+++ b/sal/osl/unx/backtrace.c
@@ -177,15 +177,23 @@ void backtrace_symbols_fd( void **buffer, int size, int fd )
if ( dli.dli_fname && dli.dli_fbase )
{
offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
+#if defined X86_64
+ fprintf( fp, "%s+0x%lx", dli.dli_fname, offset );
+#else
fprintf( fp, "%s+0x%x", dli.dli_fname, offset );
+#endif
}
if ( dli.dli_sname && dli.dli_saddr )
{
offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
+#if defined X86_64
+ fprintf( fp, "(%s+0x%lx)", dli.dli_sname, offset );
+#else
fprintf( fp, "(%s+0x%x)", dli.dli_sname, offset );
+#endif
}
}
- fprintf( fp, "[0x%x]\n", *pFramePtr );
+ fprintf( fp, "[0x%p]\n", *pFramePtr );
}
fflush( fp );
fclose( fp );