summaryrefslogtreecommitdiff
path: root/gmessages.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1999-09-13 22:17:27 +0000
committerTim Janik <timj@src.gnome.org>1999-09-13 22:17:27 +0000
commit6072e65cafb320ef42fc821c2b32e97bf7ecb213 (patch)
treecf3e85c0af602d087c810c851ac10ccff0c8d01f /gmessages.c
parentebeb32f2526f9ba0106afe99c37fdde1c0d579b1 (diff)
downloadglib-6072e65cafb320ef42fc821c2b32e97bf7ecb213.tar.gz
in case we have to abort the program, debugging is enabled and we are not
Mon Sep 13 23:25:59 1999 Tim Janik <timj@gtk.org> * gmessages.c (g_logv): in case we have to abort the program, debugging is enabled and we are not called recursively, try to abort with raise (SIGTRAP) first, so developers may ignore certain failure conditions during debugging stage.
Diffstat (limited to 'gmessages.c')
-rw-r--r--gmessages.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gmessages.c b/gmessages.c
index c229ff5ce..786f76808 100644
--- a/gmessages.c
+++ b/gmessages.c
@@ -40,6 +40,7 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include <signal.h>
#ifdef NATIVE_WIN32
# define STRICT
@@ -387,7 +388,16 @@ g_logv (const gchar *log_domain,
/* *domain can be cluttered now */
if (test_level & G_LOG_FLAG_FATAL)
- abort ();
+ {
+#if defined (G_ENABLE_DEBUG) && defined (SIGTRAP)
+ if (!(test_level & G_LOG_FLAG_RECURSION))
+ raise (SIGTRAP);
+ else
+ abort ();
+#else /* !G_ENABLE_DEBUG || !SIGTRAP */
+ abort ();
+#endif /* !G_ENABLE_DEBUG || !SIGTRAP */
+ }
depth--;
g_private_set (g_log_depth, GUINT_TO_POINTER (depth));