Bug 761857 - Make MOZ_CRASH on Linux crash in such a way that an attached debugger will park on the line containing the assertion. r=ted

--HG--
extra : rebase_source : 0628998cb0e2eec047426375c971aac1a84ebed1
This commit is contained in:
Jeff Walden 2012-06-05 16:49:19 -07:00
Родитель c200d6be5c
Коммит af9bf2ebd1
1 изменённых файлов: 6 добавлений и 15 удалений

Просмотреть файл

@ -112,7 +112,7 @@ extern "C" {
*/
# define MOZ_CRASH() \
do { \
*((volatile int *) NULL) = 123; \
*((volatile int*) NULL) = 123; \
exit(3); \
} while (0)
#elif defined(ANDROID)
@ -124,30 +124,21 @@ extern "C" {
# ifdef __cplusplus
# define MOZ_CRASH() \
do { \
*((volatile int *) NULL) = 123; \
*((volatile int*) NULL) = 123; \
::abort(); \
} while (0)
# else
# define MOZ_CRASH() \
do { \
*((volatile int *) NULL) = 123; \
*((volatile int*) NULL) = 123; \
abort(); \
} while (0)
# endif
#elif defined(__APPLE__)
/*
* On Mac OS X, Breakpad ignores signals. Only real Mach exceptions are
* trapped.
*/
# define MOZ_CRASH() \
do { \
*((volatile int *) NULL) = 123; \
raise(SIGABRT); /* In case above statement gets nixed by the optimizer. */ \
} while (0)
#else
# define MOZ_CRASH() \
do { \
raise(SIGABRT); /* To continue from here in GDB: "signal 0". */ \
*((volatile int*) NULL) = 123; \
raise(SIGABRT); /* In case above statement gets nixed by the optimizer. */ \
} while (0)
#endif