[retro-gtk] runner: Print a strack trace on SIGABRT
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] runner: Print a strack trace on SIGABRT
- Date: Sat, 19 Dec 2020 10:05:21 +0000 (UTC)
commit 7dac6515a834e4f947db7404f4b4c663a00f56dc
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat Dec 19 10:51:51 2020 +0100
runner: Print a strack trace on SIGABRT
This makes debugging easier.
retro-runner/retro-runner.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/retro-runner/retro-runner.c b/retro-runner/retro-runner.c
index e7057d0..ca1b76e 100644
--- a/retro-runner/retro-runner.c
+++ b/retro-runner/retro-runner.c
@@ -47,9 +47,9 @@ run_main_loop (GMainLoop *loop,
}
static void
-print_backtrace_on_sigsegv_cb (int sig,
- siginfo_t *si,
- void *unused)
+print_backtrace_on_crash_cb (int sig,
+ siginfo_t *si,
+ void *unused)
{
g_on_error_stack_trace (RETRO_RUNNER_PRGNAME);
@@ -87,10 +87,13 @@ main (gint argc,
sa.sa_flags = SA_SIGINFO;
sigemptyset (&sa.sa_mask);
- sa.sa_sigaction = print_backtrace_on_sigsegv_cb;
+ sa.sa_sigaction = print_backtrace_on_crash_cb;
if (G_UNLIKELY (sigaction (SIGSEGV, &sa, NULL) == -1))
g_critical ("Couldn't set a SIGSEGV handler.");
+
+ if (G_UNLIKELY (sigaction (SIGABRT, &sa, NULL) == -1))
+ g_critical ("Couldn't set a SIGABRT handler.");
}
loop = g_main_loop_new (NULL, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]