upload tizen2.0 source
[framework/uifw/xorg/lib/libx11.git] / specs / XKB / ch22.xml
1 <chapter id='Debugging_Aids'>
2 <title>Debugging Aids</title>
3
4 <para>
5 The debugging aids are intended for use primarily by Xkb implementors and are
6 optional in any implementation.
7 </para>
8
9
10 <para>
11 There are two bitmasks that may be used to control debugging. One bitmask
12 controls the output of debugging information, and the other controls behavior.
13 Both bitmasks are initially all zeros.
14 </para>
15
16
17 <para>
18 To change the values of any of the debug controls, use <emphasis>
19 XkbSetDebuggingFlags</emphasis>
20 .
21 </para>
22
23 <informaltable frame='none'>
24 <?dbfo keep-together="always" ?>
25 <tgroup cols='1' align='left' colsep='0' rowsep='0'>
26 <colspec colname='c1' colwidth='1.0*'/>
27 <tbody>
28   <row>
29     <entry role='functiondecl'>
30 Bool <emphasis>
31 XkbSetDebuggingFlags</emphasis>
32 (<emphasis>
33 display, mask, flags, msg, ctrls_mask, ctrls, ret_flags, ret_ctrls</emphasis>
34 )
35     </entry>
36   </row>
37   <row>
38     <entry role='functionargdecl'>
39 Display * <emphasis>
40             display</emphasis>
41 ;            /* connection to X server */
42     </entry>
43   </row>
44   <row>
45     <entry role='functionargdecl'>
46 unsigned int <emphasis>
47             mask</emphasis>
48 ;            /* mask selecting debug output flags to change */
49     </entry>
50   </row>
51   <row>
52     <entry role='functionargdecl'>
53 unsigned int <emphasis>
54             flags</emphasis>
55 ;            /* values for debug output flags selected by <emphasis>
56 mask</emphasis>
57  */
58     </entry>
59   </row>
60   <row>
61     <entry role='functionargdecl'>
62 char * <emphasis>
63             msg</emphasis>
64 ;            /* message to print right now */
65     </entry>
66   </row>
67   <row>
68     <entry role='functionargdecl'>
69 unsigned int            <emphasis>
70 ctrls_mask</emphasis>
71 ;            /* mask selecting debug controls to change */
72     </entry>
73   </row>
74   <row>
75     <entry role='functionargdecl'>
76 unsigned int            <emphasis>
77 ctrls</emphasis>
78 ;            /* values for debug controls selected by <emphasis>
79 ctrls_mask</emphasis>
80  */
81     </entry>
82   </row>
83   <row>
84     <entry role='functionargdecl'>
85 unsigned int * <emphasis>
86             ret_flags</emphasis>
87 ;            /* resulting state of all debug output flags */
88     </entry>
89   </row>
90   <row>
91     <entry role='functionargdecl'>
92 unsigned int *            <emphasis>
93 ret_ctrls</emphasis>
94 ;            /* resulting state of all debug controls */
95     </entry>
96 </row>
97 </tbody>
98 </tgroup>
99 </informaltable>
100
101 <para>
102 <emphasis>
103 XkbSetDebuggingFlags</emphasis>
104  modifies the debug output flags as specified by <emphasis>
105 mask</emphasis>
106  and <emphasis>
107 flags</emphasis>
108 , modifies the debug controls flags as specified by <emphasis>
109 ctrls_mask</emphasis>
110  and <emphasis>
111 ctrls</emphasis>
112 , prints the message <emphasis>
113 msg</emphasis>
114 , and backfills <emphasis>
115 ret_flags</emphasis>
116  and <emphasis>
117 ret_ctrls</emphasis>
118  with the resulting debug output and debug controls flags.
119 </para>
120
121
122 <para>
123 When bits are set in the debug output masks, <emphasis>
124 mask</emphasis>
125  and <emphasis>
126 flags</emphasis>
127 , Xkb prints debug information corresponding to each bit at appropriate points
128 during its processing. The device to which the output is written is
129 implementation-dependent, but is normally the same device to which X server
130 error messages are directed; thus the bits that can be set in <emphasis>
131 mask</emphasis>
132  and <emphasis>
133 flags</emphasis>
134  is implementation-specific. To turn on a debug output selection, set the bit
135 for the output in the <emphasis>
136 mask</emphasis>
137  parameter and set the corresponding bit in the <emphasis>
138 flags</emphasis>
139  parameter. To turn off event selection for an event, set the bit for the
140 output in the <emphasis>
141 mask</emphasis>
142  parameter and do not set the corresponding bit in the <emphasis>
143 flags</emphasis>
144  parameter.
145 </para>
146
147
148 <para>
149 When bits are set in the debug controls masks, <emphasis>
150 ctrls_mask</emphasis>
151  and <emphasis>
152 ctrls</emphasis>
153 , Xkb modifies its behavior according to each controls bit. <emphasis>
154 ctrls_mask</emphasis>
155  and <emphasis>
156 ctrls</emphasis>
157  are related in the same way that <emphasis>
158 mask</emphasis>
159  and <emphasis>
160 flags</emphasis>
161  are. The valid controls bits are defined in Table 22.1.
162 </para>
163
164 <table frame='topbot'>
165 <title>Debug Control Masks</title>
166 <?dbfo keep-together="always" ?>
167 <tgroup cols='3' align='left' colsep='0' rowsep='0'>
168 <colspec colname='c1' colwidth='1.5*'/>
169 <colspec colname='c2' colwidth='1.0*'/>
170 <colspec colname='c3' colwidth='2.0*'/>
171 <thead>
172 <row rowsep='1'>
173   <entry>Debug Control Mask</entry>
174   <entry>Value</entry>
175   <entry>Meaning</entry>
176 </row>
177 </thead>
178 <tbody>
179 <row>
180     <entry>XkbDF_DisableLocks</entry>
181     <entry>(1 &lt;&lt; 0)</entry>
182     <entry>Disable actions that lock modifiers</entry>
183   </row>
184 </tbody>
185 </tgroup>
186 </table>
187
188 <para>
189 <emphasis>
190 XkbSetDebuggingFlags</emphasis>
191  returns <emphasis>
192 True</emphasis>
193  if successful and <emphasis>
194 False</emphasis>
195  otherwise. The only protocol error it may generate is <emphasis>
196 BadAlloc</emphasis>
197 , if for some reason it is unable to allocate storage.
198 </para>
199
200
201 <para>
202 <emphasis>
203 XkbSetDebuggingFlags</emphasis>
204  is intended for developer use and may be disabled in production X servers. If
205 it is disabled, <emphasis>
206 XkbSetDebuggingFlags</emphasis>
207  has no effect and does not generate any protocol errors.
208 </para>
209
210
211 <para>
212 The message in <emphasis>
213 msg</emphasis>
214  is written immediately. The device to which it is written is implementation
215 dependent but is normally the same device where X server error messages are
216 directed.
217 </para>
218 </chapter>