A failed BLACK_VERIFY will generate a Crashpad crash report.

Using noinline to make sure the call to failedVerify is visible in the stack trace.
This commit is contained in:
Mathew Sutcliffe
2017-05-15 22:02:01 +01:00
parent 5b8d76c06c
commit ce6d0d8f1e
2 changed files with 16 additions and 1 deletions

View File

@@ -14,6 +14,14 @@
#include "blackmisc/blackmiscexport.h"
//! \cond
#ifdef Q_CC_MSVC
#define BLACK_NO_INLINE __declspec(noinline)
#else
#define BLACK_NO_INLINE __attribute__((noinline))
#endif
//! \endcond
namespace BlackMisc
{
namespace Private
@@ -22,7 +30,7 @@ namespace BlackMisc
inline void noop() {}
//! \private Called by BLACK_VERIFY when the condition is false.
BLACKMISC_EXPORT void failedVerify(const char *condition, const char *filename, int line, const char *context = nullptr, const char *message = nullptr);
BLACKMISC_EXPORT BLACK_NO_INLINE void failedVerify(const char *condition, const char *filename, int line, const char *context = nullptr, const char *message = nullptr);
}
}