summaryrefslogtreecommitdiff
path: root/docs/debugging.txt
blob: db46439ed8750cd8f9d25d17557b2c8f21bb265c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
The GLIB, GDK, and GTK libraries have extensive support for
debugging the library and your programs.

The amount of debugging being done can be determined both
at run time and compile time.

COMPILE TIME OPTIONS
--------------------

At compile time, the amount of debugging support included is
determined by four macros:

G_ENABLE_DEBUG
  If set, enable support for runtime checking.

G_DISABLE_ASSERT
  If set, disable g_assert macros

G_DISABLE_CHECKS
  If set, disable the g_return_if_fail and g_return_val_if_fail macros

GTK_NO_CHECK_CASTS
  If set, don't check casts between different object types


Whether these macros are defined is controlled at configuration
time by the --enable-debug option.

--enable-debug=minimum [default]
  Enable only inexpensive sanity checking 
    sets GTK_NO_CHECK_CASTS

--enable-debug=yes
  Enable all debugging support
    sets G_ENABLE_DEBUG

--enable-debug=no (or --disable-debug)
  Disable all debugging support (fastest)
    sets G_DISABLE_ASSERT, G_DISABLE_CHECKS, and GTK_NO_CHECK_CASTS


RUN TIME OPTIONS
----------------

At run time, if GTK+ was compiled with debugging enabled, different
types of debugging information can be printed out. This is controlled
by the:
 
  GTK_DEBUG and GDK_DEBUG environment variables
  --gtk-debug and --gdk-debug command line options
  --gtk-no-debug and --gdk-no-debug command line options

First the environment variables are applied, then the command line
options are applied in the order given on the command line.

Each of these can either be the special value 'all', or a sequence of
':' separated options. (case is ignored). The environment variables
and the --gtk-debug and --gdk-debug options add debugging options and
the --gtk-no-debug and --gdk-no-debug options remove them.

As noted below, some of these are useful in application debugging, but
most are only interested to those debugging the libraries

For instance:

  GDK_DEBUG_FLAGS=misc:dnd testgtk --gdk-no-debug dnd --gdk-debug events

runs testgtk with the 'misc' and 'events' debugging options.

 GTK_DEBUG
 ---------

 Application relevant options:

 'objects' - Trace the creation and destruction of objects, print
             out a summary at program termination

 Options only interesting to library maintainers:

 GDK_DEBUG
 ---------

 Application relevant options:

 'events' - Show all events received by GTK

 Options only interesting to library maintainers:

 'misc'          - Miscellaneous information
 'dnd'           - Information about drag-and-drop
 'color-context' - Information about the internal workings of 
                   GdkColorContext
 'xim'           - Information about X Input Method support


                                    - Owen Taylor <owt1@cornell.edu>
                                      98/02/19