summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-24 04:18:19 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-24 04:18:19 +0000
commitc7df550de42a4a95ccb102f605ffa7b22e70a9ad (patch)
treef896f40159220d6dce77c98c97a0211fb9349bf3
parent16e3c0a6d878e04580324c67b4d55d0620de260a (diff)
downloadcrawl-ref-c7df550de42a4a95ccb102f605ffa7b22e70a9ad.tar.gz
crawl-ref-c7df550de42a4a95ccb102f605ffa7b22e70a9ad.zip
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
-rw-r--r--crawl-ref/source/crash-u.cc6
-rw-r--r--crawl-ref/source/debug.cc11
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 <signal.h>
#endif
-#ifdef __GLIBC__
+#if defined(__GLIBC__) || defined(__APPLE__)
#include <execinfo.h>
#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.