diff options
author | Eric Christopher <echristo@apple.com> | 2010-06-22 21:01:04 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-06-22 21:01:04 +0000 |
commit | e9c1bb6cb12e888885449b3988f1259490e58160 (patch) | |
tree | 1a33ced8aeb2e88fdef3033d14123d95529b9d10 /llvm/lib/Support/PrettyStackTrace.cpp | |
parent | 6d4802ba6cf0d328af2618579d27778a4c0b4eb9 (diff) | |
download | bcm5719-llvm-e9c1bb6cb12e888885449b3988f1259490e58160.tar.gz bcm5719-llvm-e9c1bb6cb12e888885449b3988f1259490e58160.zip |
Look for and use a different darwin crash reporter library.
llvm-svn: 106576
Diffstat (limited to 'llvm/lib/Support/PrettyStackTrace.cpp')
-rw-r--r-- | llvm/lib/Support/PrettyStackTrace.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp index 7a04a530c56..e01c491fb3a 100644 --- a/llvm/lib/Support/PrettyStackTrace.cpp +++ b/llvm/lib/Support/PrettyStackTrace.cpp @@ -12,11 +12,17 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Config/config.h" // Get autoconf configuration settings #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Signals.h" #include "llvm/System/ThreadLocal.h" #include "llvm/ADT/SmallString.h" + +#ifdef HAVE_CRASHREPORTERCLIENT_H +#include <CrashReporterClient.h> +#endif + using namespace llvm; namespace llvm { @@ -49,7 +55,7 @@ static void PrintCurStackTrace(raw_ostream &OS) { } // Integrate with crash reporter. -#ifdef __APPLE__ +#if defined (__APPLE__) && !defined (HAVE_CRASHREPORTERCLIENT_H) static const char *__crashreporter_info__ = 0; asm(".desc ___crashreporter_info__, 0x10"); #endif @@ -71,7 +77,11 @@ static void CrashHandler(void *Cookie) { } if (!TmpStr.empty()) { +#ifndef HAVE_CRASHREPORTERCLIENT_H __crashreporter_info__ = strdup(std::string(TmpStr.str()).c_str()); +#else + CRSetCrashLogMessage(std::string(TmpStr.str()).c_str()); +#endif errs() << TmpStr.str(); } |