Changeset 41418 in vbox for trunk/src/VBox/GuestHost/OpenGL/util
- Timestamp:
- May 23, 2012 2:44:06 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 78140
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/util/error.c
r41376 r41418 29 29 30 30 #if defined(WINDOWS) 31 # define CR_DEBUG_ TO_CONSOLE_ENABLE31 # define CR_DEBUG_CONSOLE_ENABLE 32 32 #endif 33 33 34 34 #if defined(WINDOWS) && defined(IN_GUEST) 35 # ifndef CR_DEBUG_ TO_BACKDOOR_ENABLE36 # error "CR_DEBUG_ TO_BACKDOOR_ENABLE is expected!"35 # ifndef CR_DEBUG_BACKDOOR_ENABLE 36 # error "CR_DEBUG_BACKDOOR_ENABLE is expected!" 37 37 # endif 38 38 #else 39 # ifdef CR_DEBUG_ TO_BACKDOOR_ENABLE40 # error "CR_DEBUG_ TO_BACKDOOR_ENABLE is NOT expected!"39 # ifdef CR_DEBUG_BACKDOOR_ENABLE 40 # error "CR_DEBUG_BACKDOOR_ENABLE is NOT expected!" 41 41 # endif 42 42 #endif 43 43 44 44 45 #ifdef CR_DEBUG_ TO_BACKDOOR_ENABLE45 #ifdef CR_DEBUG_BACKDOOR_ENABLE 46 46 # include <VBoxDispMpLogger.h> 47 47 # include <iprt/err.h> … … 301 301 } 302 302 303 static DECLCALLBACK(void) crDebugBackdoorRt(char* pcszStr) 304 { 305 RTLogBackdoorPrintf("%s", pcszStr); 306 } 307 308 static DECLCALLBACK(void) crDebugBackdoorDispMp(char* pcszStr) 309 { 310 VBoxDispMpLoggerLog(pcszStr); 311 } 312 303 313 DECLEXPORT(void) crDebug(const char *format, ... ) 304 314 { … … 312 322 static int first_time = 1; 313 323 static int silent = 0; 314 #ifdef CR_DEBUG_TO_BACKDOOR_ENABLE 315 static int logBackdoor = 0; 324 #ifdef CR_DEBUG_BACKDOOR_ENABLE 325 typedef DECLCALLBACK(void) FNCRGEDUGBACKDOOR(char* pcszStr); 326 typedef FNCRGEDUGBACKDOOR *PFNCRGEDUGBACKDOOR; 327 static PFNCRGEDUGBACKDOOR pfnLogBackdoor = NULL; 316 328 #endif 317 329 … … 321 333 const char *fnamePrefix = crGetenv( "CR_DEBUG_FILE_PREFIX" ); 322 334 char str[2048]; 323 #ifdef CR_DEBUG_ TO_CONSOLE_ENABLE335 #ifdef CR_DEBUG_CONSOLE_ENABLE 324 336 int logToConsole = 0; 325 337 #endif 326 #ifdef CR_DEBUG_ TO_BACKDOOR_ENABLE327 if (crGetenv( "CR_DEBUG_ TO_BACKDOOR" ))338 #ifdef CR_DEBUG_BACKDOOR_ENABLE 339 if (crGetenv( "CR_DEBUG_BACKDOOR" )) 328 340 { 329 341 int rc = VBoxDispMpLoggerInit(); 330 342 if (RT_SUCCESS(rc)) 331 logBackdoor = 1; 343 pfnLogBackdoor = crDebugBackdoorDispMp; 344 else 345 pfnLogBackdoor = crDebugBackdoorRt; 332 346 } 333 347 #endif … … 370 384 else 371 385 { 372 #ifdef CR_DEBUG_ TO_CONSOLE_ENABLE373 if (crGetenv( "CR_DEBUG_ TO_CONSOLE" ))386 #ifdef CR_DEBUG_CONSOLE_ENABLE 387 if (crGetenv( "CR_DEBUG_CONSOLE" )) 374 388 { 375 389 crRedirectIOToConsole(); … … 385 399 */ 386 400 if (!fname && !crGetenv("CR_DEBUG") 387 #ifdef CR_DEBUG_ TO_CONSOLE_ENABLE401 #ifdef CR_DEBUG_CONSOLE_ENABLE 388 402 && !logToConsole 389 403 #endif 390 #ifdef CR_DEBUG_ TO_BACKDOOR_ENABLE391 && ! logBackdoor404 #ifdef CR_DEBUG_BACKDOOR_ENABLE 405 && !pfnLogBackdoor 392 406 #endif 393 407 ) … … 442 456 va_start( args, format ); 443 457 vsprintf( txt + offset, format, args ); 444 #ifdef CR_DEBUG_ TO_BACKDOOR_ENABLE445 if ( logBackdoor)446 { 447 VBoxDispMpLoggerLog(txt);458 #ifdef CR_DEBUG_BACKDOOR_ENABLE 459 if (pfnLogBackdoor) 460 { 461 pfnLogBackdoor(txt); 448 462 } 449 463 #endif
Note:
See TracChangeset
for help on using the changeset viewer.