void AddSymbolServer(SymbolStoreSequence storeSequence, IList <string> paths, string defaultPath, bool isCache = false) { var server = new SymbolServer(isCache); for (int i = 0; i < paths.Count; ++i) { var path = paths[i]; if (StadiaSymbolStore.IsStadiaStore(fileSystem, path)) { Trace.WriteLine("Warning: Stadia store not supported in symbol server " + "configuration; it will be ignored."); continue; } else if (HttpSymbolStore.IsHttpStore(path)) { bool hasDownstreamCache = storeSequence.HasCache || !server.IsEmpty; if (!TryAddHttpStore(server, path, hasDownstreamCache)) { continue; } if (isCache) { Trace.WriteLine( $"Warning: '{path}' is being used as a symbol cache, " + "but caching symbols in HTTP symbol stores is not supported."); } else if (i != paths.Count - 1) { Trace.WriteLine( $"Warning: '{path}' is being used as a downstream " + "store, but copying symbols to HTTP symbol stores is not supported."); } } else if (!string.IsNullOrEmpty(path)) { server.AddStore(new StructuredSymbolStore(fileSystem, path)); } else if (!string.IsNullOrEmpty(defaultPath)) { server.AddStore(new StructuredSymbolStore(fileSystem, defaultPath)); } } storeSequence.AddStore(server); }
bool TryAddStadiaStore(SymbolServer server, bool hasDownstreamCache) { // Stadia stores need a cache so that we can generate a local file reference for LLDB. if (!hasDownstreamCache && !TryAddDefaultCache(server, "Stadia Symbol Store")) { return(false); } server.AddStore(new StadiaSymbolStore(fileSystem, httpClient, crashReportClient)); return(true); }
bool TryAddDefaultCache(SymbolServer server, string upstreamPathForLogging) { // TODO: require the default cache path to be non-empty. if (string.IsNullOrEmpty(defaultCachePath)) { Trace.WriteLine( $"'{upstreamPathForLogging}' must be cached, " + "but no downstream cache exists and no default cache path has been provided."); return(false); } server.AddStore(new StructuredSymbolStore(fileSystem, defaultCachePath)); Trace.WriteLine($"Automatically added default cache as '{upstreamPathForLogging}' " + "would not otherwise be cached."); return(true); }
bool TryAddHttpStore(SymbolServer server, string path, bool hasDownstreamCache) { // HTTP stores need a cache so that we can generate a local file reference for LLDB. if (!hasDownstreamCache && !TryAddDefaultCache(server, path)) { return(false); } if (hostExcludeList.Contains(new Uri(path, UriKind.Absolute).Host)) { Trace.WriteLine($"Skipped parsing http store '{path}' due to host excludelist."); return(false); } server.AddStore(new HttpSymbolStore(fileSystem, httpClient, path)); return(true); }