diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-07-26 15:52:56 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-13 17:54:46 +0000 |
commit | 566a8416648be2a5df407daa11688c3b5918d452 (patch) | |
tree | 4e0cdb097174c3cbb99b959a1064f1db4ae8f2d7 /dbus/dbus-internals.h | |
parent | d571e70a534e8d636fb6572f498f7e0b42b0972c (diff) | |
download | dbus-566a8416648be2a5df407daa11688c3b5918d452.tar.gz |
Provide a hook to allow refcounting to be traced
This is designed to be used from a wrapper function, partly to supply
the same arguments every time for a particular class of object, and partly
to provide a more specific gdb breakpoint. It has several purposes:
* when under gdb, provide a function which can be used in breakpoints
* when not under valgrind and DBUS_MESSAGE_TRACE=1 is set, emit a
_dbus_verbose when a message's refcount changes
* when under valgrind and DBUS_MESSAGE_TRACE=1 is set, emit a
VALGRIND_PRINTF_BACKTRACE when a message's refcount changes,
which lets you see the complete history of each message to track down
reference leaks
Compile-time support is currently conditional on DBUS_ENABLE_VERBOSE_MODE,
but could be separated out if desired.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37286
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Lennart Poettering <lennart@poettering.net>
Diffstat (limited to 'dbus/dbus-internals.h')
-rw-r--r-- | dbus/dbus-internals.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h index 2493d414..162a2224 100644 --- a/dbus/dbus-internals.h +++ b/dbus/dbus-internals.h @@ -118,6 +118,14 @@ static void _dbus_verbose(const char * x,...) {;} # define _dbus_is_verbose() FALSE #endif /* !DBUS_ENABLE_VERBOSE_MODE */ +void _dbus_trace_ref (const char *obj_name, + void *obj, + int old_refcount, + int new_refcount, + const char *why, + const char *env_var, + int *enabled); + const char* _dbus_strerror (int error_number); #ifdef DBUS_DISABLE_ASSERT |