compiler: add CONFIG_COMPILER_TRACK_MACRO_EXPANSION

Add a new compiler option to control tracking locations of tokens across
macro expansions. It may be useful to disable it when debugging long
macro expansion chains.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2023-05-05 09:58:12 +02:00 committed by Carles Cufí
commit 99ebe39289
3 changed files with 16 additions and 0 deletions

View file

@ -182,6 +182,9 @@ set_compiler_property(PROPERTY debug -g)
# Flags to save temporary object files
set_compiler_property(PROPERTY save_temps -save-temps=obj)
# Flags to not track macro expansion
set_compiler_property(PROPERTY no_track_macro_expansion -ftrack-macro-expansion=0)
# GCC 11 by default emits DWARF version 5 which cannot be parsed by
# pyelftools. Can be removed once pyelftools supports v5.
check_set_compiler_property(APPEND PROPERTY debug -gdwarf-4)