17 #include "llvm/Config/config.h"
25 #ifdef HAVE_CRASHREPORTERCLIENT_H
26 #include <CrashReporterClient.h>
37 OS << NextID <<
".\t";
52 OS <<
"Stack dump:\n";
59 #if defined (__APPLE__) && HAVE_CRASHREPORTERCLIENT_H
63 CRASH_REPORTER_CLIENT_HIDDEN
64 struct crashreporter_annotations_t gCRAnnotations
65 __attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION)))
66 = { CRASHREPORTER_ANNOTATIONS_VERSION, 0, 0, 0, 0, 0, 0 };
68 #elif defined (__APPLE__) && HAVE_CRASHREPORTER_INFO
69 static const char *__crashreporter_info__ = 0;
70 asm(
".desc ___crashreporter_info__, 0x10");
89 if (!TmpStr.
empty()) {
90 #ifdef HAVE_CRASHREPORTERCLIENT_H
92 (void)CRSetCrashLogMessage(std::string(TmpStr.
str()).
c_str());
93 #elif HAVE_CRASHREPORTER_INFO
94 __crashreporter_info__ =
strdup(std::string(TmpStr.
str()).
c_str());
122 "Pretty stack trace entry destruction is out of order");
131 OS <<
"Program arguments: ";
133 for (
unsigned i = 0, e = ArgC; i != e; ++i)
134 OS << ArgV[i] <<
' ';
146 (void)HandlerRegistered;
void EnablePrettyStackTrace()
const PrettyStackTraceEntry * getNextEntry() const
getNextEntry - Return the next entry in the list of frames.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
void LLVMEnablePrettyStackTrace()
static void PrintCurStackTrace(raw_ostream &OS)
PrintCurStackTrace - Print the current stack trace to the specified stream.
virtual ~PrettyStackTraceEntry()
char *strdup(const char *s1);
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
static unsigned PrintStack(const PrettyStackTraceEntry *Entry, raw_ostream &OS)
virtual void print(raw_ostream &OS) const LLVM_OVERRIDE
print - Emit information about this stack frame to OS.
virtual void print(raw_ostream &OS) const LLVM_OVERRIDE
print - Emit information about this stack frame to OS.
static bool RegisterCrashPrinter()
StringRef str() const
Explicit conversion to StringRef.
static ManagedStatic< sys::ThreadLocal< const PrettyStackTraceEntry > > PrettyStackTraceHead
virtual void print(raw_ostream &OS) const =0
print - Emit information about this stack frame to OS.
static void CrashHandler(void *)
void *__dso_handle __attribute__((__visibility__("hidden")))
void AddSignalHandler(void(*FnPtr)(void *), void *Cookie)