[Bug 26642] Add proper debug flag support

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Feb 22 12:29:14 CET 2010


http://bugs.freedesktop.org/show_bug.cgi?id=26642





--- Comment #3 from Simon McVittie <simon.mcvittie at collabora.co.uk>  2010-02-22 03:29:13 PST ---
Bah. I'm sure I reviewed this already, but the combination of Bugzilla and
unstable 3G on a train ate it.

Basically, the problem is that osso-mission-control uses mcd-debug.h, and
because a lot of that header is inline, it hard-codes the version that was
current at the time it was compiled. Also, I don't want to expand MC's API/ABI
- I'm trying to stop src/ having any public API at all (in favour of just
having OMC use libmission-control-plugins) but we're not there yet.

So, I think we should introduce a debug-internal.h, which defines
McdDebugFlags, _mcd_debug_flag_is_set (prefix an underscore to make it internal
to MC), and your version of DEBUG() (only if DEBUG_FLAG is defined). All MC
files should include debug-internal.h instead of mcd-debug.h.

mcd-debug.h should keep defining DEBUG() too (to support OMC), but only if
DEBUG_FLAG is *not* defined.

mcd-debug.h should continue to define _mcd_debug_get_level for source
compatibility.

> -gint mcd_debug_level = 0;

This must continue to exist; otherwise, OMC will abort on startup with a linker
error. (Don't remove extern symbols.)

-------------------

Review comments that don't relate to the general approach:

> +                       mcp_set_debug ((flags != 0));

This should check MCD_DEBUG_PLUGIN - mcp is the plugins library

> + #define DEBUGGING mcd_debug_flag_is_set (DEBUG_FLAG)

Parenthesize the definition, since it's an expression: #define DEBUGGING
(_mcd_debug_flag_is_set (DEBUG_FLAG))

>  {
> -    mcd_debug_level = level;
> +               if (level == 1)
> +               {
> +                flags = ~MCD_DEBUG_TREES;

What's going on with the indentation? 4-space indentation for existing files,
Telepathy style (GNUish 2+2 space indentation) for entirely new files, and no
tabs anywhere, please.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the telepathy-bugs mailing list