VirtualBox

Changeset 52351 in vbox for trunk/src/VBox/GuestHost/OpenGL


Ignore:
Timestamp:
Aug 11, 2014 6:32:17 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95479
Message:

crOpenGL: dump module load

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/VBox

  • trunk/src/VBox/GuestHost/OpenGL/include/cr_error.h

    r50099 r52351  
    4040
    4141DECLEXPORT(void) crDebug(const char *format, ... ) PRINTF;
     42DECLEXPORT(void) crDbgCmdPrint(const char *description1, const char *description2, const char *cmd, ...);
     43DECLEXPORT(void) crDbgCmdSymLoadPrint(const char *modName, const void*pvAddress);
    4244#if defined(DEBUG_misha) && defined(RT_OS_WINDOWS)
    4345typedef void FNCRDEBUG(const char *format, ... ) PRINTF;
  • trunk/src/VBox/GuestHost/OpenGL/util/error.c

    r50095 r52351  
    3232#if defined(WINDOWS)
    3333# define CR_DEBUG_CONSOLE_ENABLE
     34
     35# include "Shlwapi.h"
    3436#endif
    3537
     
    314316
    315317
    316 #if defined(DEBUG) && defined(WINDOWS) /* && (!defined(DEBUG_misha) || !defined(IN_GUEST) ) */
     318#if defined(WINDOWS) /* && (!defined(DEBUG_misha) || !defined(IN_GUEST) ) */
    317319# define CR_DEBUG_DBGPRINT_ENABLE
    318320#endif
     
    324326    OutputDebugString("\n");
    325327}
     328
     329static 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
     340static 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
     346DECLEXPORT(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
     365DECLEXPORT(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
    326397#endif
    327398
     
    514585    va_end( args );
    515586}
     587
     588BOOL 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.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette