-
-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom assertion mechanism with backtrace printing
This change will allow getting more complete reports from assertion failures. This will smooth the the bug report process, as users won't have to get a backtrace from a debugger. As part of this change, assertions are now enabled in release builds of the compiler, as discussed in #1553. They still are disabled in release builds of the runtime. In the future, this system could be extended with even more precise information like line numbers. Parsing the debug information of the executables and libraries will be required for this. Closes #1553.
- Loading branch information
Benoit Vey
committed
Feb 24, 2017
1 parent
c714443
commit 510a2df
Showing
104 changed files
with
1,398 additions
and
1,214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef PLATFORM_PONYASSERT_H | ||
#define PLATFORM_PONYASSERT_H | ||
|
||
#include "platform.h" | ||
|
||
PONY_EXTERN_C_BEGIN | ||
|
||
#if defined(NDEBUG) && defined(PONY_NO_ASSERT) | ||
# define pony_assert(expr) ((void)0) | ||
#else | ||
# define pony_assert(expr) \ | ||
((expr) ? (void)0 : \ | ||
ponyint_assert_fail(#expr, __FILE__, __LINE__, __func__)) | ||
#endif | ||
|
||
void ponyint_assert_fail(const char* expr, const char* file, size_t line, | ||
const char* func); | ||
|
||
PONY_EXTERN_C_END | ||
|
||
#endif |
Oops, something went wrong.