summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-12 06:49:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-12 06:49:51 +0000
commit92430a031df42344a40ec050f6db8ff4b853e6e5 (patch)
treeb63a90393bb80911f89571320754340418401cad /vm_dump.c
parent297344e198a8015cc8920619c4f65f02cc0d0168 (diff)
vm_dump.c: preface_dump
* vm_dump.c (preface_dump): move platform specific preface. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 1825f6845c..f0d56bac6c 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -936,6 +936,25 @@ rb_dump_machine_register(const ucontext_t *ctx)
# define rb_dump_machine_register(ctx) ((void)0)
#endif /* HAVE_PRINT_MACHINE_REGISTERS */
+static void
+preface_dump(void)
+{
+#if defined __APPLE__
+ static const char msg[] = ""
+ "-- Crash Report log information "
+ "--------------------------------------------\n"
+ " See Crash Report log file under the one of following:\n"
+ " * ~/Library/Logs/CrashReporter\n"
+ " * /Library/Logs/CrashReporter\n"
+ " * ~/Library/Logs/DiagnosticReports\n"
+ " * /Library/Logs/DiagnosticReports\n"
+ " for more details.\n"
+ "\n";
+
+ fputs(msg, stderr);
+#endif
+}
+
void
rb_vm_bugreport(const void *ctx)
{
@@ -949,18 +968,8 @@ rb_vm_bugreport(const void *ctx)
#endif
const rb_vm_t *const vm = GET_VM();
-#if defined __APPLE__
- fputs("-- Crash Report log information "
- "--------------------------------------------\n"
- " See Crash Report log file under the one of following:\n"
- " * ~/Library/Logs/CrashReporter\n"
- " * /Library/Logs/CrashReporter\n"
- " * ~/Library/Logs/DiagnosticReports\n"
- " * /Library/Logs/DiagnosticReports\n"
- " for more details.\n"
- "\n",
- stderr);
-#endif
+ preface_dump();
+
if (vm) {
SDR();
rb_backtrace_print_as_bugreport();