|
0
|
1 #ifndef CYGONCE_INFRA_CYG_TRAC_H |
|
|
2 #define CYGONCE_INFRA_CYG_TRAC_H |
|
|
3 |
|
|
4 //========================================================================== |
|
|
5 // |
|
2
|
6 // cyg_trac.h |
|
0
|
7 // |
|
2
|
8 // Macros and prototypes for the tracing system |
|
0
|
9 // |
|
|
10 //========================================================================== |
|
|
11 //####COPYRIGHTBEGIN#### |
|
|
12 // |
|
|
13 // ------------------------------------------- |
|
|
14 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
15 // Version 1.0 (the "License"); you may not use this file except in |
|
|
16 // compliance with the License. You may obtain a copy of the License at |
|
|
17 // http://sourceware.cygnus.com/ecos |
|
|
18 // |
|
|
19 // Software distributed under the License is distributed on an "AS IS" |
|
|
20 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
21 // License for the specific language governing rights and limitations under |
|
|
22 // the License. |
|
|
23 // |
|
|
24 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
25 // September 30, 1998. |
|
|
26 // |
|
|
27 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
2
|
28 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
0
|
29 // ------------------------------------------- |
|
|
30 // |
|
|
31 //####COPYRIGHTEND#### |
|
|
32 //========================================================================== |
|
|
33 //#####DESCRIPTIONBEGIN#### |
|
|
34 // |
|
2
|
35 // Author(s): nickg from an original by hmt |
|
|
36 // Contributors: nickg |
|
|
37 // Date: 1998-04-23 |
|
|
38 // Purpose: Use traces to log procedure entry, and "print" stuff |
|
|
39 // Description: Runtime logging messages that compile to nothing in |
|
0
|
40 // release versions of the code, to allow |
|
|
41 // as-you-go tracing of alternate builds. |
|
2
|
42 // Usage: #include <cyg/infra/cyg_trac.h> |
|
|
43 // ... |
|
|
44 // CYG_TRACE2( PIPE_TRACE, "pipe %x, data %d", ppipe, oword ); |
|
0
|
45 // |
|
|
46 // which can result, for example, in a message of the form: |
|
|
47 // "TRACE: pipemgr.cxx:1340, write_pipe(): pipe 0x8004c, data 17" |
|
|
48 // |
|
|
49 //####DESCRIPTIONEND#### |
|
|
50 // |
|
|
51 |
|
|
52 /**************************************************************************** |
|
|
53 |
|
|
54 Explicit tracing |
|
|
55 ================ |
|
|
56 |
|
|
57 CYG_TRACE0( bool, msg ); |
|
|
58 CYG_TRACE1( bool, msg, arg1 ); |
|
|
59 CYG_TRACE2( bool, msg, arg1, arg2 ); |
|
|
60 .... |
|
|
61 CYG_TRACE8( bool, msg, .... [with 8 args] ); |
|
|
62 |
|
|
63 In general, the bool controls whether or not the tracing occurs for a |
|
|
64 particular invocation of the macro. The msg is a printf-style string, |
|
|
65 though exactly which formats are supported depends on the underlying |
|
|
66 implementation. Typically, at least %d, %x, %08x, %c and %s will be |
|
|
67 supported. Of course a most compact implementation might print |
|
|
68 |
|
|
69 TRACE:z1dbuff.c[92]get_nextdata(): data pointer %x offset %d: 42BD8 1C |
|
|
70 |
|
|
71 or some such, leaving you to work it out for yourself. |
|
|
72 |
|
|
73 It is expected that the boolean would rarely actually be a complex |
|
|
74 expression; it is more likely that it would either be "1", tracing being |
|
|
75 controlled for the whole compilation unit or subsystem by means of the |
|
|
76 CYGDBG_USE_TRACING symbol, or a local symbol for tracing over the whole |
|
|
77 file, defined to 0 or to 1. For runtime control of tracing in a debugging |
|
|
78 session, it is typical to use symbols defined to expressions such as: |
|
|
79 |
|
|
80 static int xxx_trace = 0; |
|
|
81 #define TL1 (0 < xxx_trace) |
|
|
82 #define TL2 (1 < xxx_trace) |
|
|
83 |
|
|
84 so you set xxx_trace to 1 to enable those messages conditioned by TL1 |
|
|
85 (trace level 1) and so on. |
|
|
86 |
|
|
87 CYG_TRACE1( TL1, "Major argument is %d", zz ); |
|
|
88 CYG_TRACE4( TL2, "...minor details %d %d %d %d", m1, m2, m3 ,m4 ); |
|
|
89 |
|
|
90 To assist with the case where the same symbol or expression is used |
|
|
91 throughout a compilation unit, the programmer can define the symbol |
|
|
92 CYG_TRACE_USER_BOOL as they choose and then use convenience macros with the |
|
|
93 suffix 'B' in the obvious manner: |
|
|
94 |
|
|
95 #define CYG_TRACE_USER_BOOL (xxx_trace > 0) |
|
|
96 CYG_TRACE2B( "Counters are %d, %d", countlo, counthi ); |
|
|
97 |
|
|
98 For the case where you just want to print a load of numbers in hex, or |
|
|
99 decimal, convenience suffices X, D and Y are provided. X uses %08x, D %d |
|
|
100 and Y an unadorned %x for each argument. |
|
|
101 |
|
|
102 CYG_TRACE3D( TL2, m1, m2, d ); |
|
|
103 |
|
|
104 If you want to do something similar but with a little more comment, the |
|
|
105 names (strictly spellings) of the variables you are printing can be used by |
|
|
106 appending a V to the X, D or Y. |
|
|
107 |
|
|
108 CYG_TRACE3DV( TL2, m1, m2, d ); |
|
|
109 |
|
|
110 might output: |
|
|
111 |
|
|
112 TRACE:z1dbuff.c[92]get_nextdata(): m1=23 m2=-4 d=55 |
|
|
113 |
|
|
114 These conveniences can be combined, and they apply equally to tracing with |
|
|
115 up to 8 variables; the B for Bool goes last: |
|
|
116 |
|
|
117 CYG_TRACE4DVB( i, i*i, i*i*i, i*i*i*i ); |
|
|
118 |
|
|
119 might output: |
|
|
120 |
|
|
121 TRACE:table.c[12]main(): i=3 i*i=9 i*i*i=27 i*i*i*i=81 |
|
|
122 |
|
|
123 |
|
|
124 Function Tracing |
|
|
125 ================ |
|
|
126 |
|
|
127 There are also facities for easily reporting function entry and exit, |
|
|
128 printing the function arguments, and detecting returns without logging (or |
|
|
129 without a value!). |
|
|
130 |
|
|
131 The basic facility is |
|
|
132 |
|
2
|
133 CYG_REPORT_FUNCTION(); |
|
0
|
134 |
|
|
135 In C, place this between the local variable declarations and the first |
|
|
136 statement or errors will ensue. C++ is more flexible; place the macro as |
|
|
137 the first line of all functions you wish to trace. The following |
|
|
138 variations are also provided: |
|
|
139 |
|
|
140 CYG_REPORT_FUNCTYPE( exitmsg ) provide a printf string for the type |
|
2
|
141 of the returned value |
|
0
|
142 CYG_REPORT_FUNCNAME( name ) supply a function name explicitly, for |
|
|
143 if __FUNCTION__ is not supported |
|
|
144 CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both of the above extensions |
|
|
145 |
|
|
146 These are unconditional; the assumption is that if function reporting is |
|
|
147 used at all it will be used for all functions within a compilation unit. |
|
|
148 However, it is useful to be able to control function reporting at finer |
|
|
149 grain without editing the source files concerned, at compile time or at |
|
|
150 runtime. To support this, conditioned versions (with suffix 'C') are |
|
|
151 provided for the above four macros, which only procduce trace output if the |
|
|
152 macro CYG_REPORT_USER_BOOL evaluates true. |
|
|
153 |
|
|
154 CYG_REPORT_FUNCTIONC() |
|
|
155 CYG_REPORT_FUNCNAMEC( name ) |
|
|
156 CYG_REPORT_FUNCTYPEC( exitmsg ) |
|
|
157 CYG_REPORT_FUNCNAMETYPEC( name, exitmsg ) |
|
|
158 |
|
|
159 You can define CYG_REPORT_USER_BOOL to anything you like before invoking |
|
|
160 these macros; using a simple -DCYG_REPORT_USER_BOOL=0 or ...=1 on the |
|
|
161 compiler command line would do the trick, but there is more flexibility to |
|
|
162 be gained by something like: |
|
|
163 |
|
|
164 #define CYG_REPORT_USER_BOOL (reporting_bool_FOO) |
|
|
165 #ifdef TRACE_FOO |
|
|
166 int reporting_bool_FOO = 1; |
|
|
167 #else |
|
|
168 int reporting_bool_FOO = 0; |
|
|
169 #endif |
|
|
170 |
|
|
171 where FOO relates to the module name. Thus an external symbol sets the |
|
|
172 default, but it can be overridden in a debugging session by setting the |
|
|
173 variable reporting_bool_FOO. |
|
|
174 |
|
|
175 Note that the condition applied to the initial CYG_REPORT_FUNC...() macro |
|
|
176 controls all function-related reporting (not tracing) from that function; |
|
|
177 the underlying mechanisms still operate even if no output is created. Thus |
|
|
178 no conditioned variants of CYG_REPORT_FUNCARG[s] nor of CYG_REPORT_RETURN |
|
|
179 are needed. |
|
|
180 |
|
|
181 Examples: |
|
|
182 int myfunction() |
|
|
183 { |
|
2
|
184 CYG_REPORT_FUNCTYPE( "recode is %d" ); |
|
0
|
185 |
|
|
186 A function return is traced using |
|
|
187 |
|
2
|
188 CYG_REPORT_RETURN() a void return |
|
|
189 CYG_REPORT_RETVAL( value ) returning a value |
|
0
|
190 |
|
|
191 With the CYG_REPORT_FUNCTYPE example, the latter might produce a message |
|
|
192 like: |
|
|
193 |
|
|
194 TRACE:myprog.c[40]fact(): enter |
|
|
195 TRACE:myprog.c[53]fact(): retcode is 24 |
|
|
196 |
|
|
197 It is also useful to trace the values of the arguments to a function: |
|
2
|
198 CYG_REPORT_FUNCARGVOID confirms that the function is void |
|
|
199 CYG_REPORT_FUNCARG1( format, arg ) printf-style |
|
|
200 to |
|
|
201 CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style |
|
0
|
202 |
|
|
203 The CYG_REPORT_FUNCARG[1-8] macros are also offered with the convenience |
|
|
204 extensions: D, X, or Y, and V like the explicit tracing macros. For |
|
|
205 example: |
|
|
206 |
|
|
207 int fact( int number ) |
|
|
208 { |
|
2
|
209 CYG_REPORT_FUNCTYPE( "recode is %d" ); |
|
|
210 CYG_REPORT_FUNCARG1DV( number ); |
|
|
211 int result = number; |
|
|
212 while ( --number > 1 ) result *= number |
|
|
213 CYG_REPORT_RETVAL( result ); |
|
0
|
214 return result; |
|
|
215 } |
|
|
216 |
|
|
217 might produce: |
|
|
218 |
|
|
219 TRACE:myprog.c[40]fact(): enter |
|
|
220 TRACE:myprog.c[40]fact(): number=4 |
|
|
221 TRACE:myprog.c[53]fact(): retcode is 24 |
|
|
222 |
|
|
223 If no exit message is provided, a default of %08x is used. |
|
|
224 |
|
|
225 |
|
|
226 General Configury |
|
|
227 ================= |
|
|
228 |
|
|
229 If CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is *not* defined, it is assumed |
|
|
230 that __PRETTY_FUNCTION__ or equivalents do not exist, so no function name |
|
|
231 tracing is possible; only file and line number. |
|
|
232 |
|
|
233 If CYGDBG_INFRA_DEBUG_TRACE_MESSAGE is *not* defined, the message and |
|
|
234 arguments to all tracing macros are not used; only "execution was here" |
|
|
235 type information, by file, function and line number, is available. This |
|
|
236 can greatly reduce the size of an image with tracing disabled, which may be |
|
|
237 crucial in debugging on actual shipped hardware with limited memory. |
|
|
238 |
|
|
239 C/C++: in C++ the function reporting is implemented using a class object |
|
|
240 with a destructor; this allows reporting of a return which has not been |
|
|
241 explicitly reported, and detection of accidental multiple return reports. |
|
|
242 This helps you write the function reporting correctly. In C it is not |
|
|
243 possible to be so sophisticated, so the implementation is not so helpful in |
|
|
244 detecting errors in the use of the tracing system. |
|
|
245 |
|
|
246 Note that for all of the above variations, the internal API to the |
|
|
247 functions which are called in consequence of tracing remains the same, so |
|
|
248 these variations can be mixed in the same executable, by configuring the |
|
|
249 tracing macros differently in different compilation units or subsystems. |
|
|
250 |
|
|
251 |
|
|
252 Summary |
|
|
253 ======= |
|
|
254 |
|
|
255 Explicit tracing |
|
|
256 ---------------- |
|
|
257 |
|
|
258 CYG_TRACE0( bool, msg ) if bool, print msg |
|
|
259 CYG_TRACE1( bool, msg, arg ) if bool, printf-style |
|
2
|
260 to |
|
0
|
261 CYG_TRACE8( bool, msg, arg1...arg8 ) if bool, printf-style |
|
|
262 |
|
|
263 CYG_TRACE0B( msg, args... ) to CYG_TRACE8B() use CYG_TRACE_USER_BOOL |
|
|
264 |
|
2
|
265 CYG_TRACE1X( bool, args... ) to CYG_TRACE8X() print args using %08x |
|
|
266 CYG_TRACE1Y( bool, args... ) to CYG_TRACE8Y() print args using %x |
|
|
267 CYG_TRACE1D( bool, args... ) to CYG_TRACE8D() print args using %d |
|
0
|
268 |
|
|
269 CYG_TRACE1XV( bool, args... ) to CYG_TRACE8XV() print args using "arg=%08x" |
|
|
270 CYG_TRACE1YV( bool, args... ) to CYG_TRACE8YV() print args using "arg=%x" |
|
|
271 CYG_TRACE1DV( bool, args... ) to CYG_TRACE8DV() print args using "arg=%d" |
|
|
272 |
|
2
|
273 CYG_TRACE1XB( args... ) to CYG_TRACE8XB() print using %08x, no bool |
|
|
274 CYG_TRACE1YB( args... ) to CYG_TRACE8YB() print using %x, no bool |
|
|
275 CYG_TRACE1DB( args... ) to CYG_TRACE8DB() print using %d, no bool |
|
0
|
276 |
|
2
|
277 CYG_TRACE1XVB( args... ) to CYG_TRACE8XVB() use "arg=%08x", no bool |
|
|
278 CYG_TRACE1YVB( args... ) to CYG_TRACE8YVB() use "arg=%x", no bool |
|
|
279 CYG_TRACE1DVB( args... ) to CYG_TRACE8DVB() use "arg=%d", no bool |
|
0
|
280 |
|
|
281 Function tracing |
|
|
282 ---------------- |
|
|
283 |
|
2
|
284 CYG_REPORT_FUNCTION() default function entry |
|
|
285 CYG_REPORT_FUNCNAME( name ) name the function |
|
|
286 CYG_REPORT_FUNCTYPE( exitmsg ) printf for retval |
|
|
287 CYG_REPORT_FUNCNAMETYPE( name, exitmsg ) both |
|
0
|
288 |
|
2
|
289 CYG_REPORT_FUNCTIONC() as above, but conditional |
|
|
290 CYG_REPORT_FUNCNAMEC( name ) on CYG_REPORT_USER_BOOL |
|
|
291 CYG_REPORT_FUNCTYPEC( exitmsg ) however it is defined |
|
|
292 CYG_REPORT_FUNCNAMETYPEC( name, exitmsg ) ... |
|
0
|
293 |
|
2
|
294 CYG_REPORT_RETURN() void function exit |
|
|
295 CYG_REPORT_RETVAL( value ) returning value |
|
0
|
296 |
|
2
|
297 CYG_REPORT_FUNCARGVOID() void function entry |
|
|
298 CYG_REPORT_FUNCARG1( format, arg ) printf-style |
|
|
299 to |
|
|
300 CYG_REPORT_FUNCARG8( format, arg1...arg8 ) printf-style |
|
0
|
301 |
|
|
302 CYG_REPORT_FUNCARG1X( arg ) |
|
2
|
303 to |
|
|
304 CYG_REPORT_FUNCARG8X( arg1...arg8 ) use %08x |
|
|
305 CYG_REPORT_FUNCARG1Y... use %x |
|
|
306 CYG_REPORT_FUNCARG1D... use %d |
|
0
|
307 |
|
2
|
308 CYG_REPORT_FUNCARG1XV... use "arg=%08x" |
|
|
309 CYG_REPORT_FUNCARG1YV... use "arg=%x" |
|
|
310 CYG_REPORT_FUNCARG1DV... use "arg=%d" |
|
0
|
311 |
|
|
312 |
|
|
313 --------------------------------------------------------------------------- |
|
|
314 |
|
|
315 Internal Documentation |
|
|
316 ====================== |
|
|
317 |
|
|
318 The required functions which are used by the tracing macros are |
|
|
319 |
|
|
320 externC void |
|
|
321 cyg_tracenomsg( char *psz_func, char *psz_file, cyg_uint32 linenum ); |
|
|
322 |
|
|
323 externC void |
|
|
324 cyg_tracemsg( cyg_uint32 what, |
|
2
|
325 char *psz_func, char *psz_file, cyg_uint32 linenum, |
|
|
326 char *psz_msg ); |
|
0
|
327 |
|
|
328 externC void |
|
|
329 cyg_tracemsg2( cyg_uint32 what, |
|
2
|
330 char *psz_func, char *psz_file, cyg_uint32 linenum, |
|
|
331 char *psz_msg, |
|
|
332 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ); |
|
0
|
333 // extended in the obvious way for 4,6,8 arguments |
|
|
334 |
|
|
335 These functions should expect psz_func and psz_file to possibly be NULL in |
|
|
336 case those facilities are not available in the compilation environment, and |
|
|
337 do something safe in such cases. A NULL message should really be dealt |
|
|
338 with safely also, just logging "execution here" info like cyg_tracenomsg(). |
|
|
339 |
|
|
340 Discussion of possible underlying implementations |
|
|
341 ------------------------------------------------- |
|
|
342 |
|
|
343 It is intended that the functions that get called can simply print the info |
|
|
344 they are given in as fancy a format as you like, or they could do the |
|
|
345 printf-type formatting and log the resulting text in a buffer. They get |
|
|
346 told the type of event (function-entry, function-arguments, function-exit |
|
|
347 or plain tracing info) and so can perform fancy indenting, for example, to |
|
|
348 make call stack inspection more obvious to humans. It is also intended |
|
|
349 that a more compact logging arrangement be possible, for example one which |
|
|
350 records, in 32-bit words (CYG_ADDRWORDs), the addresses of the file, |
|
|
351 function and msg strings, the line number and the arguments. This has the |
|
|
352 implication that the msg string should not be constructed dynamically but |
|
|
353 be static ie. a plain quoted C string. The number of arguments also must |
|
|
354 be recorded, and if it is chosen to save string arguments in the buffer |
|
|
355 rather than just their addresses (which could be invalid by the time the |
|
|
356 logged information is processed) some flagging of which arguments are |
|
|
357 strings must be provided. The system could also be extended to deal with |
|
|
358 floats of whichever size fir in a CYG_ADDRWORD; these would probably |
|
|
359 require special treatment also. With these considerations in mind, the |
|
|
360 maximum number of parameters in a single trace message has been set to 8, |
|
|
361 so that a byte bitset could be used to indicate which arguments are |
|
|
362 strings, another for those which are floats, and the count of arguments |
|
|
363 also fits in a byte as number or a bitset. |
|
|
364 |
|
|
365 |
|
|
366 ****************************************************************************/ |
|
|
367 |
|
|
368 #include <pkgconf/infra.h> |
|
|
369 |
|
|
370 #include <cyg/infra/cyg_ass.h> |
|
|
371 |
|
|
372 // ------------------------------------------------------------------------- |
|
|
373 // CYGDBG_INFRA_DEBUG_FUNCTION_PSEUDOMACRO is dealt with in cyg_ass.h. |
|
|
374 // ------------------------------------------------------------------------- |
|
|
375 |
|
|
376 #ifdef CYGDBG_USE_TRACING |
|
|
377 |
|
|
378 // ------------------------------------------------------------------------- |
|
|
379 // We define macros and appropriate prototypes for the trace/fail |
|
|
380 // system. These are: |
|
2
|
381 // CYG_TRACE0..8 - trace if boolean |
|
|
382 // CYG_TRACEPROC - default no comment proc entry |
|
|
383 // CYG_TRACEPROCOUT - default no comment proc exit |
|
0
|
384 |
|
|
385 // these are executed to deal with tracing - breakpoint? |
|
|
386 |
|
|
387 externC void |
|
|
388 cyg_tracenomsg( char *psz_func, char *psz_file, cyg_uint32 linenum ); |
|
|
389 |
|
|
390 // provide every other one of these as a space/caller bloat compromise. |
|
|
391 |
|
|
392 # ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
393 |
|
|
394 enum cyg_trace_what{ |
|
|
395 cyg_trace_trace = 0, |
|
|
396 cyg_trace_enter, |
|
|
397 cyg_trace_args, |
|
|
398 cyg_trace_return, |
|
|
399 // cyg_trace_, |
|
|
400 // cyg_trace_, |
|
|
401 }; |
|
|
402 |
|
|
403 externC void |
|
|
404 cyg_tracemsg( cyg_uint32 what, |
|
|
405 char *psz_func, char *psz_file, cyg_uint32 linenum, |
|
|
406 char *psz_msg ); |
|
|
407 |
|
|
408 externC void |
|
|
409 cyg_tracemsg2( cyg_uint32 what, |
|
|
410 char *psz_func, char *psz_file, cyg_uint32 linenum, |
|
|
411 char *psz_msg, |
|
|
412 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1 ); |
|
|
413 externC void |
|
|
414 cyg_tracemsg4( cyg_uint32 what, |
|
|
415 char *psz_func, char *psz_file, cyg_uint32 linenum, |
|
|
416 char *psz_msg, |
|
|
417 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, |
|
|
418 CYG_ADDRWORD arg2, CYG_ADDRWORD arg3 ); |
|
|
419 externC void |
|
|
420 cyg_tracemsg6( cyg_uint32 what, |
|
|
421 char *psz_func, char *psz_file, cyg_uint32 linenum, |
|
|
422 char *psz_msg, |
|
|
423 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, |
|
|
424 CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, |
|
|
425 CYG_ADDRWORD arg4, CYG_ADDRWORD arg5 ); |
|
|
426 externC void |
|
|
427 cyg_tracemsg8( cyg_uint32 what, |
|
|
428 char *psz_func, char *psz_file, cyg_uint32 linenum, |
|
|
429 char *psz_msg, |
|
|
430 CYG_ADDRWORD arg0, CYG_ADDRWORD arg1, |
|
|
431 CYG_ADDRWORD arg2, CYG_ADDRWORD arg3, |
|
|
432 CYG_ADDRWORD arg4, CYG_ADDRWORD arg5, |
|
|
433 CYG_ADDRWORD arg6, CYG_ADDRWORD arg7 ); |
|
|
434 |
|
|
435 #endif // CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
436 |
|
|
437 // ------------------------------------------------------------------------- |
|
|
438 |
|
|
439 # ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
440 |
|
|
441 # define CYG_TRACE_docall0( _msg_ ) \ |
|
2
|
442 cyg_tracemsg( cyg_trace_trace, \ |
|
0
|
443 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_ ); |
|
|
444 |
|
|
445 # define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \ |
|
2
|
446 cyg_tracemsg2( cyg_trace_trace, \ |
|
0
|
447 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ |
|
2
|
448 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_ ); |
|
0
|
449 |
|
|
450 # define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \ |
|
2
|
451 cyg_tracemsg4( cyg_trace_trace, \ |
|
0
|
452 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ |
|
|
453 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ |
|
|
454 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_ ); |
|
|
455 |
|
|
456 # define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ |
|
2
|
457 _arg4_, _arg5_ ) \ |
|
|
458 cyg_tracemsg6( cyg_trace_trace, \ |
|
0
|
459 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ |
|
|
460 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ |
|
2
|
461 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \ |
|
0
|
462 (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_ ); |
|
|
463 |
|
2
|
464 # define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ |
|
|
465 _arg4_, _arg5_, _arg6_, _arg7_ ) \ |
|
|
466 cyg_tracemsg8( cyg_trace_trace, \ |
|
0
|
467 __PRETTY_FUNCTION__, __FILE__, __LINE__, _msg_, \ |
|
|
468 (CYG_ADDRWORD)_arg0_, (CYG_ADDRWORD)_arg1_, \ |
|
2
|
469 (CYG_ADDRWORD)_arg2_, (CYG_ADDRWORD)_arg3_, \ |
|
|
470 (CYG_ADDRWORD)_arg4_, (CYG_ADDRWORD)_arg5_, \ |
|
0
|
471 (CYG_ADDRWORD)_arg6_, (CYG_ADDRWORD)_arg7_ ); |
|
|
472 |
|
|
473 # else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
474 |
|
|
475 # define CYG_TRACE_docall0( _msg_ ) \ |
|
|
476 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); |
|
|
477 |
|
|
478 # define CYG_TRACE_docall2( _msg_, _arg0_, _arg1_ ) \ |
|
|
479 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); |
|
|
480 |
|
|
481 # define CYG_TRACE_docall4( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_ ) \ |
|
|
482 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); |
|
|
483 |
|
|
484 # define CYG_TRACE_docall6( _msg_, _arg0_, _arg1_ , _arg2_, _arg3_, \ |
|
2
|
485 _arg4_, _arg5_ ) \ |
|
0
|
486 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); |
|
|
487 |
|
2
|
488 # define CYG_TRACE_docall8( _msg_, _arg0_, _arg1_, _arg2_, _arg3_, \ |
|
|
489 _arg4_, _arg5_, _arg6_, _arg7_ ) \ |
|
0
|
490 cyg_tracenomsg( __PRETTY_FUNCTION__, __FILE__, __LINE__ ); |
|
|
491 |
|
|
492 #endif |
|
|
493 |
|
|
494 // ------------------------------------------------------------------------- |
|
|
495 // Conditioned trace; if the condition is false, fail. |
|
|
496 |
|
2
|
497 #define CYG_TRACE0( _bool_, _msg_ ) \ |
|
|
498 CYG_MACRO_START \ |
|
|
499 if ( ( _bool_ ) ) \ |
|
|
500 CYG_TRACE_docall0( _msg_ ); \ |
|
0
|
501 CYG_MACRO_END |
|
|
502 |
|
2
|
503 #define CYG_TRACE1( _bool_, _msg_, a ) \ |
|
|
504 CYG_MACRO_START \ |
|
|
505 if ( ( _bool_ ) ) \ |
|
|
506 CYG_TRACE_docall2( _msg_, a, 0 ); \ |
|
0
|
507 CYG_MACRO_END |
|
|
508 |
|
2
|
509 #define CYG_TRACE2( _bool_, _msg_, a, b ) \ |
|
|
510 CYG_MACRO_START \ |
|
|
511 if ( ( _bool_ ) ) \ |
|
|
512 CYG_TRACE_docall2( _msg_, a, b ); \ |
|
0
|
513 CYG_MACRO_END |
|
|
514 |
|
2
|
515 #define CYG_TRACE3( _bool_, _msg_, a, b, c ) \ |
|
|
516 CYG_MACRO_START \ |
|
|
517 if ( ( _bool_ ) ) \ |
|
|
518 CYG_TRACE_docall4( _msg_, a, b, c, 0 ); \ |
|
0
|
519 CYG_MACRO_END |
|
|
520 |
|
2
|
521 #define CYG_TRACE4( _bool_, _msg_, a, b, c, d ) \ |
|
|
522 CYG_MACRO_START \ |
|
|
523 if ( ( _bool_ ) ) \ |
|
|
524 CYG_TRACE_docall4( _msg_, a, b, c, d ); \ |
|
0
|
525 CYG_MACRO_END |
|
|
526 |
|
2
|
527 #define CYG_TRACE5( _bool_, _msg_, a, b, c, d, e ) \ |
|
|
528 CYG_MACRO_START \ |
|
|
529 if ( ( _bool_ ) ) \ |
|
|
530 CYG_TRACE_docall6( _msg_, a, b, c, d, e, 0 ); \ |
|
0
|
531 CYG_MACRO_END |
|
|
532 |
|
2
|
533 #define CYG_TRACE6( _bool_, _msg_, a, b, c, d, e, f ) \ |
|
|
534 CYG_MACRO_START \ |
|
|
535 if ( ( _bool_ ) ) \ |
|
|
536 CYG_TRACE_docall6( _msg_, a, b, c, d, e, f ); \ |
|
0
|
537 CYG_MACRO_END |
|
|
538 |
|
2
|
539 #define CYG_TRACE7( _bool_, _msg_, a, b, c, d, e, f, g ) \ |
|
|
540 CYG_MACRO_START \ |
|
|
541 if ( ( _bool_ ) ) \ |
|
|
542 CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, 0 ); \ |
|
0
|
543 CYG_MACRO_END |
|
|
544 |
|
2
|
545 #define CYG_TRACE8( _bool_, _msg_, a, b, c, d, e, f, g, h ) \ |
|
|
546 CYG_MACRO_START \ |
|
|
547 if ( ( _bool_ ) ) \ |
|
|
548 CYG_TRACE_docall8( _msg_, a, b, c, d, e, f, g, h ); \ |
|
0
|
549 CYG_MACRO_END |
|
|
550 |
|
|
551 // ------------------------------------------------------------------------- |
|
|
552 // Report function entry and exit. |
|
|
553 // In C++ the macro CYG_REPORT_FUNCTION should appear as the first line of |
|
|
554 // any function. It will generate a message whenever the function is entered |
|
|
555 // and when it is exited. |
|
|
556 // In C the macro should appear as the first statement after any local variable |
|
|
557 // definitions. No exit message will be generated unless CYG_REPORT_RETURN is |
|
|
558 // placed just before each return. |
|
|
559 // Where a piece of code is to be compiled with both C and C++, the above |
|
|
560 // rules for C should be followed. |
|
|
561 |
|
|
562 #ifdef CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS |
|
|
563 |
|
|
564 #ifdef __cplusplus |
|
|
565 |
|
|
566 class Cyg_TraceFunction_Report_ |
|
|
567 { |
|
|
568 public: |
|
|
569 int cond; |
|
|
570 char *func; |
|
|
571 char *file; |
|
|
572 cyg_uint32 lnum; |
|
|
573 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
574 char *exitmsg; |
|
|
575 CYG_ADDRWORD exitvalue; |
|
|
576 enum { UNSET = 0, SET, VOID } exitset; |
|
|
577 #endif |
|
|
578 |
|
|
579 Cyg_TraceFunction_Report_( |
|
|
580 int condition, char *psz_func, char *psz_file, |
|
|
581 cyg_uint32 linenum) |
|
|
582 { |
|
|
583 cond = condition; |
|
|
584 func = psz_func; |
|
|
585 file = psz_file; |
|
|
586 lnum = linenum; |
|
|
587 |
|
|
588 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
589 exitmsg = NULL; |
|
|
590 exitset = UNSET; |
|
|
591 if ( cond ) |
|
|
592 cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter"); |
|
|
593 #else |
|
|
594 if ( cond ) |
|
|
595 cyg_tracenomsg( func, file, lnum ); |
|
|
596 #endif |
|
|
597 }; |
|
|
598 |
|
|
599 Cyg_TraceFunction_Report_( |
|
|
600 int condition, char *psz_func, char *psz_file, |
|
|
601 cyg_uint32 linenum, char *psz_exitmsg ) |
|
|
602 { |
|
|
603 cond = condition; |
|
|
604 func = psz_func; |
|
|
605 file = psz_file; |
|
|
606 lnum = linenum; |
|
|
607 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
608 exitmsg = psz_exitmsg; |
|
|
609 exitset = UNSET; |
|
|
610 if ( cond ) |
|
|
611 cyg_tracemsg( cyg_trace_enter, func, file, lnum, "enter"); |
|
|
612 #else |
|
|
613 CYG_UNUSED_PARAM( char *, psz_exitmsg ); |
|
|
614 if ( cond ) |
|
|
615 cyg_tracenomsg( func, file, lnum ); |
|
|
616 #endif |
|
|
617 }; |
|
|
618 |
|
|
619 inline void set_exitvoid( cyg_uint32 linenum ) |
|
|
620 { |
|
|
621 lnum = linenum; |
|
|
622 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
623 CYG_ASSERT( NULL == exitmsg, "exitvoid used in typed function" ); |
|
|
624 CYG_ASSERT( UNSET == exitset, "exitvoid used when arg already set" ); |
|
|
625 exitset = VOID; |
|
|
626 #endif |
|
|
627 } |
|
|
628 |
|
|
629 inline void set_exitvalue( cyg_uint32 linenum, CYG_ADDRWORD retcode ) |
|
|
630 { |
|
|
631 lnum = linenum; |
|
|
632 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
633 CYG_ASSERT( UNSET == exitset, "exitvalue used when arg already set" ); |
|
|
634 exitvalue = retcode; |
|
|
635 exitset = SET; |
|
|
636 #else |
|
|
637 CYG_UNUSED_PARAM( CYG_ADDRWORD, retcode ); |
|
|
638 #endif |
|
|
639 } |
|
|
640 |
|
|
641 ~Cyg_TraceFunction_Report_() |
|
|
642 { |
|
|
643 if ( cond ) { |
|
|
644 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
645 if ( VOID == exitset ) |
|
|
646 cyg_tracemsg( cyg_trace_return, func, file, lnum, |
|
|
647 "return void"); |
|
|
648 else if ( UNSET == exitset ) |
|
|
649 cyg_tracemsg( cyg_trace_return, func, file, lnum, |
|
|
650 "RETURNING UNSET!"); |
|
|
651 else if ( NULL == exitmsg ) |
|
|
652 cyg_tracemsg2( cyg_trace_return, func, file, lnum, |
|
|
653 "return %08x", exitvalue, 0 ); |
|
|
654 else |
|
|
655 cyg_tracemsg2( cyg_trace_return, func, file, lnum, |
|
|
656 exitmsg, exitvalue, 0 ); |
|
|
657 #else |
|
|
658 cyg_tracenomsg( func, file, lnum ); |
|
|
659 #endif |
|
|
660 } |
|
|
661 } |
|
|
662 }; |
|
|
663 |
|
|
664 // These have no CYG_MACRO_START,END around because it is required |
|
|
665 // that the scope of the object be the whole function body. Get it? |
|
|
666 |
|
|
667 // These are the unconditional versions: |
|
2
|
668 #define CYG_REPORT_FUNCTION() \ |
|
|
669 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ |
|
|
670 1, __PRETTY_FUNCTION__, \ |
|
0
|
671 __FILE__, __LINE__ ) |
|
|
672 |
|
2
|
673 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \ |
|
|
674 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ |
|
|
675 1, __PRETTY_FUNCTION__, \ |
|
0
|
676 __FILE__, __LINE__, _exitmsg_ ) |
|
|
677 |
|
2
|
678 #define CYG_REPORT_FUNCNAME( _name_ ) \ |
|
|
679 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ |
|
|
680 1, _name_, \ |
|
0
|
681 __FILE__, __LINE__ ) |
|
|
682 |
|
2
|
683 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \ |
|
|
684 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ |
|
|
685 1, _name_, \ |
|
0
|
686 __FILE__, __LINE__, _exitmsg_ ) |
|
|
687 |
|
|
688 // These are conditioned on macro CYG_REPORT_USER_BOOL |
|
|
689 // (which you better have defined) |
|
2
|
690 #define CYG_REPORT_FUNCTIONC() \ |
|
|
691 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ |
|
|
692 CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \ |
|
0
|
693 __FILE__, __LINE__ ) |
|
|
694 |
|
2
|
695 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \ |
|
|
696 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ |
|
|
697 CYG_REPORT_USER_BOOL, __PRETTY_FUNCTION__, \ |
|
0
|
698 __FILE__, __LINE__, _exitmsg_ ) |
|
|
699 |
|
2
|
700 #define CYG_REPORT_FUNCNAMEC( _name_ ) \ |
|
|
701 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ |
|
|
702 CYG_REPORT_USER_BOOL, _name_, \ |
|
0
|
703 __FILE__, __LINE__ ) |
|
|
704 |
|
2
|
705 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \ |
|
|
706 Cyg_TraceFunction_Report_ cyg_tracefunction_report_( \ |
|
|
707 CYG_REPORT_USER_BOOL, _name_, \ |
|
0
|
708 __FILE__, __LINE__, _exitmsg_ ) |
|
|
709 |
|
|
710 |
|
2
|
711 #define CYG_REPORT_RETURN() CYG_MACRO_START \ |
|
|
712 cyg_tracefunction_report_.set_exitvoid( __LINE__ ); \ |
|
0
|
713 CYG_MACRO_END |
|
|
714 |
|
2
|
715 #define CYG_REPORT_RETVAL( _value_) CYG_MACRO_START \ |
|
|
716 cyg_tracefunction_report_.set_exitvalue( \ |
|
|
717 __LINE__, (CYG_ADDRWORD)(_value_) ); \ |
|
0
|
718 CYG_MACRO_END |
|
|
719 |
|
|
720 |
|
|
721 #else // not __cplusplus |
|
|
722 |
|
|
723 |
|
|
724 struct Cyg_TraceFunction_Report_ |
|
|
725 { |
|
|
726 int cond; |
|
|
727 char *func; |
|
|
728 char *file; /* not strictly needed in plain 'C' */ |
|
|
729 cyg_uint32 lnum; /* nor this */ |
|
|
730 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
731 char *exitmsg; |
|
|
732 CYG_ADDRWORD exitvalue; |
|
|
733 int exitset; |
|
|
734 #endif |
|
|
735 |
|
|
736 }; |
|
|
737 |
|
|
738 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
739 |
|
2
|
740 #define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \ |
|
|
741 if ( cyg_tracefunction_report_.cond ) \ |
|
|
742 cyg_tracemsg( cyg_trace_enter, \ |
|
|
743 cyg_tracefunction_report_.func, \ |
|
|
744 cyg_tracefunction_report_.file, \ |
|
|
745 cyg_tracefunction_report_.lnum, \ |
|
|
746 "enter" ); \ |
|
0
|
747 CYG_MACRO_END |
|
|
748 |
|
|
749 #define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \ |
|
2
|
750 { _c_, _fn_, _fl_, _l_, _xm_, _xv_, _xs_ } |
|
0
|
751 |
|
|
752 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
753 |
|
2
|
754 #define CYG_REPORT_FUNCTION_ENTER_INTERNAL() CYG_MACRO_START \ |
|
|
755 if ( cyg_tracefunction_report_.cond ) \ |
|
|
756 cyg_tracenomsg( cyg_tracefunction_report_.func, \ |
|
|
757 cyg_tracefunction_report_.file, \ |
|
|
758 cyg_tracefunction_report_.lnum ); \ |
|
0
|
759 CYG_MACRO_END |
|
|
760 |
|
|
761 #define CYG_REPORT_FUNCTION_CONSTRUCT( _c_, _fn_,_fl_,_l_,_xm_,_xv_,_xs_ ) \ |
|
2
|
762 { _c_, _fn_, _fl_, _l_ } |
|
0
|
763 |
|
|
764 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
765 |
|
|
766 // These have no CYG_MACRO_START,END around because it is required |
|
|
767 // that the scope of the object be the whole function body. Get it? |
|
|
768 |
|
|
769 // These are the unconditional versions: |
|
2
|
770 #define CYG_REPORT_FUNCTION() \ |
|
|
771 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ |
|
|
772 CYG_REPORT_FUNCTION_CONSTRUCT( \ |
|
|
773 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \ |
|
0
|
774 CYG_REPORT_FUNCTION_ENTER_INTERNAL() |
|
|
775 |
|
2
|
776 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) \ |
|
|
777 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ |
|
|
778 CYG_REPORT_FUNCTION_CONSTRUCT( \ |
|
|
779 1, __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ |
|
0
|
780 CYG_REPORT_FUNCTION_ENTER_INTERNAL() |
|
|
781 |
|
2
|
782 #define CYG_REPORT_FUNCNAME( _name_ ) \ |
|
|
783 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ |
|
|
784 CYG_REPORT_FUNCTION_CONSTRUCT( \ |
|
|
785 1, _name_, __FILE__, __LINE__, NULL, 0, 0 ); \ |
|
0
|
786 CYG_REPORT_FUNCTION_ENTER_INTERNAL() |
|
|
787 |
|
2
|
788 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) \ |
|
|
789 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ |
|
|
790 CYG_REPORT_FUNCTION_CONSTRUCT( \ |
|
|
791 1, _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ |
|
0
|
792 CYG_REPORT_FUNCTION_ENTER_INTERNAL() |
|
|
793 |
|
|
794 // These are conditioned on macro CYG_REPORT_USER_BOOL |
|
|
795 // (which you better have defined) |
|
2
|
796 #define CYG_REPORT_FUNCTIONC() \ |
|
|
797 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ |
|
|
798 CYG_REPORT_FUNCTION_CONSTRUCT( \ |
|
|
799 CYG_REPORT_USER_BOOL, \ |
|
|
800 __PRETTY_FUNCTION__, __FILE__, __LINE__, NULL, 0, 0 ); \ |
|
0
|
801 CYG_REPORT_FUNCTION_ENTER_INTERNAL() |
|
|
802 |
|
2
|
803 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) \ |
|
|
804 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ |
|
|
805 CYG_REPORT_FUNCTION_CONSTRUCT( \ |
|
|
806 CYG_REPORT_USER_BOOL, \ |
|
|
807 __PRETTY_FUNCTION__, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ |
|
0
|
808 CYG_REPORT_FUNCTION_ENTER_INTERNAL() |
|
|
809 |
|
2
|
810 #define CYG_REPORT_FUNCNAMEC( _name_ ) \ |
|
|
811 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ |
|
|
812 CYG_REPORT_FUNCTION_CONSTRUCT( \ |
|
|
813 CYG_REPORT_USER_BOOL, \ |
|
|
814 _name_, __FILE__, __LINE__, NULL, 0, 0 ); \ |
|
0
|
815 CYG_REPORT_FUNCTION_ENTER_INTERNAL() |
|
|
816 |
|
2
|
817 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) \ |
|
|
818 struct Cyg_TraceFunction_Report_ cyg_tracefunction_report_ = \ |
|
|
819 CYG_REPORT_FUNCTION_CONSTRUCT( \ |
|
|
820 CYG_REPORT_USER_BOOL, \ |
|
|
821 _name_, __FILE__, __LINE__, _exitmsg_, 0, 0 ); \ |
|
0
|
822 CYG_REPORT_FUNCTION_ENTER_INTERNAL() |
|
|
823 |
|
|
824 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
825 |
|
|
826 #define CYG_REPORT_RETURN() CYG_MACRO_START \ |
|
2
|
827 CYG_ASSERT( NULL == cyg_tracefunction_report_.exitmsg, \ |
|
|
828 "exitvoid used in typed function" ); \ |
|
|
829 CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \ |
|
|
830 "exitvoid used when arg already set" ); \ |
|
|
831 cyg_tracefunction_report_.lnum = __LINE__; \ |
|
|
832 cyg_tracefunction_report_.exitset = 2; \ |
|
|
833 if ( cyg_tracefunction_report_.cond ) \ |
|
|
834 cyg_tracemsg( cyg_trace_return, \ |
|
|
835 cyg_tracefunction_report_.func, \ |
|
|
836 cyg_tracefunction_report_.file, \ |
|
|
837 cyg_tracefunction_report_.lnum, \ |
|
|
838 "return void" ); \ |
|
0
|
839 CYG_MACRO_END |
|
|
840 |
|
|
841 #define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \ |
|
2
|
842 CYG_ASSERT( 0 == cyg_tracefunction_report_.exitset, \ |
|
|
843 "exitvalue used when arg already set" ); \ |
|
|
844 cyg_tracefunction_report_.lnum = __LINE__; \ |
|
|
845 cyg_tracefunction_report_.exitvalue = (CYG_ADDRWORD)(_value_); \ |
|
|
846 cyg_tracefunction_report_.exitset = 1; \ |
|
|
847 if ( cyg_tracefunction_report_.cond ) \ |
|
|
848 cyg_tracemsg2( cyg_trace_return, \ |
|
|
849 cyg_tracefunction_report_.func, \ |
|
|
850 cyg_tracefunction_report_.file, \ |
|
|
851 cyg_tracefunction_report_.lnum, \ |
|
|
852 cyg_tracefunction_report_.exitmsg ? \ |
|
|
853 cyg_tracefunction_report_.exitmsg : \ |
|
|
854 "return %08x", \ |
|
|
855 cyg_tracefunction_report_.exitvalue, 0 ); \ |
|
0
|
856 CYG_MACRO_END |
|
|
857 |
|
|
858 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
859 |
|
|
860 #define CYG_REPORT_RETURN() CYG_MACRO_START \ |
|
2
|
861 cyg_tracefunction_report_.lnum = __LINE__; \ |
|
|
862 if ( cyg_tracefunction_report_.cond ) \ |
|
|
863 cyg_tracenomsg( cyg_tracefunction_report_.func, \ |
|
|
864 cyg_tracefunction_report_.file, \ |
|
|
865 cyg_tracefunction_report_.lnum ); \ |
|
0
|
866 CYG_MACRO_END |
|
|
867 |
|
|
868 #define CYG_REPORT_RETVAL( _value_ ) CYG_MACRO_START \ |
|
2
|
869 CYG_REPORT_RETURN(); \ |
|
0
|
870 CYG_MACRO_END |
|
|
871 |
|
|
872 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
873 |
|
|
874 #endif // not __cplusplus |
|
|
875 |
|
|
876 #ifdef CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
877 |
|
2
|
878 #define CYG_REPORT_FUNCARGVOID() CYG_MACRO_START \ |
|
|
879 if ( cyg_tracefunction_report_.cond ) \ |
|
|
880 cyg_tracemsg( cyg_trace_args, \ |
|
|
881 cyg_tracefunction_report_.func, \ |
|
|
882 cyg_tracefunction_report_.file, \ |
|
|
883 cyg_tracefunction_report_.lnum, \ |
|
|
884 "(void)" \ |
|
|
885 ); \ |
|
0
|
886 CYG_MACRO_END |
|
|
887 |
|
2
|
888 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_MACRO_START \ |
|
|
889 if ( cyg_tracefunction_report_.cond ) \ |
|
|
890 cyg_tracemsg2( cyg_trace_args, \ |
|
|
891 cyg_tracefunction_report_.func, \ |
|
|
892 cyg_tracefunction_report_.file, \ |
|
|
893 cyg_tracefunction_report_.lnum, \ |
|
|
894 (_format_), \ |
|
|
895 (CYG_ADDRWORD)a , 0 \ |
|
|
896 ); \ |
|
0
|
897 CYG_MACRO_END |
|
|
898 |
|
2
|
899 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_MACRO_START \ |
|
|
900 if ( cyg_tracefunction_report_.cond ) \ |
|
|
901 cyg_tracemsg2( cyg_trace_args, \ |
|
|
902 cyg_tracefunction_report_.func, \ |
|
|
903 cyg_tracefunction_report_.file, \ |
|
|
904 cyg_tracefunction_report_.lnum, \ |
|
|
905 (_format_), \ |
|
|
906 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b \ |
|
|
907 ); \ |
|
0
|
908 CYG_MACRO_END |
|
|
909 |
|
2
|
910 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_MACRO_START \ |
|
|
911 if ( cyg_tracefunction_report_.cond ) \ |
|
|
912 cyg_tracemsg4( cyg_trace_args, \ |
|
|
913 cyg_tracefunction_report_.func, \ |
|
|
914 cyg_tracefunction_report_.file, \ |
|
|
915 cyg_tracefunction_report_.lnum, \ |
|
|
916 (_format_), \ |
|
|
917 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ |
|
|
918 (CYG_ADDRWORD)c , 0 \ |
|
|
919 ); \ |
|
0
|
920 CYG_MACRO_END |
|
|
921 |
|
2
|
922 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_MACRO_START \ |
|
|
923 if ( cyg_tracefunction_report_.cond ) \ |
|
|
924 cyg_tracemsg4( cyg_trace_args, \ |
|
|
925 cyg_tracefunction_report_.func, \ |
|
|
926 cyg_tracefunction_report_.file, \ |
|
|
927 cyg_tracefunction_report_.lnum, \ |
|
|
928 (_format_), \ |
|
|
929 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ |
|
|
930 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d \ |
|
|
931 ); \ |
|
0
|
932 CYG_MACRO_END |
|
|
933 |
|
2
|
934 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_MACRO_START \ |
|
|
935 if ( cyg_tracefunction_report_.cond ) \ |
|
|
936 cyg_tracemsg6( cyg_trace_args, \ |
|
|
937 cyg_tracefunction_report_.func, \ |
|
|
938 cyg_tracefunction_report_.file, \ |
|
|
939 cyg_tracefunction_report_.lnum, \ |
|
|
940 (_format_), \ |
|
|
941 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ |
|
|
942 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ |
|
|
943 (CYG_ADDRWORD)e , 0 \ |
|
|
944 ); \ |
|
0
|
945 CYG_MACRO_END |
|
|
946 |
|
2
|
947 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_MACRO_START \ |
|
|
948 if ( cyg_tracefunction_report_.cond ) \ |
|
|
949 cyg_tracemsg6( cyg_trace_args, \ |
|
|
950 cyg_tracefunction_report_.func, \ |
|
|
951 cyg_tracefunction_report_.file, \ |
|
|
952 cyg_tracefunction_report_.lnum, \ |
|
|
953 (_format_), \ |
|
|
954 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ |
|
|
955 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ |
|
|
956 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f \ |
|
|
957 ); \ |
|
0
|
958 CYG_MACRO_END |
|
|
959 |
|
2
|
960 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_MACRO_START \ |
|
|
961 if ( cyg_tracefunction_report_.cond ) \ |
|
|
962 cyg_tracemsg8( cyg_trace_args, \ |
|
|
963 cyg_tracefunction_report_.func, \ |
|
|
964 cyg_tracefunction_report_.file, \ |
|
|
965 cyg_tracefunction_report_.lnum, \ |
|
|
966 (_format_), \ |
|
|
967 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ |
|
|
968 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ |
|
|
969 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \ |
|
|
970 (CYG_ADDRWORD)g , 0 \ |
|
|
971 ); \ |
|
0
|
972 CYG_MACRO_END |
|
|
973 |
|
|
974 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_MACRO_START\ |
|
2
|
975 if ( cyg_tracefunction_report_.cond ) \ |
|
|
976 cyg_tracemsg8( cyg_trace_args, \ |
|
|
977 cyg_tracefunction_report_.func, \ |
|
|
978 cyg_tracefunction_report_.file, \ |
|
|
979 cyg_tracefunction_report_.lnum, \ |
|
|
980 (_format_), \ |
|
|
981 (CYG_ADDRWORD)a, (CYG_ADDRWORD)b, \ |
|
|
982 (CYG_ADDRWORD)c, (CYG_ADDRWORD)d, \ |
|
|
983 (CYG_ADDRWORD)e, (CYG_ADDRWORD)f, \ |
|
|
984 (CYG_ADDRWORD)g, (CYG_ADDRWORD)h \ |
|
|
985 ); \ |
|
0
|
986 CYG_MACRO_END |
|
|
987 |
|
|
988 |
|
|
989 #else // do not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
990 |
|
|
991 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT |
|
|
992 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT |
|
|
993 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT |
|
|
994 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT |
|
|
995 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT |
|
|
996 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT |
|
|
997 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT |
|
|
998 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT |
|
|
999 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT |
|
|
1000 |
|
|
1001 #endif // not CYGDBG_INFRA_DEBUG_TRACE_MESSAGE |
|
|
1002 |
|
|
1003 #else // no CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS |
|
|
1004 |
|
2
|
1005 #define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT |
|
|
1006 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT |
|
|
1007 #define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT |
|
|
1008 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT |
|
0
|
1009 |
|
2
|
1010 #define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT |
|
|
1011 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT |
|
|
1012 #define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT |
|
|
1013 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT |
|
0
|
1014 |
|
|
1015 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT |
|
|
1016 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT |
|
|
1017 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT |
|
|
1018 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT |
|
|
1019 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT |
|
|
1020 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT |
|
|
1021 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT |
|
|
1022 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT |
|
|
1023 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT |
|
|
1024 |
|
2
|
1025 #define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT |
|
|
1026 #define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT |
|
0
|
1027 |
|
|
1028 #endif // CYGDBG_INFRA_DEBUG_FUNCTION_REPORTS |
|
|
1029 |
|
|
1030 #else // ! CYGDBG_USE_TRACING |
|
|
1031 |
|
|
1032 // ------------------------------------------------------------------------- |
|
|
1033 // No traces: we define empty statements for trace macros. |
|
|
1034 |
|
|
1035 #define CYG_TRACE0( _bool_, _msg_ ) CYG_EMPTY_STATEMENT |
|
|
1036 #define CYG_TRACE1( _bool_, _msg_, a ) CYG_EMPTY_STATEMENT |
|
|
1037 #define CYG_TRACE2( _bool_, _msg_, a,b ) CYG_EMPTY_STATEMENT |
|
|
1038 #define CYG_TRACE3( _bool_, _msg_, a,b,c ) CYG_EMPTY_STATEMENT |
|
|
1039 #define CYG_TRACE4( _bool_, _msg_, a,b,c,d ) CYG_EMPTY_STATEMENT |
|
|
1040 #define CYG_TRACE5( _bool_, _msg_, a,b,c,d,e ) CYG_EMPTY_STATEMENT |
|
|
1041 #define CYG_TRACE6( _bool_, _msg_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT |
|
|
1042 #define CYG_TRACE7( _bool_, _msg_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT |
|
|
1043 #define CYG_TRACE8( _bool_, _msg_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT |
|
|
1044 |
|
2
|
1045 #define CYG_REPORT_FUNCTION() CYG_EMPTY_STATEMENT |
|
|
1046 #define CYG_REPORT_FUNCTYPE( _exitmsg_ ) CYG_EMPTY_STATEMENT |
|
|
1047 #define CYG_REPORT_FUNCNAME( _name_ ) CYG_EMPTY_STATEMENT |
|
|
1048 #define CYG_REPORT_FUNCNAMETYPE( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT |
|
0
|
1049 |
|
2
|
1050 #define CYG_REPORT_FUNCTIONC() CYG_EMPTY_STATEMENT |
|
|
1051 #define CYG_REPORT_FUNCTYPEC( _exitmsg_ ) CYG_EMPTY_STATEMENT |
|
|
1052 #define CYG_REPORT_FUNCNAMEC( _name_ ) CYG_EMPTY_STATEMENT |
|
|
1053 #define CYG_REPORT_FUNCNAMETYPEC( _name_, _exitmsg_ ) CYG_EMPTY_STATEMENT |
|
0
|
1054 |
|
|
1055 #define CYG_REPORT_FUNCARGVOID() CYG_EMPTY_STATEMENT |
|
|
1056 #define CYG_REPORT_FUNCARG1( _format_, a ) CYG_EMPTY_STATEMENT |
|
|
1057 #define CYG_REPORT_FUNCARG2( _format_, a,b ) CYG_EMPTY_STATEMENT |
|
|
1058 #define CYG_REPORT_FUNCARG3( _format_, a,b,c ) CYG_EMPTY_STATEMENT |
|
|
1059 #define CYG_REPORT_FUNCARG4( _format_, a,b,c,d ) CYG_EMPTY_STATEMENT |
|
|
1060 #define CYG_REPORT_FUNCARG5( _format_, a,b,c,d,e ) CYG_EMPTY_STATEMENT |
|
|
1061 #define CYG_REPORT_FUNCARG6( _format_, a,b,c,d,e,f ) CYG_EMPTY_STATEMENT |
|
|
1062 #define CYG_REPORT_FUNCARG7( _format_, a,b,c,d,e,f,g ) CYG_EMPTY_STATEMENT |
|
|
1063 #define CYG_REPORT_FUNCARG8( _format_, a,b,c,d,e,f,g,h ) CYG_EMPTY_STATEMENT |
|
|
1064 |
|
2
|
1065 #define CYG_REPORT_RETURN() CYG_EMPTY_STATEMENT |
|
|
1066 #define CYG_REPORT_RETVAL( _value_ ) CYG_EMPTY_STATEMENT |
|
0
|
1067 |
|
|
1068 #endif // ! CYGDBG_USE_TRACING |
|
|
1069 |
|
|
1070 // ------------------------------------------------------------------------- |
|
|
1071 // |
|
|
1072 // CYG_TRACEn{[XDY]{V}}{B} |
|
|
1073 // |
|
|
1074 // Convenience macros: these fall into a few dimensions, with suffix letters: |
|
|
1075 // First option: |
|
|
1076 // X: user need not supply a format string, %08x is used |
|
|
1077 // D: ditto but signed decimal, %d |
|
|
1078 // Y: ditto but just plain %x |
|
|
1079 // Second option, only meaningful with one of XDY: |
|
|
1080 // V: "<var> = %..." is used, by stringifying the argument |
|
|
1081 // Third option: |
|
|
1082 // B: user need not supply a bool; the symbol CYG_TRACE_USER_BOOL is |
|
|
1083 // used (which we do not define, user must do this) |
|
|
1084 |
|
|
1085 #define CYG_TRACE0B( _msg_ ) \ |
|
2
|
1086 CYG_TRACE0( CYG_TRACE_USER_BOOL, _msg_ ) |
|
0
|
1087 #define CYG_TRACE1B( _msg_, a ) \ |
|
2
|
1088 CYG_TRACE1( CYG_TRACE_USER_BOOL, _msg_, a ) |
|
0
|
1089 #define CYG_TRACE2B( _msg_, a,b ) \ |
|
2
|
1090 CYG_TRACE2( CYG_TRACE_USER_BOOL, _msg_, a,b ) |
|
0
|
1091 #define CYG_TRACE3B( _msg_, a,b,c ) \ |
|
2
|
1092 CYG_TRACE3( CYG_TRACE_USER_BOOL, _msg_, a,b,c ) |
|
0
|
1093 #define CYG_TRACE4B( _msg_, a,b,c,d ) \ |
|
2
|
1094 CYG_TRACE4( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d ) |
|
0
|
1095 #define CYG_TRACE5B( _msg_, a,b,c,d,e ) \ |
|
2
|
1096 CYG_TRACE5( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e ) |
|
0
|
1097 #define CYG_TRACE6B( _msg_, a,b,c,d,e,f ) \ |
|
2
|
1098 CYG_TRACE6( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f ) |
|
0
|
1099 #define CYG_TRACE7B( _msg_, a,b,c,d,e,f,g ) \ |
|
2
|
1100 CYG_TRACE7( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g ) |
|
0
|
1101 #define CYG_TRACE8B( _msg_, a,b,c,d,e,f,g,h ) \ |
|
2
|
1102 CYG_TRACE8( CYG_TRACE_USER_BOOL, _msg_, a,b,c,d,e,f,g,h ) |
|
0
|
1103 |
|
|
1104 // long hex versions |
|
|
1105 |
|
|
1106 #define CYG_TRACE1X( _bool_, a ) \ |
|
2
|
1107 CYG_TRACE1( _bool_, "%08x", a ) |
|
0
|
1108 #define CYG_TRACE2X( _bool_, a,b ) \ |
|
2
|
1109 CYG_TRACE2( _bool_, "%08x %08x", a,b ) |
|
0
|
1110 #define CYG_TRACE3X( _bool_, a,b,c ) \ |
|
2
|
1111 CYG_TRACE3( _bool_, "%08x %08x %08x", a,b,c ) |
|
0
|
1112 #define CYG_TRACE4X( _bool_, a,b,c,d ) \ |
|
2
|
1113 CYG_TRACE4( _bool_, "%08x %08x %08x %08x", a,b,c,d ) |
|
0
|
1114 #define CYG_TRACE5X( _bool_, a,b,c,d,e ) \ |
|
2
|
1115 CYG_TRACE5( _bool_, "%08x %08x %08x %08x %08x", a,b,c,d,e ) |
|
0
|
1116 #define CYG_TRACE6X( _bool_, a,b,c,d,e,f ) \ |
|
2
|
1117 CYG_TRACE6( _bool_, "%08x %08x %08x %08x %08x %08x", \ |
|
0
|
1118 a,b,c,d,e,f ) |
|
|
1119 #define CYG_TRACE7X( _bool_, a,b,c,d,e,f,g ) \ |
|
2
|
1120 CYG_TRACE7( _bool_, "%08x %08x %08x %08x %08x %08x %08x", \ |
|
0
|
1121 a,b,c,d,e,f,g ) |
|
|
1122 #define CYG_TRACE8X( _bool_, a,b,c,d,e,f,g,h ) \ |
|
2
|
1123 CYG_TRACE8( _bool_, "%08x %08x %08x %08x %08x %08x %08x %08x", \ |
|
0
|
1124 a,b,c,d,e,f,g,h ) |
|
|
1125 |
|
|
1126 #define CYG_TRACE1XV( _bool_, a ) \ |
|
2
|
1127 CYG_TRACE1( _bool_, # a "=%08x ", a ) |
|
0
|
1128 #define CYG_TRACE2XV( _bool_, a,b ) \ |
|
2
|
1129 CYG_TRACE2( _bool_, \ |
|
0
|
1130 # a "=%08x " # b "=%08x " , a,b ) |
|
|
1131 #define CYG_TRACE3XV( _bool_, a,b,c ) \ |
|
2
|
1132 CYG_TRACE3( _bool_, \ |
|
0
|
1133 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) |
|
|
1134 #define CYG_TRACE4XV( _bool_, a,b,c,d ) \ |
|
2
|
1135 CYG_TRACE4( _bool_, \ |
|
0
|
1136 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1137 , a,b,c,d ) |
|
|
1138 #define CYG_TRACE5XV( _bool_, a,b,c,d,e ) \ |
|
2
|
1139 CYG_TRACE5( _bool_, \ |
|
0
|
1140 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1141 # e "=%08x " \ |
|
|
1142 , a,b,c,d,e ) |
|
|
1143 #define CYG_TRACE6XV( _bool_, a,b,c,d,e,f ) \ |
|
2
|
1144 CYG_TRACE6( _bool_, \ |
|
0
|
1145 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1146 # e "=%08x " # f "=%08x " \ |
|
|
1147 , a,b,c,d,e,f ) |
|
|
1148 #define CYG_TRACE7XV( _bool_, a,b,c,d,e,f,g ) \ |
|
2
|
1149 CYG_TRACE7( _bool_, \ |
|
0
|
1150 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1151 # e "=%08x " # f "=%08x " # g "=%08x " \ |
|
|
1152 , a,b,c,d,e,f,g ) |
|
|
1153 #define CYG_TRACE8XV( _bool_, a,b,c,d,e,f,g,h ) \ |
|
2
|
1154 CYG_TRACE8( _bool_, \ |
|
0
|
1155 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1156 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ |
|
|
1157 , a,b,c,d,e,f,g,h ) |
|
|
1158 |
|
|
1159 #define CYG_TRACE1XB( a ) \ |
|
2
|
1160 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%08x", a ) |
|
0
|
1161 #define CYG_TRACE2XB( a,b ) \ |
|
2
|
1162 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%08x %08x", a,b ) |
|
0
|
1163 #define CYG_TRACE3XB( a,b,c ) \ |
|
2
|
1164 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%08x %08x %08x", a,b,c ) |
|
0
|
1165 #define CYG_TRACE4XB( a,b,c,d ) \ |
|
2
|
1166 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x", a,b,c,d ) |
|
0
|
1167 #define CYG_TRACE5XB( a,b,c,d,e ) \ |
|
2
|
1168 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x", a,b,c,d,e ) |
|
0
|
1169 #define CYG_TRACE6XB( a,b,c,d,e,f ) \ |
|
2
|
1170 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x", \ |
|
0
|
1171 a,b,c,d,e,f ) |
|
|
1172 #define CYG_TRACE7XB( a,b,c,d,e,f,g ) \ |
|
2
|
1173 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x", \ |
|
0
|
1174 a,b,c,d,e,f,g ) |
|
|
1175 #define CYG_TRACE8XB( a,b,c,d,e,f,g,h ) \ |
|
2
|
1176 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%08x %08x %08x %08x %08x %08x %08x %08x", \ |
|
0
|
1177 a,b,c,d,e,f,g,h ) |
|
|
1178 |
|
|
1179 #define CYG_TRACE1XVB( a ) \ |
|
2
|
1180 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%08x ", a ) |
|
0
|
1181 #define CYG_TRACE2XVB( a,b ) \ |
|
2
|
1182 CYG_TRACE2( CYG_TRACE_USER_BOOL, \ |
|
0
|
1183 # a "=%08x " # b "=%08x " , a,b ) |
|
|
1184 #define CYG_TRACE3XVB( a,b,c ) \ |
|
2
|
1185 CYG_TRACE3( CYG_TRACE_USER_BOOL, \ |
|
0
|
1186 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) |
|
|
1187 #define CYG_TRACE4XVB( a,b,c,d ) \ |
|
2
|
1188 CYG_TRACE4( CYG_TRACE_USER_BOOL, \ |
|
0
|
1189 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1190 , a,b,c,d ) |
|
|
1191 #define CYG_TRACE5XVB( a,b,c,d,e ) \ |
|
2
|
1192 CYG_TRACE5( CYG_TRACE_USER_BOOL, \ |
|
0
|
1193 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1194 # e "=%08x " \ |
|
|
1195 , a,b,c,d,e ) |
|
|
1196 #define CYG_TRACE6XVB( a,b,c,d,e,f ) \ |
|
2
|
1197 CYG_TRACE6( CYG_TRACE_USER_BOOL, \ |
|
0
|
1198 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1199 # e "=%08x " # f "=%08x " \ |
|
|
1200 , a,b,c,d,e,f ) |
|
|
1201 #define CYG_TRACE7XVB( a,b,c,d,e,f,g ) \ |
|
2
|
1202 CYG_TRACE7( CYG_TRACE_USER_BOOL, \ |
|
0
|
1203 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1204 # e "=%08x " # f "=%08x " # g "=%08x " \ |
|
|
1205 , a,b,c,d,e,f,g ) |
|
|
1206 #define CYG_TRACE8XVB( a,b,c,d,e,f,g,h ) \ |
|
2
|
1207 CYG_TRACE8( CYG_TRACE_USER_BOOL, \ |
|
0
|
1208 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1209 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ |
|
|
1210 , a,b,c,d,e,f,g,h ) |
|
|
1211 |
|
|
1212 // decimal versions |
|
|
1213 |
|
|
1214 #define CYG_TRACE1D( _bool_, a ) \ |
|
2
|
1215 CYG_TRACE1( _bool_, "%d", a ) |
|
0
|
1216 #define CYG_TRACE2D( _bool_, a,b ) \ |
|
2
|
1217 CYG_TRACE2( _bool_, "%d %d", a,b ) |
|
0
|
1218 #define CYG_TRACE3D( _bool_, a,b,c ) \ |
|
2
|
1219 CYG_TRACE3( _bool_, "%d %d %d", a,b,c ) |
|
0
|
1220 #define CYG_TRACE4D( _bool_, a,b,c,d ) \ |
|
2
|
1221 CYG_TRACE4( _bool_, "%d %d %d %d", a,b,c,d ) |
|
0
|
1222 #define CYG_TRACE5D( _bool_, a,b,c,d,e ) \ |
|
2
|
1223 CYG_TRACE5( _bool_, "%d %d %d %d %d", a,b,c,d,e ) |
|
0
|
1224 #define CYG_TRACE6D( _bool_, a,b,c,d,e,f ) \ |
|
2
|
1225 CYG_TRACE6( _bool_, "%d %d %d %d %d %d", \ |
|
0
|
1226 a,b,c,d,e,f ) |
|
|
1227 #define CYG_TRACE7D( _bool_, a,b,c,d,e,f,g ) \ |
|
2
|
1228 CYG_TRACE7( _bool_, "%d %d %d %d %d %d %d", \ |
|
0
|
1229 a,b,c,d,e,f,g ) |
|
|
1230 #define CYG_TRACE8D( _bool_, a,b,c,d,e,f,g,h ) \ |
|
2
|
1231 CYG_TRACE8( _bool_, "%d %d %d %d %d %d %d %d", \ |
|
0
|
1232 a,b,c,d,e,f,g,h ) |
|
|
1233 |
|
|
1234 #define CYG_TRACE1DV( _bool_, a ) \ |
|
2
|
1235 CYG_TRACE1( _bool_, # a "=%d ", a ) |
|
0
|
1236 #define CYG_TRACE2DV( _bool_, a,b ) \ |
|
2
|
1237 CYG_TRACE2( _bool_, \ |
|
0
|
1238 # a "=%d " # b "=%d " , a,b ) |
|
|
1239 #define CYG_TRACE3DV( _bool_, a,b,c ) \ |
|
2
|
1240 CYG_TRACE3( _bool_, \ |
|
0
|
1241 # a "=%d " # b "=%d " # c "=%d " , a,b,c ) |
|
|
1242 #define CYG_TRACE4DV( _bool_, a,b,c,d ) \ |
|
2
|
1243 CYG_TRACE4( _bool_, \ |
|
0
|
1244 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1245 , a,b,c,d ) |
|
|
1246 #define CYG_TRACE5DV( _bool_, a,b,c,d,e ) \ |
|
2
|
1247 CYG_TRACE5( _bool_, \ |
|
0
|
1248 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1249 # e "=%d " \ |
|
|
1250 , a,b,c,d,e ) |
|
|
1251 #define CYG_TRACE6DV( _bool_, a,b,c,d,e,f ) \ |
|
2
|
1252 CYG_TRACE6( _bool_, \ |
|
0
|
1253 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1254 # e "=%d " # f "=%d " \ |
|
|
1255 , a,b,c,d,e,f ) |
|
|
1256 #define CYG_TRACE7DV( _bool_, a,b,c,d,e,f,g ) \ |
|
2
|
1257 CYG_TRACE7( _bool_, \ |
|
0
|
1258 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1259 # e "=%d " # f "=%d " # g "=%d " \ |
|
|
1260 , a,b,c,d,e,f,g ) |
|
|
1261 #define CYG_TRACE8DV( _bool_, a,b,c,d,e,f,g,h ) \ |
|
2
|
1262 CYG_TRACE8( _bool_, \ |
|
0
|
1263 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1264 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ |
|
|
1265 , a,b,c,d,e,f,g,h ) |
|
|
1266 |
|
|
1267 #define CYG_TRACE1DB( a ) \ |
|
2
|
1268 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%d", a ) |
|
0
|
1269 #define CYG_TRACE2DB( a,b ) \ |
|
2
|
1270 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%d %d", a,b ) |
|
0
|
1271 #define CYG_TRACE3DB( a,b,c ) \ |
|
2
|
1272 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%d %d %d", a,b,c ) |
|
0
|
1273 #define CYG_TRACE4DB( a,b,c,d ) \ |
|
2
|
1274 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%d %d %d %d", a,b,c,d ) |
|
0
|
1275 #define CYG_TRACE5DB( a,b,c,d,e ) \ |
|
2
|
1276 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%d %d %d %d %d", a,b,c,d,e ) |
|
0
|
1277 #define CYG_TRACE6DB( a,b,c,d,e,f ) \ |
|
2
|
1278 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d", \ |
|
0
|
1279 a,b,c,d,e,f ) |
|
|
1280 #define CYG_TRACE7DB( a,b,c,d,e,f,g ) \ |
|
2
|
1281 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d", \ |
|
0
|
1282 a,b,c,d,e,f,g ) |
|
|
1283 #define CYG_TRACE8DB( a,b,c,d,e,f,g,h ) \ |
|
2
|
1284 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%d %d %d %d %d %d %d %d", \ |
|
0
|
1285 a,b,c,d,e,f,g,h ) |
|
|
1286 |
|
|
1287 #define CYG_TRACE1DVB( a ) \ |
|
2
|
1288 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%d ", a ) |
|
0
|
1289 #define CYG_TRACE2DVB( a,b ) \ |
|
2
|
1290 CYG_TRACE2( CYG_TRACE_USER_BOOL, \ |
|
0
|
1291 # a "=%d " # b "=%d " , a,b ) |
|
|
1292 #define CYG_TRACE3DVB( a,b,c ) \ |
|
2
|
1293 CYG_TRACE3( CYG_TRACE_USER_BOOL, \ |
|
0
|
1294 # a "=%d " # b "=%d " # c "=%d " , a,b,c ) |
|
|
1295 #define CYG_TRACE4DVB( a,b,c,d ) \ |
|
2
|
1296 CYG_TRACE4( CYG_TRACE_USER_BOOL, \ |
|
0
|
1297 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1298 , a,b,c,d ) |
|
|
1299 #define CYG_TRACE5DVB( a,b,c,d,e ) \ |
|
2
|
1300 CYG_TRACE5( CYG_TRACE_USER_BOOL, \ |
|
0
|
1301 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1302 # e "=%d " \ |
|
|
1303 , a,b,c,d,e ) |
|
|
1304 #define CYG_TRACE6DVB( a,b,c,d,e,f ) \ |
|
2
|
1305 CYG_TRACE6( CYG_TRACE_USER_BOOL, \ |
|
0
|
1306 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1307 # e "=%d " # f "=%d " \ |
|
|
1308 , a,b,c,d,e,f ) |
|
|
1309 #define CYG_TRACE7DVB( a,b,c,d,e,f,g ) \ |
|
2
|
1310 CYG_TRACE7( CYG_TRACE_USER_BOOL, \ |
|
0
|
1311 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1312 # e "=%d " # f "=%d " # g "=%d " \ |
|
|
1313 , a,b,c,d,e,f,g ) |
|
|
1314 #define CYG_TRACE8DVB( a,b,c,d,e,f,g,h ) \ |
|
2
|
1315 CYG_TRACE8( CYG_TRACE_USER_BOOL, \ |
|
0
|
1316 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1317 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ |
|
|
1318 , a,b,c,d,e,f,g,h ) |
|
|
1319 |
|
|
1320 // short hex versions |
|
|
1321 |
|
|
1322 #define CYG_TRACE1Y( _bool_, a ) \ |
|
2
|
1323 CYG_TRACE1( _bool_, "%x", a ) |
|
0
|
1324 #define CYG_TRACE2Y( _bool_, a,b ) \ |
|
2
|
1325 CYG_TRACE2( _bool_, "%x %x", a,b ) |
|
0
|
1326 #define CYG_TRACE3Y( _bool_, a,b,c ) \ |
|
2
|
1327 CYG_TRACE3( _bool_, "%x %x %x", a,b,c ) |
|
0
|
1328 #define CYG_TRACE4Y( _bool_, a,b,c,d ) \ |
|
2
|
1329 CYG_TRACE4( _bool_, "%x %x %x %x", a,b,c,d ) |
|
0
|
1330 #define CYG_TRACE5Y( _bool_, a,b,c,d,e ) \ |
|
2
|
1331 CYG_TRACE5( _bool_, "%x %x %x %x %x", a,b,c,d,e ) |
|
0
|
1332 #define CYG_TRACE6Y( _bool_, a,b,c,d,e,f ) \ |
|
2
|
1333 CYG_TRACE6( _bool_, "%x %x %x %x %x %x", \ |
|
0
|
1334 a,b,c,d,e,f ) |
|
|
1335 #define CYG_TRACE7Y( _bool_, a,b,c,d,e,f,g ) \ |
|
2
|
1336 CYG_TRACE7( _bool_, "%x %x %x %x %x %x %x", \ |
|
0
|
1337 a,b,c,d,e,f,g ) |
|
|
1338 #define CYG_TRACE8Y( _bool_, a,b,c,d,e,f,g,h ) \ |
|
2
|
1339 CYG_TRACE8( _bool_, "%x %x %x %x %x %x %x %x", \ |
|
0
|
1340 a,b,c,d,e,f,g,h ) |
|
|
1341 |
|
|
1342 #define CYG_TRACE1YV( _bool_, a ) \ |
|
2
|
1343 CYG_TRACE1( _bool_, # a "=%x ", a ) |
|
0
|
1344 #define CYG_TRACE2YV( _bool_, a,b ) \ |
|
2
|
1345 CYG_TRACE2( _bool_, \ |
|
0
|
1346 # a "=%x " # b "=%x " , a,b ) |
|
|
1347 #define CYG_TRACE3YV( _bool_, a,b,c ) \ |
|
2
|
1348 CYG_TRACE3( _bool_, \ |
|
0
|
1349 # a "=%x " # b "=%x " # c "=%x " , a,b,c ) |
|
|
1350 #define CYG_TRACE4YV( _bool_, a,b,c,d ) \ |
|
2
|
1351 CYG_TRACE4( _bool_, \ |
|
0
|
1352 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1353 , a,b,c,d ) |
|
|
1354 #define CYG_TRACE5YV( _bool_, a,b,c,d,e ) \ |
|
2
|
1355 CYG_TRACE5( _bool_, \ |
|
0
|
1356 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1357 # e "=%x " \ |
|
|
1358 , a,b,c,d,e ) |
|
|
1359 #define CYG_TRACE6YV( _bool_, a,b,c,d,e,f ) \ |
|
2
|
1360 CYG_TRACE6( _bool_, \ |
|
0
|
1361 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1362 # e "=%x " # f "=%x " \ |
|
|
1363 , a,b,c,d,e,f ) |
|
|
1364 #define CYG_TRACE7YV( _bool_, a,b,c,d,e,f,g ) \ |
|
2
|
1365 CYG_TRACE7( _bool_, \ |
|
0
|
1366 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1367 # e "=%x " # f "=%x " # g "=%x " \ |
|
|
1368 , a,b,c,d,e,f,g ) |
|
|
1369 #define CYG_TRACE8YV( _bool_, a,b,c,d,e,f,g,h ) \ |
|
2
|
1370 CYG_TRACE8( _bool_, \ |
|
0
|
1371 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1372 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ |
|
|
1373 , a,b,c,d,e,f,g,h ) |
|
|
1374 |
|
|
1375 #define CYG_TRACE1YB( a ) \ |
|
2
|
1376 CYG_TRACE1( CYG_TRACE_USER_BOOL, "%x", a ) |
|
0
|
1377 #define CYG_TRACE2YB( a,b ) \ |
|
2
|
1378 CYG_TRACE2( CYG_TRACE_USER_BOOL, "%x %x", a,b ) |
|
0
|
1379 #define CYG_TRACE3YB( a,b,c ) \ |
|
2
|
1380 CYG_TRACE3( CYG_TRACE_USER_BOOL, "%x %x %x", a,b,c ) |
|
0
|
1381 #define CYG_TRACE4YB( a,b,c,d ) \ |
|
2
|
1382 CYG_TRACE4( CYG_TRACE_USER_BOOL, "%x %x %x %x", a,b,c,d ) |
|
0
|
1383 #define CYG_TRACE5YB( a,b,c,d,e ) \ |
|
2
|
1384 CYG_TRACE5( CYG_TRACE_USER_BOOL, "%x %x %x %x %x", a,b,c,d,e ) |
|
0
|
1385 #define CYG_TRACE6YB( a,b,c,d,e,f ) \ |
|
2
|
1386 CYG_TRACE6( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x", \ |
|
0
|
1387 a,b,c,d,e,f ) |
|
|
1388 #define CYG_TRACE7YB( a,b,c,d,e,f,g ) \ |
|
2
|
1389 CYG_TRACE7( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x", \ |
|
0
|
1390 a,b,c,d,e,f,g ) |
|
|
1391 #define CYG_TRACE8YB( a,b,c,d,e,f,g,h ) \ |
|
2
|
1392 CYG_TRACE8( CYG_TRACE_USER_BOOL, "%x %x %x %x %x %x %x %x", \ |
|
0
|
1393 a,b,c,d,e,f,g,h ) |
|
|
1394 |
|
|
1395 #define CYG_TRACE1YVB( a ) \ |
|
2
|
1396 CYG_TRACE1( CYG_TRACE_USER_BOOL, # a "=%x ", a ) |
|
0
|
1397 #define CYG_TRACE2YVB( a,b ) \ |
|
2
|
1398 CYG_TRACE2( CYG_TRACE_USER_BOOL, \ |
|
0
|
1399 # a "=%x " # b "=%x " , a,b ) |
|
|
1400 #define CYG_TRACE3YVB( a,b,c ) \ |
|
2
|
1401 CYG_TRACE3( CYG_TRACE_USER_BOOL, \ |
|
0
|
1402 # a "=%x " # b "=%x " # c "=%x " , a,b,c ) |
|
|
1403 #define CYG_TRACE4YVB( a,b,c,d ) \ |
|
2
|
1404 CYG_TRACE4( CYG_TRACE_USER_BOOL, \ |
|
0
|
1405 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1406 , a,b,c,d ) |
|
|
1407 #define CYG_TRACE5YVB( a,b,c,d,e ) \ |
|
2
|
1408 CYG_TRACE5( CYG_TRACE_USER_BOOL, \ |
|
0
|
1409 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1410 # e "=%x " \ |
|
|
1411 , a,b,c,d,e ) |
|
|
1412 #define CYG_TRACE6YVB( a,b,c,d,e,f ) \ |
|
2
|
1413 CYG_TRACE6( CYG_TRACE_USER_BOOL, \ |
|
0
|
1414 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1415 # e "=%x " # f "=%x " \ |
|
|
1416 , a,b,c,d,e,f ) |
|
|
1417 #define CYG_TRACE7YVB( a,b,c,d,e,f,g ) \ |
|
2
|
1418 CYG_TRACE7( CYG_TRACE_USER_BOOL, \ |
|
0
|
1419 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1420 # e "=%x " # f "=%x " # g "=%x " \ |
|
|
1421 , a,b,c,d,e,f,g ) |
|
|
1422 #define CYG_TRACE8YVB( a,b,c,d,e,f,g,h ) \ |
|
2
|
1423 CYG_TRACE8( CYG_TRACE_USER_BOOL, \ |
|
0
|
1424 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1425 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ |
|
|
1426 , a,b,c,d,e,f,g,h ) |
|
|
1427 |
|
|
1428 // ------------------------------------------------------------------------- |
|
|
1429 // |
|
|
1430 // CYG_REPORT_FUNCARGn{[XDY]{V}} |
|
|
1431 // |
|
|
1432 // Convenience macros two: these fall into a few dimensions, with suffix letters: |
|
|
1433 // First option: |
|
|
1434 // X: user need not supply a format string, %08x is used |
|
|
1435 // D: ditto but signed decimal, %d |
|
|
1436 // Y: ditto but just plain %x |
|
|
1437 // Second option, only meaningful with one of XDY: |
|
|
1438 // V: "<var> = %..." is used, by stringifying the argument |
|
|
1439 |
|
|
1440 // long hex versions |
|
|
1441 |
|
|
1442 #define CYG_REPORT_FUNCARG1X( a ) \ |
|
2
|
1443 CYG_REPORT_FUNCARG1( "%08x", a ) |
|
0
|
1444 #define CYG_REPORT_FUNCARG2X( a,b ) \ |
|
2
|
1445 CYG_REPORT_FUNCARG2( "%08x %08x", a,b ) |
|
0
|
1446 #define CYG_REPORT_FUNCARG3X( a,b,c ) \ |
|
2
|
1447 CYG_REPORT_FUNCARG3( "%08x %08x %08x", a,b,c ) |
|
0
|
1448 #define CYG_REPORT_FUNCARG4X( a,b,c,d ) \ |
|
2
|
1449 CYG_REPORT_FUNCARG4( "%08x %08x %08x %08x", a,b,c,d ) |
|
0
|
1450 #define CYG_REPORT_FUNCARG5X( a,b,c,d,e ) \ |
|
2
|
1451 CYG_REPORT_FUNCARG5( "%08x %08x %08x %08x %08x", a,b,c,d,e ) |
|
0
|
1452 #define CYG_REPORT_FUNCARG6X( a,b,c,d,e,f ) \ |
|
2
|
1453 CYG_REPORT_FUNCARG6( "%08x %08x %08x %08x %08x %08x", \ |
|
0
|
1454 a,b,c,d,e,f ) |
|
|
1455 #define CYG_REPORT_FUNCARG7X( a,b,c,d,e,f,g ) \ |
|
2
|
1456 CYG_REPORT_FUNCARG7( "%08x %08x %08x %08x %08x %08x %08x", \ |
|
0
|
1457 a,b,c,d,e,f,g ) |
|
|
1458 #define CYG_REPORT_FUNCARG8X( a,b,c,d,e,f,g,h ) \ |
|
2
|
1459 CYG_REPORT_FUNCARG8( "%08x %08x %08x %08x %08x %08x %08x %08x", \ |
|
0
|
1460 a,b,c,d,e,f,g,h ) |
|
|
1461 |
|
|
1462 #define CYG_REPORT_FUNCARG1XV( a ) \ |
|
2
|
1463 CYG_REPORT_FUNCARG1( # a "=%08x ", a ) |
|
0
|
1464 #define CYG_REPORT_FUNCARG2XV( a,b ) \ |
|
2
|
1465 CYG_REPORT_FUNCARG2( \ |
|
0
|
1466 # a "=%08x " # b "=%08x " , a,b ) |
|
|
1467 #define CYG_REPORT_FUNCARG3XV( a,b,c ) \ |
|
2
|
1468 CYG_REPORT_FUNCARG3( \ |
|
0
|
1469 # a "=%08x " # b "=%08x " # c "=%08x " , a,b,c ) |
|
|
1470 #define CYG_REPORT_FUNCARG4XV( a,b,c,d ) \ |
|
2
|
1471 CYG_REPORT_FUNCARG4( \ |
|
0
|
1472 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1473 , a,b,c,d ) |
|
|
1474 #define CYG_REPORT_FUNCARG5XV( a,b,c,d,e ) \ |
|
2
|
1475 CYG_REPORT_FUNCARG5( \ |
|
0
|
1476 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1477 # e "=%08x " \ |
|
|
1478 , a,b,c,d,e ) |
|
|
1479 #define CYG_REPORT_FUNCARG6XV( a,b,c,d,e,f ) \ |
|
2
|
1480 CYG_REPORT_FUNCARG6( \ |
|
0
|
1481 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1482 # e "=%08x " # f "=%08x " \ |
|
|
1483 , a,b,c,d,e,f ) |
|
|
1484 #define CYG_REPORT_FUNCARG7XV( a,b,c,d,e,f,g ) \ |
|
2
|
1485 CYG_REPORT_FUNCARG7( \ |
|
0
|
1486 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1487 # e "=%08x " # f "=%08x " # g "=%08x " \ |
|
|
1488 , a,b,c,d,e,f,g ) |
|
|
1489 #define CYG_REPORT_FUNCARG8XV( a,b,c,d,e,f,g,h ) \ |
|
2
|
1490 CYG_REPORT_FUNCARG8( \ |
|
0
|
1491 # a "=%08x " # b "=%08x " # c "=%08x " # d "=%08x " \ |
|
|
1492 # e "=%08x " # f "=%08x " # g "=%08x " # h "=%08x " \ |
|
|
1493 , a,b,c,d,e,f,g,h ) |
|
|
1494 |
|
|
1495 // decimal versions |
|
|
1496 |
|
|
1497 |
|
|
1498 #define CYG_REPORT_FUNCARG1D( a ) \ |
|
2
|
1499 CYG_REPORT_FUNCARG1( "%d", a ) |
|
0
|
1500 #define CYG_REPORT_FUNCARG2D( a,b ) \ |
|
2
|
1501 CYG_REPORT_FUNCARG2( "%d %d", a,b ) |
|
0
|
1502 #define CYG_REPORT_FUNCARG3D( a,b,c ) \ |
|
2
|
1503 CYG_REPORT_FUNCARG3( "%d %d %d", a,b,c ) |
|
0
|
1504 #define CYG_REPORT_FUNCARG4D( a,b,c,d ) \ |
|
2
|
1505 CYG_REPORT_FUNCARG4( "%d %d %d %d", a,b,c,d ) |
|
0
|
1506 #define CYG_REPORT_FUNCARG5D( a,b,c,d,e ) \ |
|
2
|
1507 CYG_REPORT_FUNCARG5( "%d %d %d %d %d", a,b,c,d,e ) |
|
0
|
1508 #define CYG_REPORT_FUNCARG6D( a,b,c,d,e,f ) \ |
|
2
|
1509 CYG_REPORT_FUNCARG6( "%d %d %d %d %d %d", \ |
|
0
|
1510 a,b,c,d,e,f ) |
|
|
1511 #define CYG_REPORT_FUNCARG7D( a,b,c,d,e,f,g ) \ |
|
2
|
1512 CYG_REPORT_FUNCARG7( "%d %d %d %d %d %d %d", \ |
|
0
|
1513 a,b,c,d,e,f,g ) |
|
|
1514 #define CYG_REPORT_FUNCARG8D( a,b,c,d,e,f,g,h ) \ |
|
2
|
1515 CYG_REPORT_FUNCARG8( "%d %d %d %d %d %d %d %d", \ |
|
0
|
1516 a,b,c,d,e,f,g,h ) |
|
|
1517 |
|
|
1518 #define CYG_REPORT_FUNCARG1DV( a ) \ |
|
2
|
1519 CYG_REPORT_FUNCARG1( # a "=%d ", a ) |
|
0
|
1520 #define CYG_REPORT_FUNCARG2DV( a,b ) \ |
|
2
|
1521 CYG_REPORT_FUNCARG2( \ |
|
0
|
1522 # a "=%d " # b "=%d " , a,b ) |
|
|
1523 #define CYG_REPORT_FUNCARG3DV( a,b,c ) \ |
|
2
|
1524 CYG_REPORT_FUNCARG3( \ |
|
0
|
1525 # a "=%d " # b "=%d " # c "=%d " , a,b,c ) |
|
|
1526 #define CYG_REPORT_FUNCARG4DV( a,b,c,d ) \ |
|
2
|
1527 CYG_REPORT_FUNCARG4( \ |
|
0
|
1528 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1529 , a,b,c,d ) |
|
|
1530 #define CYG_REPORT_FUNCARG5DV( a,b,c,d,e ) \ |
|
2
|
1531 CYG_REPORT_FUNCARG5( \ |
|
0
|
1532 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1533 # e "=%d " \ |
|
|
1534 , a,b,c,d,e ) |
|
|
1535 #define CYG_REPORT_FUNCARG6DV( a,b,c,d,e,f ) \ |
|
2
|
1536 CYG_REPORT_FUNCARG6( \ |
|
0
|
1537 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1538 # e "=%d " # f "=%d " \ |
|
|
1539 , a,b,c,d,e,f ) |
|
|
1540 #define CYG_REPORT_FUNCARG7DV( a,b,c,d,e,f,g ) \ |
|
2
|
1541 CYG_REPORT_FUNCARG7( \ |
|
0
|
1542 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1543 # e "=%d " # f "=%d " # g "=%d " \ |
|
|
1544 , a,b,c,d,e,f,g ) |
|
|
1545 #define CYG_REPORT_FUNCARG8DV( a,b,c,d,e,f,g,h ) \ |
|
2
|
1546 CYG_REPORT_FUNCARG8( \ |
|
0
|
1547 # a "=%d " # b "=%d " # c "=%d " # d "=%d " \ |
|
|
1548 # e "=%d " # f "=%d " # g "=%d " # h "=%d " \ |
|
|
1549 , a,b,c,d,e,f,g,h ) |
|
|
1550 |
|
|
1551 // short hex versions |
|
|
1552 |
|
|
1553 #define CYG_REPORT_FUNCARG1Y( a ) \ |
|
2
|
1554 CYG_REPORT_FUNCARG1( "%x", a ) |
|
0
|
1555 #define CYG_REPORT_FUNCARG2Y( a,b ) \ |
|
2
|
1556 CYG_REPORT_FUNCARG2( "%x %x", a,b ) |
|
0
|
1557 #define CYG_REPORT_FUNCARG3Y( a,b,c ) \ |
|
2
|
1558 CYG_REPORT_FUNCARG3( "%x %x %x", a,b,c ) |
|
0
|
1559 #define CYG_REPORT_FUNCARG4Y( a,b,c,d ) \ |
|
2
|
1560 CYG_REPORT_FUNCARG4( "%x %x %x %x", a,b,c,d ) |
|
0
|
1561 #define CYG_REPORT_FUNCARG5Y( a,b,c,d,e ) \ |
|
2
|
1562 CYG_REPORT_FUNCARG5( "%x %x %x %x %x", a,b,c,d,e ) |
|
0
|
1563 #define CYG_REPORT_FUNCARG6Y( a,b,c,d,e,f ) \ |
|
2
|
1564 CYG_REPORT_FUNCARG6( "%x %x %x %x %x %x", \ |
|
0
|
1565 a,b,c,d,e,f ) |
|
|
1566 #define CYG_REPORT_FUNCARG7Y( a,b,c,d,e,f,g ) \ |
|
2
|
1567 CYG_REPORT_FUNCARG7( "%x %x %x %x %x %x %x", \ |
|
0
|
1568 a,b,c,d,e,f,g ) |
|
|
1569 #define CYG_REPORT_FUNCARG8Y( a,b,c,d,e,f,g,h ) \ |
|
2
|
1570 CYG_REPORT_FUNCARG8( "%x %x %x %x %x %x %x %x", \ |
|
0
|
1571 a,b,c,d,e,f,g,h ) |
|
|
1572 |
|
|
1573 #define CYG_REPORT_FUNCARG1YV( a ) \ |
|
2
|
1574 CYG_REPORT_FUNCARG1( # a "=%x ", a ) |
|
0
|
1575 #define CYG_REPORT_FUNCARG2YV( a,b ) \ |
|
2
|
1576 CYG_REPORT_FUNCARG2( \ |
|
0
|
1577 # a "=%x " # b "=%x " , a,b ) |
|
|
1578 #define CYG_REPORT_FUNCARG3YV( a,b,c ) \ |
|
2
|
1579 CYG_REPORT_FUNCARG3( \ |
|
0
|
1580 # a "=%x " # b "=%x " # c "=%x " , a,b,c ) |
|
|
1581 #define CYG_REPORT_FUNCARG4YV( a,b,c,d ) \ |
|
2
|
1582 CYG_REPORT_FUNCARG4( \ |
|
0
|
1583 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1584 , a,b,c,d ) |
|
|
1585 #define CYG_REPORT_FUNCARG5YV( a,b,c,d,e ) \ |
|
2
|
1586 CYG_REPORT_FUNCARG5( \ |
|
0
|
1587 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1588 # e "=%x " \ |
|
|
1589 , a,b,c,d,e ) |
|
|
1590 #define CYG_REPORT_FUNCARG6YV( a,b,c,d,e,f ) \ |
|
2
|
1591 CYG_REPORT_FUNCARG6( \ |
|
0
|
1592 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1593 # e "=%x " # f "=%x " \ |
|
|
1594 , a,b,c,d,e,f ) |
|
|
1595 #define CYG_REPORT_FUNCARG7YV( a,b,c,d,e,f,g ) \ |
|
2
|
1596 CYG_REPORT_FUNCARG7( \ |
|
0
|
1597 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1598 # e "=%x " # f "=%x " # g "=%x " \ |
|
|
1599 , a,b,c,d,e,f,g ) |
|
|
1600 #define CYG_REPORT_FUNCARG8YV( a,b,c,d,e,f,g,h ) \ |
|
2
|
1601 CYG_REPORT_FUNCARG8( \ |
|
0
|
1602 # a "=%x " # b "=%x " # c "=%x " # d "=%x " \ |
|
|
1603 # e "=%x " # f "=%x " # g "=%x " # h "=%x " \ |
|
|
1604 , a,b,c,d,e,f,g,h ) |
|
|
1605 |
|
|
1606 |
|
|
1607 #endif // CYGONCE_INFRA_CYG_TRAC_H multiple inclusion protection |
|
|
1608 // EOF cyg_trac.h |