Changeset 51673 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jun 19, 2014 6:49:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/load.c
r51194 r51673 1134 1134 #ifdef VDBG_VEHANDLER 1135 1135 # include <dbghelp.h> 1136 # include <cr_string.h> 1136 1137 static PVOID g_VBoxVehHandler = NULL; 1137 1138 static DWORD g_VBoxVehEnable = 0; … … 1144 1145 #define VBOXVEH_F_EXIT 0x00000004 1145 1146 1146 static DWORD g_VBoxVehFlags = 0 1147 #ifdef DEBUG_misha 1148 | VBOXVEH_F_BREAK 1149 #else 1150 | VBOXVEH_F_DUMP 1151 #endif 1152 ; 1147 static DWORD g_VBoxVehFlags = 0; 1153 1148 1154 1149 typedef BOOL WINAPI FNVBOXDBG_MINIDUMPWRITEDUMP(HANDLE hProcess, … … 1163 1158 static HMODULE g_hVBoxMdDbgHelp = NULL; 1164 1159 static PFNVBOXDBG_MINIDUMPWRITEDUMP g_pfnVBoxMdMiniDumpWriteDump = NULL; 1165 static uint32_t g_cVBoxMdFilePrefixLen = 0;1160 static size_t g_cVBoxMdFilePrefixLen = 0; 1166 1161 static WCHAR g_aszwVBoxMdFilePrefix[MAX_PATH]; 1167 1162 static WCHAR g_aszwVBoxMdDumpCount = 0; … … 1191 1186 1192 1187 1193 #define VBOXMD_DUMP_DIR_PREFIX_DEFAULT L"C:\\dumps\\vboxdmp" 1188 #define VBOXMD_DUMP_DIR_DEFAULT "C:\\dumps" 1189 #define VBOXMD_DUMP_NAME_PREFIX_W L"VBoxDmp_" 1194 1190 1195 1191 static HMODULE loadSystemDll(const char *pszName) … … 1229 1225 if (!g_pfnVBoxMdMiniDumpWriteDump) 1230 1226 return GetLastError(); 1231 }1232 1233 /* @todo: this is a tmp stuff until we get that info from the settings properly */1234 if (!g_cVBoxMdFilePrefixLen)1235 {1236 g_cVBoxMdFilePrefixLen = sizeof (VBOXMD_DUMP_DIR_PREFIX_DEFAULT)/sizeof (g_aszwVBoxMdFilePrefix[0]) - 1 /* <- don't include nul terminator */;1237 memcpy(g_aszwVBoxMdFilePrefix, VBOXMD_DUMP_DIR_PREFIX_DEFAULT, sizeof (VBOXMD_DUMP_DIR_PREFIX_DEFAULT));1238 }1239 1240 1241 if (RT_ELEMENTS(aszwMdFileName) <= g_cVBoxMdFilePrefixLen)1242 {1243 return ERROR_INVALID_STATE;1244 1227 } 1245 1228 … … 1341 1324 { 1342 1325 CRNetServer ns; 1326 const char * env; 1343 1327 1344 1328 #ifdef CHROMIUM_THREADSAFE … … 1349 1333 1350 1334 #ifdef VDBG_VEHANDLER 1351 g_VBoxVehEnable = !!crGetenv("CR_DBG_VEH_ENABLE"); 1335 env = crGetenv("CR_DBG_VEH_ENABLE"); 1336 g_VBoxVehEnable = crStrParseI32(env, 1352 1337 # ifdef DEBUG_misha 1353 g_VBoxVehEnable = 1; 1338 1 1339 # else 1340 0 1354 1341 # endif 1342 ); 1343 1355 1344 if (g_VBoxVehEnable) 1345 { 1346 char procName[1024]; 1347 size_t cProcName; 1348 size_t cChars; 1349 1350 env = crGetenv("CR_DBG_VEH_FLAGS"); 1351 g_VBoxVehFlags = crStrParseI32(env, 1352 0 1353 # ifdef DEBUG_misha 1354 | VBOXVEH_F_BREAK 1355 # else 1356 | VBOXVEH_F_DUMP 1357 # endif 1358 ); 1359 1360 env = crGetenv("CR_DBG_VEH_DUMP_DIR"); 1361 if (!env) 1362 env = VBOXMD_DUMP_DIR_DEFAULT; 1363 1364 g_cVBoxMdFilePrefixLen = strlen(env); 1365 1366 if (RT_ELEMENTS(g_aszwVBoxMdFilePrefix) <= g_cVBoxMdFilePrefixLen + 26 + (sizeof (VBOXMD_DUMP_NAME_PREFIX_W) - sizeof (WCHAR)) / sizeof (WCHAR)) 1367 { 1368 g_cVBoxMdFilePrefixLen = 0; 1369 env = ""; 1370 } 1371 1372 mbstowcs_s(&cChars, g_aszwVBoxMdFilePrefix, g_cVBoxMdFilePrefixLen + 1, env, _TRUNCATE); 1373 1374 Assert(cChars == g_cVBoxMdFilePrefixLen + 1); 1375 1376 g_cVBoxMdFilePrefixLen = cChars - 1; 1377 1378 if (g_cVBoxMdFilePrefixLen && g_aszwVBoxMdFilePrefix[g_cVBoxMdFilePrefixLen - 1] != L'\\') 1379 g_aszwVBoxMdFilePrefix[g_cVBoxMdFilePrefixLen++] = L'\\'; 1380 1381 memcpy(g_aszwVBoxMdFilePrefix + g_cVBoxMdFilePrefixLen, VBOXMD_DUMP_NAME_PREFIX_W, sizeof (VBOXMD_DUMP_NAME_PREFIX_W) - sizeof (WCHAR)); 1382 g_cVBoxMdFilePrefixLen += (sizeof (VBOXMD_DUMP_NAME_PREFIX_W) - sizeof (WCHAR)) / sizeof (WCHAR); 1383 1384 crGetProcName(procName, RT_ELEMENTS(procName)); 1385 cProcName = strlen(procName); 1386 1387 if (RT_ELEMENTS(g_aszwVBoxMdFilePrefix) > g_cVBoxMdFilePrefixLen + cProcName + 1 + 26) 1388 { 1389 mbstowcs_s(&cChars, g_aszwVBoxMdFilePrefix + g_cVBoxMdFilePrefixLen, cProcName + 1, procName, _TRUNCATE); 1390 Assert(cChars == cProcName + 1); 1391 g_cVBoxMdFilePrefixLen += cChars - 1; 1392 g_aszwVBoxMdFilePrefix[g_cVBoxMdFilePrefixLen++] = L'_'; 1393 } 1394 1395 /* sanity */ 1396 g_aszwVBoxMdFilePrefix[g_cVBoxMdFilePrefixLen] = L'\0'; 1397 1398 env = crGetenv("CR_DBG_VEH_DUMP_TYPE"); 1399 1400 g_enmVBoxMdDumpType = crStrParseI32(env, 1401 MiniDumpNormal 1402 | MiniDumpWithDataSegs 1403 | MiniDumpWithFullMemory 1404 | MiniDumpWithHandleData 1405 //// | MiniDumpFilterMemory 1406 //// | MiniDumpScanMemory 1407 // | MiniDumpWithUnloadedModules 1408 //// | MiniDumpWithIndirectlyReferencedMemory 1409 //// | MiniDumpFilterModulePaths 1410 // | MiniDumpWithProcessThreadData 1411 // | MiniDumpWithPrivateReadWriteMemory 1412 //// | MiniDumpWithoutOptionalData 1413 // | MiniDumpWithFullMemoryInfo 1414 // | MiniDumpWithThreadInfo 1415 // | MiniDumpWithCodeSegs 1416 // | MiniDumpWithFullAuxiliaryState 1417 // | MiniDumpWithPrivateWriteCopyMemory 1418 // | MiniDumpIgnoreInaccessibleMemory 1419 // | MiniDumpWithTokenInformation 1420 //// | MiniDumpWithModuleHeaders 1421 //// | MiniDumpFilterTriage 1422 ); 1423 1356 1424 vboxVDbgVEHandlerRegister(); 1425 } 1357 1426 #endif 1358 1427
Note:
See TracChangeset
for help on using the changeset viewer.