|
Packit |
ae235b |
|
|
Packit |
ae235b |
Traps (G_BREAKPOINT) and traces for the debuging
|
|
Packit |
ae235b |
================================================
|
|
Packit |
ae235b |
|
|
Packit |
ae235b |
Some code portions contain trap variables that can be set during
|
|
Packit |
ae235b |
debugging time if G_ENABLE_DEBUG has been defined upon compilation
|
|
Packit |
ae235b |
(use the --enable-debug=yes option to configure for this, macros.txt
|
|
Packit |
ae235b |
covers more details).
|
|
Packit |
ae235b |
Such traps lead to immediate code halts to examine the current
|
|
Packit |
ae235b |
program state and backtrace.
|
|
Packit |
ae235b |
Currently, the following trap variables exist:
|
|
Packit |
ae235b |
|
|
Packit |
ae235b |
static volatile gulong g_trap_free_size;
|
|
Packit |
ae235b |
static volatile gulong g_trap_realloc_size;
|
|
Packit |
ae235b |
static volatile gulong g_trap_malloc_size;
|
|
Packit |
ae235b |
If set to a size > 0, g_free(), g_realloc() and g_malloc()
|
|
Packit |
ae235b |
respectively, will be intercepted if the size matches the
|
|
Packit |
ae235b |
size of the corresponding memory block to free/reallocate/allocate.
|
|
Packit |
ae235b |
This will only work with g_mem_set_vtable (glib_mem_profiler_table)
|
|
Packit |
ae235b |
upon startup though, because memory profiling is required to match
|
|
Packit |
ae235b |
on the memory block sizes.
|
|
Packit |
ae235b |
static volatile GObject *g_trap_object_ref;
|
|
Packit |
ae235b |
If set to a valid object pointer, ref/unref will be intercepted
|
|
Packit |
ae235b |
with G_BREAKPOINT ();
|
|
Packit |
ae235b |
static volatile gpointer *g_trap_instance_signals;
|
|
Packit |
ae235b |
static volatile gpointer *g_trace_instance_signals;
|
|
Packit |
ae235b |
If set to a valid instance pointer, debugging messages
|
|
Packit |
ae235b |
will be spewed about emissions of signals on this instance.
|
|
Packit |
ae235b |
For g_trap_instance_signals matches, the emissions will
|
|
Packit |
ae235b |
also be intercepted with G_BREAKPOINT ();
|
|
Packit |
ae235b |
|
|
Packit |
ae235b |
Environment variables for debugging
|
|
Packit |
ae235b |
===================================
|
|
Packit |
ae235b |
When G_ENABLE_DEBUG was defined upon compilation, the GObject library
|
|
Packit |
ae235b |
supports an environment variable GOBJECT_DEBUG that can be set to a
|
|
Packit |
ae235b |
combination of the flags passed in to g_type_init() (currently
|
|
Packit |
ae235b |
"objects" and "signals") to trigger debugging messages about
|
|
Packit |
ae235b |
object bookkeeping and signal emissions during runtime.
|
|
Packit |
ae235b |
|
|
Packit |
ae235b |
|
|
Packit |
ae235b |
2000/02/04 Tim Janik
|