summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-25 03:46:55 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-25 03:46:55 (GMT)
commit82f4c4d4d7200c77ee93611b96b97a8326429ce9 (patch)
tree7422f252d161d2cb8158b18d42fa2271778fc770 /signal.c
parentc1b5b93b3ff946dd6a13d201e3c3c80d37f651ff (diff)
report bug with machine regisiters
* error.c (rb_bug_context): new function to report bug with context. * vm_dump.c (rb_vm_bugreport): accepts `ucontext_t` argument to dump machine regisiters. based on [GH-584]. * signal.c (sigbus, sigsegv): dump machine regisiters if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/signal.c b/signal.c
index e24cc75..5af01fe 100644
--- a/signal.c
+++ b/signal.c
@@ -507,9 +507,11 @@ typedef RETSIGTYPE (*sighandler_t)(int);
#ifdef USE_SIGALTSTACK
typedef void ruby_sigaction_t(int, siginfo_t*, void*);
#define SIGINFO_ARG , siginfo_t *info, void *ctx
+#define SIGINFO_CTX ctx
#else
typedef RETSIGTYPE ruby_sigaction_t(int);
#define SIGINFO_ARG
+#define SIGINFO_CTX 0
#endif
#ifdef USE_SIGALTSTACK
@@ -776,7 +778,7 @@ sigbus(int sig SIGINFO_ARG)
#if defined __APPLE__
CHECK_STACK_OVERFLOW();
#endif
- rb_bug("Bus Error" MESSAGE_FAULT_ADDRESS);
+ rb_bug_context(SIGINFO_CTX, "Bus Error" MESSAGE_FAULT_ADDRESS);
}
#endif
@@ -813,7 +815,7 @@ sigsegv(int sig SIGINFO_ARG)
segv_received = 1;
ruby_disable_gc_stress = 1;
- rb_bug("Segmentation fault" MESSAGE_FAULT_ADDRESS);
+ rb_bug_context(SIGINFO_CTX, "Segmentation fault" MESSAGE_FAULT_ADDRESS);
}
#endif