[Libreoffice-commits] core.git: 2 commits - sal/osl

Damjan Jovanovic damjan at apache.org
Mon Nov 30 09:26:27 PST 2015


 sal/osl/unx/backtrace.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 7a93f5348007ab1ce52e65cd3811032f31839689
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Fri Nov 27 04:01:03 2015 +0000

    Use the ptrdiff_t printf format code for backtracing on FreeBSD.
    
    Patch by: me
    
    (cherry picked from commit e0e462a3e64576be14a4341f4dc4a2d56f22fa2a)
    
    Change-Id: I1c59b2b631dbfd508d85abb774f27187ded47c17

diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index 522cb6f..43a13d8 100644
--- a/sal/osl/unx/backtrace.c
+++ b/sal/osl/unx/backtrace.c
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/types.h"
+
 #ifdef SOLARIS
 
 #include <dlfcn.h>
@@ -177,20 +179,12 @@ 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
+                    fprintf( fp, "%s+0x%" SAL_PRI_PTRDIFFT "x", dli.dli_fname, offset );
                 }
                 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, "(%s+0x%" SAL_PRI_PTRDIFFT "x)", dli.dli_sname, offset );
                 }
             }
             fprintf( fp, "[0x%p]\n", *pFramePtr );
commit 0bd3aa40f5095e13d10f73076d8528178d146664
Author: Pedro Giffuni <pfg at apache.org>
Date:   Wed Nov 25 22:08:04 2015 +0000

    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)

diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index 1b664d6..522cb6f 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 );


More information about the Libreoffice-commits mailing list