configure.in gdk/gdk.[ch] gdk/gdkcc.c gdk/gdkglobals.c
Thu Feb 19 01:11:48 1998 Owen Taylor <owt1@cornell.edu> * configure.in gdk/gdk.[ch] gdk/gdkcc.c gdk/gdkglobals.c gdk/gdkinputcommon.h gdk/gdkprivate.h gdk/gdkvisual.c glib/configure.in glib/glib.h glib/gutils.c gtk/Makefile.am gtk/gtkmain.c gtk/gtkobject.[ch] gtk/gtkdebug.h docs/debugging.txt New system for controlling debugging: * --enable-debug=[no/yes/minimum] * G_DISABLE_ASSERT and G_DISABLE_CHECKS for glib * G_NO_CHECK_CASTS to control cast checking * G_ENABLE_DEBUG enables run time checking which controls: Object tracing Showing events Miscellaneous g_print's in GDK And is controlled by --gdk-debug/GDK_DEBUG, --gtk-debug/GTK_DEBUG * debug_level and show_events are gone from GTK See docs/debugging.txt for details. And some fixups to the configure.in's so '-g' can be overriden on the command line for --enable-debug
This commit is contained in:
62
glib/glib.h
62
glib/glib.h
@ -182,6 +182,13 @@
|
||||
* in order to support gcc's __PRETTY_FUNCTION__ capability.
|
||||
*/
|
||||
|
||||
#ifdef G_DISABLE_ASSERT
|
||||
|
||||
#define g_assert(expr)
|
||||
#define g_assert_not_reached()
|
||||
|
||||
#else /* !G_DISABLE_ASSERT */
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define g_assert(expr) G_STMT_START{\
|
||||
@ -198,6 +205,33 @@
|
||||
__LINE__, \
|
||||
__PRETTY_FUNCTION__); }G_STMT_END
|
||||
|
||||
#else /* !__GNUC__ */
|
||||
|
||||
#define g_assert(expr) G_STMT_START{\
|
||||
if (!(expr)) \
|
||||
g_error ("file %s: line %d: \"%s\"", \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
#expr); }G_STMT_END
|
||||
|
||||
#define g_assert_not_reached() G_STMT_START{ \
|
||||
g_error ("file %s: line %d: \"should not be reached\"", \
|
||||
__FILE__, \
|
||||
__LINE__); }G_STMT_END
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#endif /* G_DISABLE_ASSERT */
|
||||
|
||||
#ifdef G_DISABLE_CHECKS
|
||||
|
||||
#define g_return_if_fail(expr)
|
||||
#define g_return_val_if_fail(expr,val)
|
||||
|
||||
#else /* !G_DISABLE_CHECKS */
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define g_return_if_fail(expr) G_STMT_START{ \
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
@ -220,19 +254,7 @@
|
||||
return val; \
|
||||
}; }G_STMT_END
|
||||
|
||||
#else /* __GNUC__ */
|
||||
|
||||
#define g_assert(expr) G_STMT_START{\
|
||||
if (!(expr)) \
|
||||
g_error ("file %s: line %d: \"%s\"", \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
#expr); }G_STMT_END
|
||||
|
||||
#define g_assert_not_reached() G_STMT_START{ \
|
||||
g_error ("file %s: line %d: \"should not be reached\"", \
|
||||
__FILE__, \
|
||||
__LINE__); }G_STMT_END
|
||||
#else /* !__GNUC__ */
|
||||
|
||||
#define g_return_if_fail(expr) G_STMT_START{ \
|
||||
if (!(expr)) \
|
||||
@ -254,8 +276,9 @@
|
||||
return val; \
|
||||
}; }G_STMT_END
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* !__GNUC__ */
|
||||
|
||||
#endif /* G_DISABLE_CHECKS */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -327,6 +350,7 @@ typedef struct _GListAllocator GListAllocator;
|
||||
typedef struct _GStringChunk GStringChunk;
|
||||
typedef struct _GString GString;
|
||||
typedef struct _GArray GArray;
|
||||
typedef struct _GDebugKey GDebugKey;
|
||||
|
||||
typedef void (*GFunc) (gpointer data, gpointer user_data);
|
||||
typedef void (*GHFunc) (gpointer key, gpointer value, gpointer user_data);
|
||||
@ -370,6 +394,12 @@ struct _GArray
|
||||
guint len;
|
||||
};
|
||||
|
||||
struct _GDebugKey
|
||||
{
|
||||
gchar *key;
|
||||
guint value;
|
||||
};
|
||||
|
||||
struct _GHashTable { gint dummy; };
|
||||
struct _GCache { gint dummy; };
|
||||
struct _GTree { gint dummy; };
|
||||
@ -650,6 +680,10 @@ GWarningFunc g_set_warning_handler (GWarningFunc func);
|
||||
GPrintFunc g_set_message_handler (GPrintFunc func);
|
||||
GPrintFunc g_set_print_handler (GPrintFunc func);
|
||||
|
||||
guint g_parse_debug_string (const gchar *string,
|
||||
GDebugKey *keys,
|
||||
guint nkeys);
|
||||
|
||||
void g_debug (char *progname);
|
||||
void g_attach_process (char *progname, int query);
|
||||
void g_stack_trace (char *progname, int query);
|
||||
|
||||
Reference in New Issue
Block a user