Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable stack traces for all executables in all builds #768

Merged
merged 4 commits into from
Jul 8, 2021

Conversation

senderista
Copy link
Contributor

@senderista senderista commented Jul 2, 2021

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 executable foo:

if(ENABLE_STACKTRACE)
  target_link_libraries(foo PRIVATE gaia_stack_trace)
endif()

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 their cmake command line (don't forget to delete CMakeCache.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 via add_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).

@senderista senderista requested review from daxhaw and simone-gaia July 2, 2021 21:42
@senderista senderista merged commit 28a9a28 into master Jul 8, 2021
@senderista senderista deleted the enable_stack_traces branch July 8, 2021 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants