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.
This commit is contained in:
Tim Janik 1999-09-13 22:17:27 +00:00 committed by Tim Janik
parent ebeb32f252
commit 6072e65caf
10 changed files with 78 additions and 2 deletions

View File

@ -1,3 +1,10 @@
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.
Thu Aug 26 15:09:36 1999 Tim Janik <timj@gtk.org>
* Makefile.am:

View File

@ -1,3 +1,10 @@
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.
Thu Aug 26 15:09:36 1999 Tim Janik <timj@gtk.org>
* Makefile.am:

View File

@ -1,3 +1,10 @@
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.
Thu Aug 26 15:09:36 1999 Tim Janik <timj@gtk.org>
* Makefile.am:

View File

@ -1,3 +1,10 @@
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.
Thu Aug 26 15:09:36 1999 Tim Janik <timj@gtk.org>
* Makefile.am:

View File

@ -1,3 +1,10 @@
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.
Thu Aug 26 15:09:36 1999 Tim Janik <timj@gtk.org>
* Makefile.am:

View File

@ -1,3 +1,10 @@
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.
Thu Aug 26 15:09:36 1999 Tim Janik <timj@gtk.org>
* Makefile.am:

View File

@ -1,3 +1,10 @@
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.
Thu Aug 26 15:09:36 1999 Tim Janik <timj@gtk.org>
* Makefile.am:

View File

@ -1,3 +1,10 @@
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.
Thu Aug 26 15:09:36 1999 Tim Janik <timj@gtk.org>
* Makefile.am:

View File

@ -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));

View File

@ -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));