mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-05 00:43:40 +02:00
s/glib_trap_/g_trap_/. add comments on g_trap_instance_signals,
Sun Feb 4 07:38:32 2001 Tim Janik <timj@gtk.org> * docs/debugging.txt: s/glib_trap_/g_trap_/. add comments on g_trap_instance_signals, g_trace_instance_signals and GRUNTIME_DEBUG. * gmem.c: s/glib_trap_/g_trap_/. Sun Feb 4 07:30:53 2001 Tim Janik <timj@gtk.org> * gtype.[hc]: changed g_type_init() to take debugging flags initially, a combination of G_TYPE_DEBUG_OBJECTS and G_TYPE_DEBUG_SIGNALS. using the G_TYPE_ prefix is a bit odd here, but basically g_type_int() serves as initialization fucntion for all of GType, GObject, GSignal, so what the heck. * gobject.c: special case debugging code properly. changed glib_trap_object_ref to g_trap_object_ref. * gsignal.c: add signal emission debugging abilities, along with a new trap object g_trap_instance_signals.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
|
||||
|
||||
G_BREAKPOINT () traps for the debugger
|
||||
======================================
|
||||
Traps (G_BREAKPOINT) and traces for the debuging
|
||||
================================================
|
||||
|
||||
Some code portions contain trap variables that can be set during
|
||||
debugging time if G_ENABLE_DEBUG has been defined upon compilation
|
||||
@@ -11,18 +10,32 @@ Such traps lead to immediate code halts to examine the current
|
||||
program state and backtrace.
|
||||
Currently, the following trap variables exist:
|
||||
|
||||
static volatile gulong glib_trap_free_size;
|
||||
static volatile gulong glib_trap_realloc_size;
|
||||
static volatile gulong glib_trap_malloc_size;
|
||||
static volatile gulong g_trap_free_size;
|
||||
static volatile gulong g_trap_realloc_size;
|
||||
static volatile gulong g_trap_malloc_size;
|
||||
If set to a size > 0, g_free(), g_realloc() and g_malloc()
|
||||
respectively, will be intercepted if the size matches the
|
||||
size of the corresponding memory block to free/reallocate/allocate.
|
||||
This will only work with g_mem_set_vtable (glib_mem_profiler_table)
|
||||
upon startup though, because memory profiling is required to match
|
||||
on the memory block sizes.
|
||||
static volatile GObject *glib_trap_object_ref;
|
||||
static volatile GObject *g_trap_object_ref;
|
||||
If set to a valid object pointer, ref/unref will be intercepted
|
||||
with G_BREAKPOINT ();
|
||||
static volatile gpointer *g_trap_instance_signals;
|
||||
static volatile gpointer *g_trace_instance_signals;
|
||||
If set to a valid instance pointer, debugging messages
|
||||
will be spewed about emissions of signals on this instance.
|
||||
For g_trap_instance_signals matches, the emissions will
|
||||
also be intercepted with G_BREAKPOINT ();
|
||||
|
||||
Environment variables for debugging
|
||||
===================================
|
||||
When G_ENABLE_DEBUG was defined upon compilation, GRuntime supports
|
||||
an environment variable GRUNTIME_DEBUG that can be set to a
|
||||
combination of the flags passed in to g_type_init() (currently
|
||||
"objects" and "signals") to trigger debugging messages about
|
||||
object bookkeeping and signal emissions during runtime.
|
||||
|
||||
|
||||
2000/12/28 Tim Janik
|
||||
2000/02/04 Tim Janik
|
||||
|
Reference in New Issue
Block a user