backtrace.c (6a5321ab) backtrace.c (40ae658c)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 102 unchanged lines hidden (view full) ---

111 Dl_info dli;
112 ptrdiff_t offset;
113
114 if ( 0 != dladdr( *pFramePtr, &dli ) )
115 {
116 if ( dli.dli_fname && dli.dli_fbase )
117 {
118 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 102 unchanged lines hidden (view full) ---

111 Dl_info dli;
112 ptrdiff_t offset;
113
114 if ( 0 != dladdr( *pFramePtr, &dli ) )
115 {
116 if ( dli.dli_fname && dli.dli_fbase )
117 {
118 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
119 fprintf( fp, "%s+0x%x", dli.dli_fname, offset );
119 fprintf( fp, "%s+0x%" SAL_PRI_PTRDIFFT "x", dli.dli_fname, offset );
120 }
121 if ( dli.dli_sname && dli.dli_saddr )
122 {
123 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
120 }
121 if ( dli.dli_sname && dli.dli_saddr )
122 {
123 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
124 fprintf( fp, "(%s+0x%x)", dli.dli_sname, offset );
124 fprintf( fp, "(%s+0x%" SAL_PRI_PTRDIFFT "x)", dli.dli_sname, offset );
125 }
126 }
127 fprintf( fp, "[%p]\n", *pFramePtr );
128 }
129
130 fflush( fp );
131 fclose( fp );
132 }

--- 132 unchanged lines hidden (view full) ---

265 Dl_info dli;
266 ptrdiff_t offset;
267
268 if ( 0 != dladdr( *pFramePtr, &dli ) )
269 {
270 if ( dli.dli_fname && dli.dli_fbase )
271 {
272 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
125 }
126 }
127 fprintf( fp, "[%p]\n", *pFramePtr );
128 }
129
130 fflush( fp );
131 fclose( fp );
132 }

--- 132 unchanged lines hidden (view full) ---

265 Dl_info dli;
266 ptrdiff_t offset;
267
268 if ( 0 != dladdr( *pFramePtr, &dli ) )
269 {
270 if ( dli.dli_fname && dli.dli_fbase )
271 {
272 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
273 fprintf( fp, "%s+0x%x", dli.dli_fname, offset );
273 fprintf( fp, "%s+0x%" SAL_PRI_PTRDIFFT "x", dli.dli_fname, offset );
274 }
275 if ( dli.dli_sname && dli.dli_saddr )
276 {
277 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
274 }
275 if ( dli.dli_sname && dli.dli_saddr )
276 {
277 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
278 fprintf( fp, "(%s+0x%x)", dli.dli_sname, offset );
278 fprintf( fp, "(%s+0x%" SAL_PRI_PTRDIFFT "x)", dli.dli_sname, offset );
279 }
280 }
281 fprintf( fp, "[%p]\n", *pFramePtr );
282 }
283
284 fflush( fp );
285 fclose( fp );
286 }

--- 44 unchanged lines hidden (view full) ---

331 Dl_info dli;
332 ptrdiff_t offset;
333
334 if ( 0 != dladdr( *pFramePtr, &dli ) )
335 {
336 if ( dli.dli_fname && dli.dli_fbase )
337 {
338 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
279 }
280 }
281 fprintf( fp, "[%p]\n", *pFramePtr );
282 }
283
284 fflush( fp );
285 fclose( fp );
286 }

--- 44 unchanged lines hidden (view full) ---

331 Dl_info dli;
332 ptrdiff_t offset;
333
334 if ( 0 != dladdr( *pFramePtr, &dli ) )
335 {
336 if ( dli.dli_fname && dli.dli_fbase )
337 {
338 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
339 fprintf( fp, "%s+0x%x", dli.dli_fname, offset );
339 fprintf( fp, "%s+0x%" SAL_PRI_PTRDIFFT "x", dli.dli_fname, offset );
340 }
341 if ( dli.dli_sname && dli.dli_saddr )
342 {
343 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
340 }
341 if ( dli.dli_sname && dli.dli_saddr )
342 {
343 offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
344 fprintf( fp, "(%s+0x%x)", dli.dli_sname, offset );
344 fprintf( fp, "(%s+0x%" SAL_PRI_PTRDIFFT "x)", dli.dli_sname, offset );
345 }
346 }
347 fprintf( fp, "[%p]\n", *pFramePtr );
348 }
349
350 fflush( fp );
351 fclose( fp );
352 }
353}
354
355#endif /* defined MACOSX */
345 }
346 }
347 fprintf( fp, "[%p]\n", *pFramePtr );
348 }
349
350 fflush( fp );
351 fclose( fp );
352 }
353}
354
355#endif /* defined MACOSX */