Next: GLib Logging, Up: Debugging and Profiling [Contents][Index]
Since most GObject-based libraries use an event and callback model, debugging can be challenging. Guile-GI provides the ability for the user to hook into particular events in the introspection layer. See Hooks in The Guile reference manual to see how to operate on them.
The following hooks are defined
Will be emitted before calling a function with two arguments: name, a string denoting the name of the called function, and args, a list of Scheme variables passed to that function.
Since the %before-function-hook
procedure is called just before
the FFI calls a C function, it would be called within the procedure call
of any procedure created by GObject introspection.
Will be emitted before invoking a callback with three arguments: name, a string denoting the name of the callback, proc, the Scheme procedure that will be called, and args, a list of Scheme variables passed to that function.
Will be emitted before invoking a C callback with three arguments: name, a string denoting the name of the callback, ptr, a pointer to the C function that will be called, and args, a list of Scheme variables passed to that function.
Callbacks are usually called as the result of signals, and the
procedures to be called are expected to match the type of information
the signal emits. Setting %before-callback-hook
and
%before-c-callback-hook
may provide clues when debugging signal
events.