New header containing GTK_DEBUG-style debugging support for GLib.

* glib/gdebug.h: New header containing GTK_DEBUG-style debugging
	support for GLib. Currently only the fatal_warnings debug option exists.

	* glib/gmessages.c (g_log_msg_prefix_init): New one-shot function
	for parsing G_MESSAGES_PREFIXED.
	(_g_debug_init): New one-shot function for parsing G_DEBUG.
	(g_log_write_prefix): Use g_log_msg_prefix_init().
	(g_messages_init): Use g_log_msg_prefix_init() and _g_debug_init().

	* glib/Makefile.am (libglib_1_3_la_SOURCES): Add gdebug.h.


	* glib/Makefile.am (IGNORE_HFILES): Add gdebug.h.

	* glib/running.sgml: Document the G_DEBUG environment variable.

	* glib/tmpl/threads.sgml: Replace g_thread_wait() by
	g_thread_join() in two places.
This commit is contained in:
Matthias Clasen
2002-02-21 23:07:34 +00:00
parent 470d428f1d
commit 642897a7f3
15 changed files with 273 additions and 38 deletions

View File

@@ -1,3 +1,12 @@
2002-02-21 Matthias Clasen <maclas@gmx.de>
* glib/Makefile.am (IGNORE_HFILES): Add gdebug.h.
* glib/running.sgml: Document the G_DEBUG environment variable.
* glib/tmpl/threads.sgml: Replace g_thread_wait() by
g_thread_join() in two places.
2002-02-20 Sven Neumann <sven@gimp.org>
* gobject/gobject-sections.txt

View File

@@ -34,7 +34,8 @@ IGNORE_HFILES= \
gunicomp.h \
gunidecomp.h \
gunichartables.h \
glibconfig-sysdefs.h
glibconfig-sysdefs.h \
gdebug.h
# Extra files to add when scanning
EXTRA_HFILES=

View File

@@ -38,7 +38,27 @@ variables like <envar>LANG</envar>, <envar>PATH</envar> or <envar>HOME</envar>.
<para>
A list of log levels for which messages should be prefixed by the
program name and PID of the application. The default is to prefix
everything except %G_LOG_LEVEL_MESSAGE and %G_LOG_LEVEL_INFO.
everything except <literal>G_LOG_LEVEL_MESSAGE</literal> and <literal>G_LOG_LEVEL_INFO</literal>.
</para>
</formalpara>
<formalpara>
<title><envar>G_DEBUG</envar></title>
<para>
If GLib has been configured with <option>--enable-debug=yes</option>,
this variable can be set to a list of debug options, which cause GLib
to print out different types of debugging information.
<variablelist>
<varlistentry>
<term>fatal_warnings</term>
<listitem><para>Causes GLib to abort the program at the first call
to <link linkend="g-warning">g_warning</link>(). This option is
special in that it doesn't require GLib to be configured with
debugging support.</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</formalpara>
@@ -61,9 +81,9 @@ static volatile gulong g_trap_free_size;
static volatile gulong g_trap_realloc_size;
static volatile gulong g_trap_malloc_size;
</programlisting>
If set to a size > 0, <link linkend="g-free">g_free()</link>,
<link linkend="g-realloc">g_realloc()</link> and
<link linkend="g-malloc">g_malloc()</link> will be intercepted if the size
If set to a size > 0, <link linkend="g-free">g_free</link>(),
<link linkend="g-realloc">g_realloc</link>() and
<link linkend="g-malloc">g_malloc</link>() will be intercepted if the size
matches the size of the corresponding memory block. This will only work with
<literal>g_mem_set_vtable (glib_mem_profiler_table)</literal> upon startup
though, because memory profiling is required to match on the memory block sizes.

View File

@@ -274,7 +274,7 @@ This function creates a new thread with the priority @priority.
<para>
If @joinable is %TRUE, you can wait for this threads termination
calling g_thread_wait(). Otherwise the thread will just disappear, when
calling g_thread_join(). Otherwise the thread will just disappear, when
ready.
</para>
@@ -304,7 +304,7 @@ platform, if @stack_size is 0.
<para>
If @joinable is %TRUE, you can wait for this threads termination
calling g_thread_wait(). Otherwise the thread will just disappear, when
calling g_thread_join(). Otherwise the thread will just disappear, when
ready. If @bound is %TRUE, this thread will be scheduled in the system
scope, otherwise the implementation is free to do scheduling in the
process scope. The first variant is more expensive resource-wise, but