Skip to content

Commit f9b0aa5

Browse files
authored
Merge pull request #21 from Unity-Technologies/fix-pid-checking
Check pmip pid to force a refresh when it doesn't match on subsequent…
2 parents da539d2 + 6d26e5d commit f9b0aa5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

UnityMixedCallstackFilter.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class UnityMixedCallstackFilter : IDkmCallStackFilter, IDkmLoadCompleteNo
2121
struct PmipFile
2222
{
2323
public int count;
24+
public int pid;
2425
public string path;
2526
}
2627

@@ -65,7 +66,7 @@ private static DkmStackWalkFrame UnityMixedStackFrame(DkmStackContext stackConte
6566
{
6667
RefreshStackData(frame.Process.LivePart.Id);
6768
#if DEBUG
68-
_debugPane?.OutputString($"UNITYMIXEDCALLSTACK :: done refreshing data :: looking for address: {frame.InstructionAddress.CPUInstructionPart.InstructionPointer:X16}\n");
69+
_debugPane?.OutputString($"UNITYMIXEDCALLSTACK :: done refreshing data for pid({frame.Process.LivePart.Id}) :: looking for address: {frame.InstructionAddress.CPUInstructionPart.InstructionPointer:X16}\n");
6970
#endif
7071

7172
string name = null;
@@ -116,21 +117,23 @@ private static bool CheckForUpdatedFiles(FileInfo[] taskFiles)
116117
PmipFile pmipFile = new PmipFile()
117118
{
118119
count = int.Parse(tokens[2]),
120+
pid = int.Parse(tokens[1]),
119121
path = taskFile.FullName
120122
};
121123

122124
// 3 is legacy and treat everything as root domain
123125
if (tokens.Length == 3 &&
124126
(!_currentFiles.TryGetValue(0, out PmipFile curFile) ||
125-
curFile.count < pmipFile.count))
127+
curFile.count < pmipFile.count || curFile.pid != pmipFile.pid))
126128
{
127129
_currentFiles[0] = pmipFile;
128130
retVal = true;
129131
}
130132
else if (tokens.Length == 4)
131133
{
132134
int domainID = int.Parse(tokens[3]);
133-
if (!_currentFiles.TryGetValue(domainID, out PmipFile cFile) || cFile.count < pmipFile.count)
135+
if (!_currentFiles.TryGetValue(domainID, out PmipFile cFile) || cFile.count < pmipFile.count ||
136+
cFile.pid != pmipFile.pid)
134137
{
135138
_currentFiles[domainID] = pmipFile;
136139
retVal = true;

0 commit comments

Comments
 (0)