Skip to content

Commit 2661893

Browse files
Access module name map under lock (#101)
* Access module name map under lock * Bump release version to 2022.10.29
1 parent cfc56b2 commit 2661893

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Engine/DiaUtil.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ private void ReleaseDiaObjects() {
5050
/// This function builds up the PDB map, by searching for matched PDBs (based on name) and constructing the DIA session for each
5151
internal static bool LocateandLoadPDBs(Dictionary<string, DiaUtil> _diautils, string userSuppliedSymPath, string symSrvSymPath, bool recurse, Dictionary<string, string> moduleNamesMap, bool cachePDB, List<string> modulesToIgnore) {
5252
var completeSymPath = $"{symSrvSymPath};{userSuppliedSymPath}";
53-
var moduleNames = moduleNamesMap.Keys.ToList();
53+
List<string> moduleNames;
54+
lock (moduleNamesMap) moduleNames = moduleNamesMap.Keys.ToList();
5455
// loop through each module, trying to find matched PDB files
5556
foreach (string currentModule in moduleNames.Where(m => !modulesToIgnore.Contains(m) && !_diautils.ContainsKey(m))) {
5657
// we only need to search for the PDB if it does not already exist in our map
@@ -74,8 +75,10 @@ internal static bool LocateandLoadPDBs(Dictionary<string, DiaUtil> _diautils, st
7475
}
7576

7677
// if needed, make a last attempt looking for the original module name - but only amongst user-supplied symbol path folder(s)
78+
string pdbFileName;
79+
lock (moduleNamesMap) pdbFileName = moduleNamesMap[currentModule] + ".pdb";
7780
if (!foundFiles.Any()) foreach (var currPath in userSuppliedSymPath.Split(';').Where(p => Directory.Exists(p) && !p.EndsWith(currentModule))) {
78-
foundFiles = Directory.EnumerateFiles(currPath, moduleNamesMap[currentModule] + ".pdb", recurse ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
81+
foundFiles = Directory.EnumerateFiles(currPath, pdbFileName, recurse ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
7982
}
8083

8184
if (foundFiles?.Count() == 1) { // we need to be sure there is only 1 file which matches

latestrelease.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-10-25 00:00
1+
2022-10-29 00:00

0 commit comments

Comments
 (0)