Created
August 15, 2014 06:10
-
-
Save awreece/bd13e7b2b827f5b1b2b5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#ifndef NDEBUG | |
#define ASSERT3(x, op, y) \ | |
do { \ | |
if (!((x) op (y))) { \ | |
fprintf(stderr, "Assertion failure on %s:%d: " \ | |
"expected " #x" (0x%lx) " #op \ | |
" " #y " (0x%lx)\n\n", \ | |
__FILE__, __LINE__, \ | |
(uintptr_t)x, (uintptr_t)y); \ | |
print_backtrace(0); \ | |
abort(); \ | |
} \ | |
} while (0) | |
#else | |
#define ASSERT3(x, op, y) | |
#endif |
This file contains hidden or 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
$ ./mdriver.debug | |
Assertion failure on mm.c:93: expected ptr (0x0) != NULL (0x0) | |
0 mdriver.debug 0x0000000100150b18 mfb_from_void + 92 | |
1 mdriver.debug 0x0000000100150d59 mm_free + 24 | |
2 mdriver.debug 0x000000010014f5eb eval_mm_valid + 1022 | |
3 mdriver.debug 0x000000010014d7ea run_tests + 324 | |
4 mdriver.debug 0x000000010014df9d main + 1686 | |
5 libdyld.dylib 0x00007fff94d835fd start + 1 | |
[1] 21524 abort ./mdriver.debug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment