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