Top | ![]() |
![]() |
![]() |
![]() |
|
camel_debug_init () |
|
camel_debug () |
|
camel_debug_start () |
|
camel_debug_end () |
#define | CAMEL_CHECK_GERROR() |
#define | CAMEL_CHECK_LOCAL_GERROR() |
#define | camel_pointer_tracker_track() |
|
camel_pointer_tracker_track_with_info () |
|
camel_pointer_tracker_untrack () |
|
camel_pointer_tracker_dump () |
|
camel_debug_get_backtrace () |
|
camel_debug_ref_unref_push_backtrace () |
|
camel_debug_ref_unref_push_backtrace_for_object () |
|
camel_debug_ref_unref_dump_backtraces () |
void camel_debug_init (void
);
Init camel debug.
CAMEL_DEBUG is set to a comma separated list of modules to debug. The modules can contain module-specific specifiers after a ':', or just act as a wildcard for the module or even specifier. e.g. 'imap' for imap debug, or 'imap:folder' for imap folder debug. Additionaly, ':folder' can be used for a wildcard for any folder operations.
gboolean camel_debug (const
);gchar *mode
Check to see if a debug mode is activated. mode
takes one of two forms,
a fully qualified 'module:target', or a wildcard 'module' name. It
returns a boolean to indicate if the module or module and target is
currently activated for debug output.
gboolean camel_debug_start (const
);gchar *mode
Start debug output for a given mode, used to make sure debug output is output atomically and not interspersed with unrelated stuff.
TRUE
camel_debug_end()
when finished any screen output.
void camel_debug_end (void
);
Call this when you're done with your debug output. If and only if you called camel_debug_start, and if it returns TRUE.
#define CAMEL_CHECK_GERROR(object, method, expr, error)
This sanity checks return values and
Example:
success = class->foo (object, some_data, error); CAMEL_CHECK_GERROR (object, foo, success, error); return success;
object |
a |
|
method |
a method which was run |
|
expr |
an expression to test, which evaluates to |
|
error |
a pointer to a pointer of a |
Since: 2.32
#define CAMEL_CHECK_LOCAL_GERROR(object, method, expr, error)
Same as CAMEL_CHECK_GERROR, but for direct
Example:
success = class->foo (object, some_data, &local_error); CAMEL_CHECK_LOCAL_GERROR (object, foo, success, local_error); return success;
object |
a |
|
method |
a method which was run |
|
expr |
an expression to test, which evaluates to |
|
error |
a pointer to a |
Since: 3.12
#define camel_pointer_tracker_track(ptr)
Adds pointer 'ptr' to pointer tracker. Usual use case is to add object
to the tracker in GObject::init and remove it from tracker within
GObject::finalize. Since the tracker's functions are called, the application
prints summary of the pointers on console on exit. If everything gone right
then it prints message about all tracked pointers were removed. Otherwise
it prints summary of left pointers in the tracker. Added pointer should
be removed with pair function camel_pointer_tracker_untrack()
.
See camel_pointer_tracker_dump()
, camel_pointer_tracker_track_with_info()
.
Since: 3.6
void camel_pointer_tracker_track_with_info (,
gpointer ptrconst
);gchar *info
Adds pointer to the pointer tracker, with associated information,
which is printed in summary of pointer tracker printed by
camel_pointer_tracker_dump()
. For convenience can be used
camel_pointer_tracker_track()
, which adds place of the caller
as info
. Added pointer should be removed with pair function
camel_pointer_tracker_untrack()
.
Since: 3.6
void camel_pointer_tracker_untrack ();
gpointer ptr
Removes pointer from the pointer tracker. It's an error to try
to remove pointer which was not added to the tracker by
camel_pointer_tracker_track()
or camel_pointer_tracker_track_with_info()
,
or a pointer which was already removed.
Since: 3.6
void camel_pointer_tracker_dump (void
);
Prints information about currently stored pointers
in the pointer tracker. This is called automatically
on application exit if camel_pointer_tracker_track()
or
camel_pointer_tracker_track_with_info()
was called.
Note: If the library is configured with --enable-backtraces, then also backtraces where the pointer was added is printed in the summary.
Since: 3.6
GString * camel_debug_get_backtrace (void
);
Gets current backtrace leading to this function call.
Current backtrace, or NULL
Note: Getting backtraces only works if the library was configured with --enable-backtraces.
Since: 3.12
void camel_debug_ref_unref_push_backtrace (const
,GString *backtrace);
guint object_ref_count
Adds this backtrace into the set of backtraces related to some object
reference counting issues debugging. This is usually called inside g_object_ref()
g_object_unref()
g_object_unref()
g_object_ref()
Any left backtraces in the list are printed at the application end.
A convenient function camel_debug_ref_unref_push_backtrace_for_object()
is provided too.
backtrace |
a backtrace to push, taken from |
|
object_ref_count |
the current object reference count when the push is done |
Since: 3.20
void camel_debug_ref_unref_push_backtrace_for_object ();
gpointer _object
Gets current backtrace of this call and adds it to the list
of backtraces with camel_debug_ref_unref_push_backtrace()
.
Usual usage would be, once GNOME bug 758358 is applied to the GLib sources,
or a patched GLib is used, to call this function in an object init()
static void my_object_init (MyObject *obj) { camel_debug_ref_unref_push_backtrace_for_object (obj); g_track_object_ref_unref (obj, (GFunc) camel_debug_ref_unref_push_backtrace_for_object, NULL); }
Note that the g_track_object_ref_unref()
Since: 3.20
void camel_debug_ref_unref_dump_backtraces (void
);
Prints current backtraces stored with camel_debug_ref_unref_push_backtrace()
or with camel_debug_ref_unref_push_backtrace_for_object()
.
It's usually not needed to use this function, as the left backtraces, if any, are printed at the end of the application.
Since: 3.20