diff --git a/eng/Versions.props b/eng/Versions.props index 886f4afbc8..6efb006a4b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -22,7 +22,7 @@ 4.3.0 1.0.55801 - 1.1.46104 + 1.1.57004 1.7.0 2.0.44 0.3.0-alpha.19602.1 diff --git a/src/SOS/SOS.Hosting/SOSHost.cs b/src/SOS/SOS.Hosting/SOSHost.cs index 909f2b1397..a7d0d94919 100644 --- a/src/SOS/SOS.Hosting/SOSHost.cs +++ b/src/SOS/SOS.Hosting/SOSHost.cs @@ -61,6 +61,7 @@ private delegate bool InitializeSymbolStoreDelegate( bool symweb, string tempDirectory, string symbolServerPath, + int timeoutInMintues, string symbolCachePath, string symbolDirectoryPath, string windowsSymbolPath); diff --git a/src/SOS/SOS.NETCore/SymbolReader.cs b/src/SOS/SOS.NETCore/SymbolReader.cs index ef3c831710..0d5ced4be8 100644 --- a/src/SOS/SOS.NETCore/SymbolReader.cs +++ b/src/SOS/SOS.NETCore/SymbolReader.cs @@ -172,15 +172,25 @@ public override void Write(byte[] buffer, int offset, int count) /// symbol servers. This API can be called more than once to add more servers to search. /// /// if true, enable logging diagnostics to console - /// if true, use the public microsoft server + /// if true, use the public Microsoft server /// if true, use symweb internal server and protocol (file.ptr) /// temp directory unique to this instance of SOS /// symbol server url (optional) + /// symbol server timeout in minutes (optional) /// symbol cache directory path (optional) /// symbol directory path to search (optional) /// windows symbol path (optional) /// if false, failure - public static bool InitializeSymbolStore(bool logging, bool msdl, bool symweb, string tempDirectory, string symbolServerPath, string symbolCachePath, string symbolDirectoryPath, string windowsSymbolPath) + public static bool InitializeSymbolStore( + bool logging, + bool msdl, + bool symweb, + string tempDirectory, + string symbolServerPath, + int timeoutInMinutes, + string symbolCachePath, + string symbolDirectoryPath, + string windowsSymbolPath) { if (logging) { // Uses the standard console to do the logging instead of sending it to the hosting debugger console @@ -209,7 +219,7 @@ public static bool InitializeSymbolStore(bool logging, bool msdl, bool symweb, s } } // Build the symbol stores using the other parameters - if (!GetServerSymbolStore(ref store, msdl, symweb, symbolServerPath, symbolCachePath, symbolDirectoryPath)) { + if (!GetServerSymbolStore(ref store, msdl, symweb, symbolServerPath, timeoutInMinutes, symbolCachePath, symbolDirectoryPath)) { return false; } } @@ -1075,7 +1085,7 @@ private static bool ParseSymbolPath(ref SymbolStore store, string symbolPath) } // Add the symbol stores to the chain - if (!GetServerSymbolStore(ref store, msdl, false, symbolServerPath, symbolCachePath, symbolDirectoryPath)) + if (!GetServerSymbolStore(ref store, msdl, false, symbolServerPath, 0, symbolCachePath, symbolDirectoryPath)) { return false; } @@ -1085,7 +1095,7 @@ private static bool ParseSymbolPath(ref SymbolStore store, string symbolPath) return true; } - private static bool GetServerSymbolStore(ref SymbolStore store, bool msdl, bool symweb, string symbolServerPath, string symbolCachePath, string symbolDirectoryPath) + private static bool GetServerSymbolStore(ref SymbolStore store, bool msdl, bool symweb, string symbolServerPath, int timeoutInMinutes, string symbolCachePath, string symbolDirectoryPath) { bool internalServer = false; @@ -1125,15 +1135,21 @@ private static bool GetServerSymbolStore(ref SymbolStore store, bool msdl, bool { if (!IsDuplicateSymbolStore(store, (httpSymbolStore) => uri.Equals(httpSymbolStore.Uri))) { - // Create symbol server store + // Create http symbol server store + HttpSymbolStore httpSymbolStore; if (internalServer) { - store = new SymwebHttpSymbolStore(s_tracer, store, uri); + httpSymbolStore = new SymwebHttpSymbolStore(s_tracer, store, uri); } else { - store = new HttpSymbolStore(s_tracer, store, uri); + httpSymbolStore = new HttpSymbolStore(s_tracer, store, uri); } + if (timeoutInMinutes != 0) + { + httpSymbolStore.Timeout = TimeSpan.FromMinutes(timeoutInMinutes); + } + store = httpSymbolStore; } } } diff --git a/src/SOS/Strike/hostcoreclr.cpp b/src/SOS/Strike/hostcoreclr.cpp index 67771d077b..36f68715c2 100644 --- a/src/SOS/Strike/hostcoreclr.cpp +++ b/src/SOS/Strike/hostcoreclr.cpp @@ -766,13 +766,21 @@ static int ReadMemoryForSymbols(ULONG64 address, uint8_t *buffer, int cb) /**********************************************************************\ * Setup and initialize the symbol server support. \**********************************************************************/ -HRESULT InitializeSymbolStore(BOOL logging, BOOL msdl, BOOL symweb, const char* symbolServer, const char* cacheDirectory, const char* searchDirectory, const char* windowsSymbolPath) +HRESULT InitializeSymbolStore( + BOOL logging, + BOOL msdl, + BOOL symweb, + const char* symbolServer, + int timeoutInMinutes, + const char* cacheDirectory, + const char* searchDirectory, + const char* windowsSymbolPath) { HRESULT Status = S_OK; IfFailRet(InitializeHosting()); _ASSERTE(g_SOSNetCoreCallbacks.InitializeSymbolStoreDelegate != nullptr); - if (!g_SOSNetCoreCallbacks.InitializeSymbolStoreDelegate(logging, msdl, symweb, GetTempDirectory(), symbolServer, cacheDirectory, searchDirectory, windowsSymbolPath)) + if (!g_SOSNetCoreCallbacks.InitializeSymbolStoreDelegate(logging, msdl, symweb, GetTempDirectory(), symbolServer, timeoutInMinutes, cacheDirectory, searchDirectory, windowsSymbolPath)) { ExtErr("Error initializing symbol server support\n"); return E_FAIL; @@ -815,7 +823,7 @@ void InitializeSymbolStoreFromSymPath() { if (strlen(symbolPath) > 0) { - if (!g_SOSNetCoreCallbacks.InitializeSymbolStoreDelegate(false, false, false, GetTempDirectory(), nullptr, nullptr, nullptr, symbolPath)) + if (!g_SOSNetCoreCallbacks.InitializeSymbolStoreDelegate(false, false, false, GetTempDirectory(), nullptr, 0, nullptr, nullptr, symbolPath)) { ExtErr("Windows symbol path parsing FAILED\n"); return; diff --git a/src/SOS/Strike/hostcoreclr.h b/src/SOS/Strike/hostcoreclr.h index 5f7f06edea..390dccd257 100644 --- a/src/SOS/Strike/hostcoreclr.h +++ b/src/SOS/Strike/hostcoreclr.h @@ -16,7 +16,7 @@ typedef void (*WriteLineDelegate)(const char*); typedef int (*ReadMemoryDelegate)(ULONG64, uint8_t*, int); typedef void (*SymbolFileCallbackDelegate)(void*, const char* moduleFileName, const char* symbolFilePath); -typedef BOOL (*InitializeSymbolStoreDelegate)(BOOL, BOOL, BOOL, const char*, const char*, const char*, const char*, const char*); +typedef BOOL (*InitializeSymbolStoreDelegate)(BOOL, BOOL, BOOL, const char*, const char*, int, const char*, const char*, const char*); typedef void (*DisplaySymbolStoreDelegate)(WriteLineDelegate); typedef void (*DisableSymbolStoreDelegate)(); typedef void (*LoadNativeSymbolsDelegate)(SymbolFileCallbackDelegate, void*, const char*, ULONG64, int, ReadMemoryDelegate); @@ -71,10 +71,21 @@ extern LPCSTR GetDacFilePath(); extern LPCSTR GetDbiFilePath(); extern BOOL IsHostingInitialized(); extern HRESULT InitializeHosting(); -extern HRESULT InitializeSymbolStore(BOOL logging, BOOL msdl, BOOL symweb, const char* symbolServer, const char* cacheDirectory, const char* searchDirectory, const char* windowsSymbolPath); + +extern HRESULT InitializeSymbolStore( + BOOL logging, + BOOL msdl, + BOOL symweb, + const char* symbolServer, + int timeoutInMinutes, + const char* cacheDirectory, + const char* searchDirectory, + const char* windowsSymbolPath); + #ifndef FEATURE_PAL extern void InitializeSymbolStoreFromSymPath(); #endif + extern HRESULT LoadNativeSymbols(bool runtimeOnly = false); extern void DisplaySymbolStore(); extern void DisableSymbolStore(); diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index cffdc56c04..9c1607d300 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -15906,6 +15906,7 @@ DECLARE_API(SetSymbolServer) StringHolder symbolCache; StringHolder searchDirectory; StringHolder windowsSymbolPath; + size_t timeoutInMinutes = 0; BOOL disable = FALSE; BOOL loadNative = FALSE; BOOL msdl = FALSE; @@ -15916,6 +15917,7 @@ DECLARE_API(SetSymbolServer) {"-disable", &disable, COBOOL, FALSE}, {"-cache", &symbolCache.data, COSTRING, TRUE}, {"-directory", &searchDirectory.data, COSTRING, TRUE}, + {"-timeout", &timeoutInMinutes, COSIZE_T, TRUE}, {"-ms", &msdl, COBOOL, FALSE}, {"-log", &logging, COBOOL, FALSE}, {"-loadsymbols", &loadNative, COBOOL, FALSE}, @@ -15954,7 +15956,7 @@ DECLARE_API(SetSymbolServer) if (msdl || symweb || symbolServer.data != nullptr || symbolCache.data != nullptr || searchDirectory.data != nullptr || windowsSymbolPath.data != nullptr) { - Status = InitializeSymbolStore(logging, msdl, symweb, symbolServer.data, symbolCache.data, searchDirectory.data, windowsSymbolPath.data); + Status = InitializeSymbolStore(logging, msdl, symweb, symbolServer.data, (int)timeoutInMinutes, symbolCache.data, searchDirectory.data, windowsSymbolPath.data); if (FAILED(Status)) { return Status; diff --git a/src/Tools/dotnet-dump/Analyzer.cs b/src/Tools/dotnet-dump/Analyzer.cs index 28209858d8..5e1637eef5 100644 --- a/src/Tools/dotnet-dump/Analyzer.cs +++ b/src/Tools/dotnet-dump/Analyzer.cs @@ -71,7 +71,16 @@ public async Task Analyze(FileInfo dump_path, string[] command) AddServices(target); // Automatically enable symbol server support - SymbolReader.InitializeSymbolStore(logging: false, msdl: true, symweb: false, tempDirectory: null, symbolServerPath: null, symbolCachePath: null, symbolDirectoryPath: null, windowsSymbolPath: null); + SymbolReader.InitializeSymbolStore( + logging: false, + msdl: true, + symweb: false, + tempDirectory: null, + symbolServerPath: null, + timeoutInMinutes: 0, + symbolCachePath: null, + symbolDirectoryPath: null, + windowsSymbolPath: null); // Run the commands from the dotnet-dump command line if (command != null)