| 365 | } |
| 366 | |
| 367 | String DbgSymRequest::SearchForImage(const String& filePath, uint32 fileTime, int size) |
| 368 | { |
| 369 | if ((gDebugManager->mSymSrvOptions.mFlags & BfSymSrvFlag_Disable) != 0) |
| 370 | return ""; |
| 371 | |
| 372 | if (FileExists(filePath)) |
| 373 | { |
| 374 | if (CheckPEFile(filePath, fileTime, size)) |
| 375 | return filePath; |
| 376 | } |
| 377 | |
| 378 | /*if (filePath.Contains("IDEHelper")) |
| 379 | Sleep(3000);*/ |
| 380 | |
| 381 | if (mOptions.mCacheDir.IsEmpty()) |
| 382 | { |
| 383 | mFailed = true; |
| 384 | return ""; |
| 385 | } |
| 386 | |
| 387 | NetResult* chainNetResult = NULL; |
| 388 | |
| 389 | String fileName = GetFileName(filePath); |
| 390 | String imageStoreDir = "/"; |
| 391 | imageStoreDir += fileName; |
| 392 | imageStoreDir += "/"; |
| 393 | imageStoreDir += StrFormat("%08X%x/", fileTime, size); |
| 394 | |
| 395 | SetAndRestoreValue<bool> prevSearchingSymSrv(mSearchingSymSrv, true); |
| 396 | |
| 397 | String cacheDir = mOptions.mCacheDir; |
| 398 | cacheDir += imageStoreDir; |
| 399 | |
| 400 | /*for (int i = 0; i < 8; i++) |
| 401 | { |
| 402 | mDbgSymSrv->mDebugger->OutputMessage(StrFormat("Image Sleep %d\n", i)); |
| 403 | if (mCancelling) |
| 404 | break; |
| 405 | Sleep(1000); |
| 406 | }*/ |
| 407 | |
| 408 | String cacheFilePath = cacheDir + "/" + GetFileName(filePath); |
| 409 | |
| 410 | // Check cache |
| 411 | if (CheckPEFile(cacheFilePath, fileTime, size)) |
| 412 | { |
| 413 | return cacheFilePath; |
| 414 | } |
| 415 | |
| 416 | for (auto& symServAddr : mOptions.mSymbolServers) |
| 417 | { |
| 418 | if (mCancelling) |
| 419 | break; |
| 420 | |
| 421 | int colonPos = symServAddr.IndexOf(':'); |
| 422 | if (colonPos > 1) |
| 423 | { |
| 424 | // HTTP |
no test coverage detected