Enable stack traces for all executables in all builds #768
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change significantly simplifies the CMake boilerplate for enabling stack traces on an executable. Now you just need to add this to the
CMakeLists.txt
for executablefoo
:I've also enabled stack traces by default in release builds (previously they were enabled only in debug builds). I haven't seen any evidence that this will incur a measurable performance penalty, and I think having usable stack traces from crashes in production will be well worth it. But if anyone does want to measure the performance penalty, they can just pass
-DENABLE_STACKTRACE=OFF
on theircmake
command line (don't forget to deleteCMakeCache.txt
!).Note that stack traces have been enabled not only on the SDK executables (
gaia_db_server
,gaiac
,gaiat
), but also on all test executables (at least those configured viaadd_gtest()
). This should make debugging tests considerably easier, based on my experience.PS: I have not verified that this works on ARM builds. I'd appreciate it if someone can verify this (there may be additional compiler/linker flags required).