Skip to content

Commit

Permalink
Merge pull request #21 from Unity-Technologies/fix-pid-checking
Browse files Browse the repository at this point in the history
Check pmip pid to force a refresh when it doesn't match on subsequent…
  • Loading branch information
UnityAlex committed Jun 26, 2023
2 parents da539d2 + 6d26e5d commit f9b0aa5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions UnityMixedCallstackFilter.cs
Expand Up @@ -21,6 +21,7 @@ public class UnityMixedCallstackFilter : IDkmCallStackFilter, IDkmLoadCompleteNo
struct PmipFile
{
public int count;
public int pid;
public string path;
}

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

string name = null;
Expand Down Expand Up @@ -116,21 +117,23 @@ private static bool CheckForUpdatedFiles(FileInfo[] taskFiles)
PmipFile pmipFile = new PmipFile()
{
count = int.Parse(tokens[2]),
pid = int.Parse(tokens[1]),
path = taskFile.FullName
};

// 3 is legacy and treat everything as root domain
if (tokens.Length == 3 &&
(!_currentFiles.TryGetValue(0, out PmipFile curFile) ||
curFile.count < pmipFile.count))
curFile.count < pmipFile.count || curFile.pid != pmipFile.pid))
{
_currentFiles[0] = pmipFile;
retVal = true;
}
else if (tokens.Length == 4)
{
int domainID = int.Parse(tokens[3]);
if (!_currentFiles.TryGetValue(domainID, out PmipFile cFile) || cFile.count < pmipFile.count)
if (!_currentFiles.TryGetValue(domainID, out PmipFile cFile) || cFile.count < pmipFile.count ||
cFile.pid != pmipFile.pid)
{
_currentFiles[domainID] = pmipFile;
retVal = true;
Expand Down

0 comments on commit f9b0aa5

Please sign in to comment.