source: trunk/third/gtk/docs/debugging.txt @ 14482

Revision 14482, 2.7 KB checked in by ghudson, 25 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14481, which included commits to RCS files with non-trunk default branches.
Line 
1The GLIB, GDK, and GTK libraries have extensive support for
2debugging the library and your programs.
3
4The amount of debugging being done can be determined both
5at run time and compile time.
6
7COMPILE TIME OPTIONS
8--------------------
9
10At compile time, the amount of debugging support included is
11determined by four macros:
12
13G_ENABLE_DEBUG
14  If set, enable support for runtime checking.
15
16G_DISABLE_ASSERT
17  If set, disable g_assert macros
18
19G_DISABLE_CHECKS
20  If set, disable the g_return_if_fail and g_return_val_if_fail macros
21
22GTK_NO_CHECK_CASTS
23  If set, don't check casts between different object types
24
25
26Whether these macros are defined is controlled at configuration
27time by the --enable-debug option.
28
29--enable-debug=minimum [default]
30  Enable only inexpensive sanity checking
31    sets GTK_NO_CHECK_CASTS
32
33--enable-debug=yes
34  Enable all debugging support
35    sets G_ENABLE_DEBUG
36
37--enable-debug=no (or --disable-debug)
38  Disable all debugging support (fastest)
39    sets G_DISABLE_ASSERT, G_DISABLE_CHECKS, and GTK_NO_CHECK_CASTS
40
41
42RUN TIME OPTIONS
43----------------
44
45At run time, if GTK+ was compiled with debugging enabled, different
46types of debugging information can be printed out. This is controlled
47by the:
48 
49  GTK_DEBUG and GDK_DEBUG environment variables
50  --gtk-debug and --gdk-debug command line options
51  --gtk-no-debug and --gdk-no-debug command line options
52
53First the environment variables are applied, then the command line
54options are applied in the order given on the command line.
55
56Each of these can either be the special value 'all', or a sequence of
57':' separated options. (case is ignored). The environment variables
58and the --gtk-debug and --gdk-debug options add debugging options and
59the --gtk-no-debug and --gdk-no-debug options remove them.
60
61As noted below, some of these are useful in application debugging, but
62most are only interested to those debugging the libraries
63
64For instance:
65
66  GDK_DEBUG_FLAGS=misc:dnd testgtk --gdk-no-debug dnd --gdk-debug events
67
68runs testgtk with the 'misc' and 'events' debugging options.
69
70 GTK_DEBUG
71 ---------
72
73 Application relevant options:
74
75 'objects' - Trace the creation and destruction of objects, print
76             out a summary at program termination
77
78 Options only interesting to library maintainers:
79
80 GDK_DEBUG
81 ---------
82
83 Application relevant options:
84
85 'events' - Show all events received by GTK
86
87 Options only interesting to library maintainers:
88
89 'misc'          - Miscellaneous information
90 'dnd'           - Information about drag-and-drop
91 'color-context' - Information about the internal workings of
92                   GdkColorContext
93 'xim'           - Information about X Input Method support
94
95
96                                    - Owen Taylor <owt1@cornell.edu>
97                                      98/02/19
Note: See TracBrowser for help on using the repository browser.