1
//===------------------------- abort_message.cpp --------------------------===//
3
// The LLVM Compiler Infrastructure
5
// This file is dual licensed under the MIT and the University of Illinois Open
6
// Source Licenses. See LICENSE.TXT for details.
8
//===----------------------------------------------------------------------===//
13
#include "abort_message.h"
15
#pragma GCC visibility push(hidden)
18
# if defined(__has_include) && __has_include(<CrashReporterClient.h>)
19
# define HAVE_CRASHREPORTERCLIENT_H 1
20
# include <CrashReporterClient.h>
24
__attribute__((visibility("hidden"), noreturn))
25
void abort_message(const char* format, ...)
27
// write message to stderr
29
fprintf(stderr, "libc++abi.dylib: ");
32
va_start(list, format);
33
vfprintf(stderr, format, list);
35
fprintf(stderr, "\n");
37
#if __APPLE__ && HAVE_CRASHREPORTERCLIENT_H
38
// record message in crash report
41
va_start(list2, format);
42
vasprintf(&buffer, format, list2);
44
CRSetCrashLogMessage(buffer);
50
#pragma GCC visibility pop