mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: addr2line for Darwin handles relative addresses for executables
This commit is contained in:
@ -115,13 +115,13 @@ void printSourceFileAndLine
|
|||||||
uintptr_t address = uintptr_t(addr);
|
uintptr_t address = uintptr_t(addr);
|
||||||
word myAddress = addressToWord(address);
|
word myAddress = addressToWord(address);
|
||||||
|
|
||||||
if
|
// Can use relative addresses for executables and libraries with the
|
||||||
(
|
// Darwin addr2line implementation.
|
||||||
filename.hasExt("so")
|
// On other systems (Linux), only use relative addresses for libraries.
|
||||||
#ifdef darwin
|
|
||||||
|| filename.hasExt("dylib")
|
#ifndef darwin
|
||||||
#endif
|
if (filename.hasExt("so"))
|
||||||
)
|
#endif
|
||||||
{
|
{
|
||||||
// Convert address into offset into dynamic library
|
// Convert address into offset into dynamic library
|
||||||
uintptr_t offset = uintptr_t(info->dli_fbase);
|
uintptr_t offset = uintptr_t(info->dli_fbase);
|
||||||
|
|||||||
Reference in New Issue
Block a user