Answer the question
In order to leave comments, you need to log in
Is it a good practice to use Stack Trace libraries in a debug build?
Hello everyone
Is it good practice to use tools like Backward-cpp during application development ? And are there any unobvious pitfalls? (it is clear that compilation with the optimization flag turned off)
Also, in particular, Backward-cpp can hang callbacks on various system signals such as an unhandled exception or segfault.
Using the assert macro as an example:
// smartAssert.h
void smartAssert(bool expression)
{
if (expression)
return;
using namespace backward;
StackTrace stackTrace;
stackTrace.load_here(32);
Printer printer;
printer.object = true;
printer.color_mode = ColorMode::always;
printer.address = true;
printer.print(stackTrace, stdout);
}
#ifdef DEBUG
# include "external/backward/backward.cpp"
#endif
#ifdef DEBUG
# include "SmartAssert.h"
# define SMART_ASSERT(expression) do { smartAssert(expression); } while (0)
#else
# define SMART_ASSERT(expression) do {} while (0)
#endif
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question