Commit 980e1f40 authored by Simon McVittie's avatar Simon McVittie

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=26609Reviewed-by: Guillaume Desmottes's avatarGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
parent fe9f456a
......@@ -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
......
......@@ -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}
......
......@@ -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
......@@ -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
......@@ -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
......
......@@ -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__ */
......@@ -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 ();
......
......@@ -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)
{
......
......@@ -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)"; \
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment