summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-01 16:17:19 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-11-04 12:14:37 +0000
commit980e1f402485eac690627425e45b6442baad7553 (patch)
tree6892774bff77663e4f10404b8b65927789cca2de
parentfe9f456a4b5dd457ca19a986bbcbac5acad360b2 (diff)
downloadtelepathy-gabble-980e1f402485eac690627425e45b6442baad7553.tar.gz
Remove --disable-debug option
It makes the executable basically impossible to debug and we don't recommend that anyone uses it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=26609 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac10
-rw-r--r--lib/gibber/gibber-debug.c4
-rw-r--r--lib/gibber/gibber-debug.h16
-rw-r--r--src/conn-aliasing.c2
-rw-r--r--src/debug.h36
-rw-r--r--src/gabble.c8
-rw-r--r--src/roster.c14
-rw-r--r--tests/twisted/Makefile.am7
-rw-r--r--tests/twisted/test-debug.py8
10 files changed, 7 insertions, 100 deletions
diff --git a/Makefile.am b/Makefile.am
index 288478ba4..516610dc0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = docs tools extensions lib src data m4 plugins tests gabble
-DISTCHECK_CONFIGURE_FLAGS = --disable-debug --enable-gtk-doc
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
CLEANFILES = FIXME.out
diff --git a/configure.ac b/configure.ac
index ee589bc1d..317be2008 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,10 +149,6 @@ if test -n "$with_ca_certificates"; then
fi
fi
-AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--disable-debug],[compile without debug code]),
- enable_debug=$enableval, enable_debug=yes )
-
ifelse(gabble_nano_version, 0,
[ # Gabble is version x.y.z - disable coding style checks by default
AC_ARG_ENABLE(coding-style-checks,
@@ -167,11 +163,6 @@ AC_ARG_ENABLE(coding-style-checks,
[ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
])
-if test x$enable_debug = xyes; then
- AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
-fi
-AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = xyes])
-
AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
AC_ARG_ENABLE([installed-tests],
@@ -451,7 +442,6 @@ Configure summary:
Compiler Flags..............: ${CFLAGS} ${ERROR_CFLAGS}
Prefix......................: ${prefix}
Coding style checks.........: ${ENABLE_CODING_STYLE_CHECKS}
- Enable debug................: ${enable_debug}
Python tests................: ${tests_enabled}
Install unit tests..........: ${installed_tests}
diff --git a/lib/gibber/gibber-debug.c b/lib/gibber/gibber-debug.c
index 29b74f44e..69cf1a67c 100644
--- a/lib/gibber/gibber-debug.c
+++ b/lib/gibber/gibber-debug.c
@@ -6,8 +6,6 @@
#include "gibber-debug.h"
-#ifdef ENABLE_DEBUG
-
static DebugFlags flags = 0;
static gboolean initialized = FALSE;
@@ -96,5 +94,3 @@ gibber_debug_stanza (DebugFlags flag,
}
}
#endif
-
-#endif
diff --git a/lib/gibber/gibber-debug.h b/lib/gibber/gibber-debug.h
index 8c813bdad..7bc7f18aa 100644
--- a/lib/gibber/gibber-debug.h
+++ b/lib/gibber/gibber-debug.h
@@ -12,8 +12,6 @@
G_BEGIN_DECLS
-#ifdef ENABLE_DEBUG
-
typedef enum
{
DEBUG_TRANSPORT = 1 << 0,
@@ -59,20 +57,6 @@ void gibber_debug_stanza (DebugFlags flag, GibberXmppStanza *stanza,
#endif /* DEBUG_FLAG */
-#else /* ENABLE_DEBUG */
-
-#ifdef DEBUG_FLAG
-
-#define DEBUG(format, ...) G_STMT_START { } G_STMT_END
-
-#define DEBUG_STANZA(stanza, format, ...) G_STMT_START { } G_STMT_END
-
-#define DEBUGGING (0)
-
-#endif /* DEBUG_FLAG */
-
-#endif /* ENABLE_DEBUG */
-
G_END_DECLS
#endif
diff --git a/src/conn-aliasing.c b/src/conn-aliasing.c
index d7870eef5..e5bef80f7 100644
--- a/src/conn-aliasing.c
+++ b/src/conn-aliasing.c
@@ -470,7 +470,6 @@ nick_publish_msg_reply_cb (GabbleConnection *conn,
GObject *object,
gpointer user_data)
{
-#ifdef ENABLE_DEBUG
GError *error = NULL;
if (wocky_stanza_extract_errors (reply_msg, NULL, &error, NULL, NULL))
@@ -480,7 +479,6 @@ nick_publish_msg_reply_cb (GabbleConnection *conn,
g_clear_error (&error);
}
-#endif
}
static gboolean
diff --git a/src/debug.h b/src/debug.h
index 83bf43247..6566eda13 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -73,49 +73,21 @@ G_END_DECLS
gabble_log (G_LOG_LEVEL_INFO, DEBUG_FLAG, "%s (%s): " format, \
G_STRFUNC, G_STRLOC, ##__VA_ARGS__)
-#ifdef ENABLE_DEBUG
-# define DEBUG(format, ...) \
+#define DEBUG(format, ...) \
gabble_log (G_LOG_LEVEL_DEBUG, DEBUG_FLAG, "%s (%s): " format, \
G_STRFUNC, G_STRLOC, ##__VA_ARGS__)
-# define DEBUGGING gabble_debug_flag_is_set (DEBUG_FLAG)
+#define DEBUGGING gabble_debug_flag_is_set (DEBUG_FLAG)
-# define STANZA_DEBUG(st, s) \
+#define STANZA_DEBUG(st, s) \
NODE_DEBUG (wocky_stanza_get_top_node (st), s)
-# define NODE_DEBUG(n, s) \
+#define NODE_DEBUG(n, s) \
G_STMT_START { \
gchar *debug_tmp = wocky_node_to_string (n); \
gabble_log (G_LOG_LEVEL_DEBUG, DEBUG_FLAG, "%s: %s:\n%s", G_STRFUNC, s, debug_tmp); \
g_free (debug_tmp); \
} G_STMT_END
-#else /* !defined (ENABLE_DEBUG) */
-static inline void
-DEBUG (
- const gchar *format,
- ...)
-{
-}
-
-# define DEBUGGING 0
-
-static inline void
-STANZA_DEBUG (
- WockyStanza *stanza,
- const gchar *format,
- ...)
-{
-}
-
-static inline void
-NODE_DEBUG (
- WockyNode *node,
- const gchar *format,
- ...)
-{
-}
-#endif /* !defined (ENABLE_DEBUG) */
-
#endif /* DEBUG_FLAG */
#endif /* __DEBUG_H__ */
diff --git a/src/gabble.c b/src/gabble.c
index e7e4da4d9..64c6bf4c3 100644
--- a/src/gabble.c
+++ b/src/gabble.c
@@ -44,7 +44,6 @@ construct_cm (void)
GABBLE_TYPE_CONNECTION_MANAGER, NULL);
}
-#ifdef ENABLE_DEBUG
static TpDebugSender *debug_sender = NULL;
static void
@@ -102,9 +101,6 @@ log_handler (const gchar *log_domain,
log_to_debug_sender (log_domain, log_level, message);
}
-#endif
-
-
void
gabble_init (void)
{
@@ -148,7 +144,6 @@ gabble_main (int argc,
g_log_set_always_fatal (fatal_mask);
#endif
-#ifdef ENABLE_DEBUG
gabble_debug_set_flags_from_env ();
stamp_logs = (g_getenv ("GABBLE_TIMING") != NULL);
@@ -168,7 +163,6 @@ gabble_main (int argc,
if (g_getenv ("GABBLE_PERSIST") != NULL)
tp_debug_set_persistent (TRUE);
-#endif
loader = gabble_plugin_loader_dup ();
@@ -179,10 +173,8 @@ gabble_main (int argc,
g_object_unref (loader);
-#ifdef ENABLE_DEBUG
g_log_set_default_handler (g_log_default_handler, NULL);
g_object_unref (debug_sender);
-#endif
wocky_deinit ();
diff --git a/src/roster.c b/src/roster.c
index 4c7300be2..aa07a6034 100644
--- a/src/roster.c
+++ b/src/roster.c
@@ -728,8 +728,6 @@ _gabble_roster_item_update (GabbleRoster *roster,
return item;
}
-
-#ifdef ENABLE_DEBUG
static void
_gabble_roster_item_dump_group (gpointer k,
gpointer v,
@@ -768,8 +766,6 @@ _gabble_roster_item_dump (GabbleRosterItem *item)
return g_string_free (str, FALSE);
}
-#endif /* ENABLE_DEBUG */
-
static WockyStanza *
_gabble_roster_message_new (GabbleRoster *roster,
@@ -1155,14 +1151,13 @@ process_roster (
item = _gabble_roster_item_update (roster, handle, item_node,
google_roster, &nickname_updated);
-#ifdef ENABLE_DEBUG
+
if (DEBUGGING)
{
gchar *dump = _gabble_roster_item_dump (item);
DEBUG ("jid: %s, %s", jid, dump);
g_free (dump);
}
-#endif
if (nickname_updated)
g_array_append_val (updated_nicknames, handle);
@@ -2027,14 +2022,12 @@ roster_item_apply_edits (GabbleRoster *roster,
memcpy (&edited_item, item, sizeof (GabbleRosterItem));
-#ifdef ENABLE_DEBUG
if (DEBUGGING)
{
gchar *dump = _gabble_roster_item_dump (&edited_item);
DEBUG ("Before, contact#%u: %s", contact, dump);
g_free (dump);
}
-#endif
if (edits->create)
{
@@ -2110,7 +2103,6 @@ roster_item_apply_edits (GabbleRoster *roster,
if (edits->add_to_groups != NULL || edits->remove_from_groups != NULL ||
edits->remove_from_all_other_groups)
{
-#ifdef ENABLE_DEBUG
if (DEBUGGING)
{
if (edits->add_to_groups != NULL)
@@ -2142,7 +2134,7 @@ roster_item_apply_edits (GabbleRoster *roster,
DEBUG ("Not removing from any groups");
}
}
-#endif
+
edited_item.groups = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
@@ -2184,14 +2176,12 @@ roster_item_apply_edits (GabbleRoster *roster,
edited_item.subscription = GABBLE_ROSTER_SUBSCRIPTION_NONE;
}
-#ifdef ENABLE_DEBUG
if (DEBUGGING)
{
gchar *dump = _gabble_roster_item_dump (&edited_item);
DEBUG ("After, contact#%u: %s", contact, dump);
g_free (dump);
}
-#endif
if (!altered)
{
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 5865b14f5..22cf954ab 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -312,12 +312,6 @@ else
@echo "and then re-run configure."
endif
-if ENABLE_DEBUG
-DEBUGGING_PYBOOL = True
-else
-DEBUGGING_PYBOOL = False
-endif
-
if ENABLE_PLUGINS
PLUGINS_ENABLED_PYBOOL = True
else
@@ -352,7 +346,6 @@ config.py: Makefile
$(AM_V_GEN) { \
echo "PACKAGE_STRING = \"$(PACKAGE_STRING)\""; \
echo "CLIENT_TYPE = '$(CLIENT_TYPE)'"; \
- echo "DEBUGGING = $(DEBUGGING_PYBOOL)"; \
echo "PLUGINS_ENABLED = $(PLUGINS_ENABLED_PYBOOL)"; \
echo "GOOGLE_RELAY_ENABLED = $(GOOGLE_RELAY_ENABLED_PYBOOL)"; \
echo "FILE_TRANSFER_ENABLED = $(FILE_TRANSFER_ENABLED_PYBOOL)"; \
diff --git a/tests/twisted/test-debug.py b/tests/twisted/test-debug.py
index d3662a536..6c079a32c 100644
--- a/tests/twisted/test-debug.py
+++ b/tests/twisted/test-debug.py
@@ -7,7 +7,6 @@ from servicetest import assertEquals, sync_dbus, call_async, ProxyWrapper
from servicetest import EventPattern
from gabbletest import exec_test
import constants as cs
-from config import DEBUGGING
def test(q, bus, conn, stream):
messages = []
@@ -19,13 +18,6 @@ def test(q, bus, conn, stream):
cs.DEBUG_IFACE)
debug.connect_to_signal('NewDebugMessage', new_message)
- if not DEBUGGING:
- # If we're built with --disable-debug, check that the Debug object
- # isn't present.
- call_async(q, debug, 'GetMessages')
- q.expect('dbus-error', method='GetMessages')
- return
-
assert len(debug.GetMessages()) > 0
# Turn signalling on and generate some messages.