diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2010-03-27 17:35:10 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2010-03-29 09:37:17 -0700 |
commit | 436d0bb9cca122bfdde32902b683d2499f61e6fc (patch) | |
tree | d0f286171640b092de061b7d8bbc5fa823ce0990 /os/log.c | |
parent | 73b3b67aac9f3938a96cb8822b9c270bd82ded5c (diff) |
darwin: Generate crash reports on FatalError()
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'os/log.c')
-rw-r--r-- | os/log.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -117,6 +117,12 @@ static char *saveBuffer = NULL; static int bufferSize = 0, bufferUnused = 0, bufferPos = 0; static Bool needBuffer = TRUE; +#ifdef __APPLE__ +static char __crashreporter_info_buff__[4096] = {0}; +static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0]; +asm (".desc __crashreporter_info__, 0x10"); +#endif + /* Prefix strings for log messages. */ #ifndef X_UNKNOWN_STRING #define X_UNKNOWN_STRING "(\?\?)" @@ -527,6 +533,9 @@ FatalError(const char *f, ...) ErrorF("\nFatal server error:\n"); va_start(args, f); +#ifdef __APPLE__ + (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args); +#endif VErrorF(f, args); va_end(args); ErrorF("\n"); |