Alter linux debug stacktraces handling to support more environments

- Use -gdwarf-4 to support both LLVM and GCC when calling addr2line
- Subtract position-independant execuable relocation when passing the
  address to addr2line
This commit is contained in:
Ekaterina Vaartis
2023-01-15 01:18:00 +03:00
parent fcba87e696
commit 5e041eee11
2 changed files with 25 additions and 18 deletions

View File

@ -540,6 +540,9 @@ if selected_platform in platform_list:
env.Append(CCFLAGS=["/Od"])
else:
if env["debug_symbols"]:
# Adding dwarf-4 explicitly makes stacktraces work with clang builds,
# otherwise addr2line doesn't understand them
env.Append(CCFLAGS=["-gdwarf-4"])
if env.dev_build:
env.Append(CCFLAGS=["-g3"])
else: