#include <mono/utils/mono-logger-internal.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/dtrace.h>
+#include <mono/utils/mono-signal-handler.h>
#include "mini.h"
#include <string.h>
return FALSE;
}
-static void
-SIG_HANDLER_SIGNATURE (sigabrt_signal_handler)
+SIG_HANDLER_FUNC (static, sigabrt_signal_handler)
{
MonoJitInfo *ji = NULL;
GET_CONTEXT;
}
}
-static void
-SIG_HANDLER_SIGNATURE (sigusr1_signal_handler)
+SIG_HANDLER_FUNC (static, sigusr1_signal_handler)
{
gboolean running_managed;
MonoException *exc;
mono_arch_handle_exception (ctx, exc);
}
+
#if defined(__i386__) || defined(__x86_64__)
#define FULL_STAT_PROFILER_BACKTRACE 1
#define CURRENT_FRAME_GET_BASE_POINTER(f) (* (gpointer*)(f))
#define FULL_STAT_PROFILER_BACKTRACE 0
#endif
+#ifdef SIGPROF
#if defined(__ia64__) || defined(__sparc__) || defined(sparc) || defined(__s390__) || defined(s390)
-static void
-SIG_HANDLER_SIGNATURE (sigprof_signal_handler)
+SIG_HANDLER_FUNC (static, sigprof_signal_handler)
{
if (mono_chain_signal (SIG_HANDLER_PARAMS))
return;
#else
-static void
-SIG_HANDLER_SIGNATURE (sigprof_signal_handler)
+SIG_HANDLER_FUNC (static, sigprof_signal_handler)
{
int call_chain_depth = mono_profiler_stat_get_call_chain_depth ();
MonoProfilerCallChainStrategy call_chain_strategy = mono_profiler_stat_get_call_chain_strategy ();
mono_chain_signal (SIG_HANDLER_PARAMS);
}
+#endif
#endif
-static void
-SIG_HANDLER_SIGNATURE (sigquit_signal_handler)
+SIG_HANDLER_FUNC (static, sigquit_signal_handler)
{
gboolean res;
mono_chain_signal (SIG_HANDLER_PARAMS);
}
-static void
-SIG_HANDLER_SIGNATURE (sigusr2_signal_handler)
+SIG_HANDLER_FUNC (static, sigusr2_signal_handler)
{
gboolean enabled = mono_trace_is_enabled ();
*/
sigemptyset (&signal_set);
sigaddset (&signal_set, mono_thread_get_abort_signal ());
+ if (mono_gc_get_suspend_signal () != -1)
+ sigaddset (&signal_set, mono_gc_get_suspend_signal ());
+ if (mono_gc_get_restart_signal () != -1)
+ sigaddset (&signal_set, mono_gc_get_restart_signal ());
+ sigaddset (&signal_set, SIGCHLD);
sigprocmask (SIG_UNBLOCK, &signal_set, NULL);
signal (SIGPIPE, SIG_IGN);
commands = fopen (template, "w");
fprintf (commands, "process attach --pid %ld\n", (long) crashed_pid);
- fprintf (commands, "script lldb.debugger.HandleCommand (\"thread list\")\n");
- fprintf (commands, "script lldb.debugger.HandleCommand (\"thread backtrace all\")\n");
+ fprintf (commands, "thread list\n");
+ fprintf (commands, "thread backtrace all\n");
fprintf (commands, "detach\n");
fprintf (commands, "quit\n");
#if !defined (__MACH__)
gboolean
-mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoNativeThreadId thread_id, MonoNativeThreadHandle thread_handle)
+mono_thread_state_init_from_handle (MonoThreadUnwindState *tctx, MonoThreadInfo *info)
{
g_error ("Posix systems don't support mono_thread_state_init_from_handle");
return FALSE;