From c7df550de42a4a95ccb102f605ffa7b22e70a9ad Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sat, 24 Jan 2009 04:18:19 +0000 Subject: Enabling crash dump on OS X. Adding extra version information to dumps. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8715 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/crash-u.cc | 6 +++--- crawl-ref/source/debug.cc | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/crash-u.cc b/crawl-ref/source/crash-u.cc index 8a1f3d000d..ab76768b25 100644 --- a/crawl-ref/source/crash-u.cc +++ b/crawl-ref/source/crash-u.cc @@ -13,7 +13,7 @@ REVISION("$Rev$"); #include #endif -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__APPLE__) #include #endif @@ -136,7 +136,7 @@ void dump_crash_info(FILE* file) name); } -#ifdef __GLIBC__ +#if defined(__GLIBC__) || defined(__APPLE__) // NOTE: This should work on OS X, according to // http://developer.apple.com/DOCUMENTATION/DARWIN/Reference/ManPages/man3/backtrace_symbols.3.html @@ -166,7 +166,7 @@ void write_stack_trace(FILE* file, int ignore_count) free(symbols); } -#else // ifdef __GLIBC__ +#else // if defined(__GLIBC__) || defined(__APPLE__) void write_stack_trace(FILE* file, int ignore_count) { const char* msg = "Unable to get stack trace on this platform." EOL; diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 45c7d406c0..6b3c1b91b8 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -5563,6 +5563,17 @@ void do_crash_dump() fprintf(file, "%s" EOL EOL, _assert_msg.c_str()); #endif + fprintf(file, "Revision: %d" EOL, svn_revision()); + fprintf(file, "Version: %s" EOL, CRAWL " " VERSION); +#if defined(UNIX) + fprintf(file, "Platform: unix" EOL); +#endif +#ifdef USE_TILE + fprintf(file, "Tiles: yes" EOL EOL); +#else + fprintf(file, "Tiles: no" EOL EOL); +#endif + // First get the immediate cause of the crash and the stack trace, // since that's most important and later attempts to get more information // might themselves cause crashes. -- cgit v1.2.3-54-g00ecf