Changeset 52351 in vbox for trunk/src/VBox/GuestHost/OpenGL
- Timestamp:
- Aug 11, 2014 6:32:17 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95479
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/VBox-4.3 merged: 95477
- Property svn:mergeinfo changed
-
trunk/src/VBox
- Property svn:mergeinfo changed
/branches/VBox-4.3/src/VBox merged: 95477
- Property svn:mergeinfo changed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_error.h
r50099 r52351 40 40 41 41 DECLEXPORT(void) crDebug(const char *format, ... ) PRINTF; 42 DECLEXPORT(void) crDbgCmdPrint(const char *description1, const char *description2, const char *cmd, ...); 43 DECLEXPORT(void) crDbgCmdSymLoadPrint(const char *modName, const void*pvAddress); 42 44 #if defined(DEBUG_misha) && defined(RT_OS_WINDOWS) 43 45 typedef void FNCRDEBUG(const char *format, ... ) PRINTF; -
trunk/src/VBox/GuestHost/OpenGL/util/error.c
r50095 r52351 32 32 #if defined(WINDOWS) 33 33 # define CR_DEBUG_CONSOLE_ENABLE 34 35 # include "Shlwapi.h" 34 36 #endif 35 37 … … 314 316 315 317 316 #if defined( DEBUG) && defined(WINDOWS) /* && (!defined(DEBUG_misha) || !defined(IN_GUEST) ) */318 #if defined(WINDOWS) /* && (!defined(DEBUG_misha) || !defined(IN_GUEST) ) */ 317 319 # define CR_DEBUG_DBGPRINT_ENABLE 318 320 #endif … … 324 326 OutputDebugString("\n"); 325 327 } 328 329 static void crDebugDbgPrintF(const char * szString, ...) 330 { 331 char szBuffer[4096] = {0}; 332 va_list pArgList; 333 va_start(pArgList, szString); 334 vsprintf( szBuffer, szString, pArgList ); 335 va_end(pArgList); 336 337 OutputDebugStringA(szBuffer); 338 } 339 340 static void crDebugDmlPrint(const char* pszDesc, const char* pszCmd) 341 { 342 crDebugDbgPrintF("<?dml?><exec cmd=\"%s\">%s</exec>, ( %s )\n", pszCmd, pszDesc, pszCmd); 343 } 344 345 346 DECLEXPORT(void) crDbgCmdPrint(const char *description1, const char *description2, const char *cmd, ...) 347 { 348 va_list args; 349 char aTxt[8092]; 350 char aCmd[8092]; 351 352 sprintf( aTxt, "%s%s", description1, description2 ); 353 354 va_start( args, cmd ); 355 356 vsprintf( aCmd, cmd, args ); 357 358 va_end( args ); 359 360 crDebugDmlPrint(aTxt, aCmd); 361 362 crDebug("%s: %s", aTxt, aCmd); 363 } 364 365 DECLEXPORT(void) crDbgCmdSymLoadPrint(const char *modName, const void*pvAddress) 366 { 367 static bool fEnable = false; 368 static bool fInitialized = false; 369 const char * pszName; 370 static const char * pszModulePath = NULL; 371 372 if (!fInitialized) 373 { 374 #ifndef DEBUG_misha 375 if (crGetenv( "CR_DEBUG_MODULE_ENABLE" )) 376 #endif 377 { 378 fEnable = true; 379 } 380 381 fInitialized = true; 382 } 383 384 if (!fEnable) 385 return; 386 387 pszName = PathFindFileNameA(modName); 388 389 if (!pszModulePath) 390 pszModulePath = crGetenv("CR_DEBUG_MODULE_PATH"); 391 if (!pszModulePath) 392 pszModulePath = "c:\\Users\\senmk\\Downloads\\Data\\Data"; 393 394 crDbgCmdPrint("load modules for ", pszName, ".reload /i /f %s\\%s=%#p", pszModulePath, pszName, pvAddress); 395 } 396 326 397 #endif 327 398 … … 514 585 va_end( args ); 515 586 } 587 588 BOOL WINAPI DllMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved) 589 { 590 (void) lpvReserved; 591 592 switch (fdwReason) 593 { 594 case DLL_PROCESS_ATTACH: 595 { 596 char aName[MAX_PATH]; 597 GetModuleFileNameA(hDLLInst, aName, RT_ELEMENTS(aName)); 598 crDbgCmdSymLoadPrint(aName, hDLLInst); 599 break; 600 } 601 default: 602 break; 603 } 604 605 return TRUE; 606 }
Note:
See TracChangeset
for help on using the changeset viewer.