private void ValidatePush(string name) { if (GlobalLog.s_DebugCallNesting) { Object obj = _ThreadNesting[Thread.CurrentThread.GetHashCode()]; ThreadInfoData threadInfo = obj as ThreadInfoData; if (threadInfo == null) { return; } threadInfo.NestingStack.Push(name); } }
private void ValidatePop(string name) { if (GlobalLog.s_DebugCallNesting) { try { Object obj = _ThreadNesting[Thread.CurrentThread.GetHashCode()]; ThreadInfoData threadInfo = obj as ThreadInfoData; if (threadInfo == null) { return; } if (threadInfo.NestingStack.Count == 0) { PrintLine("++++====" + "Poped Empty Stack for :" + name); } string popedName = (string)threadInfo.NestingStack.Pop(); string [] parsedList = popedName.Split(new char [] { '(', ')', ' ', '.', ':', ',', '#' }); foreach (string element in parsedList) { if (element != null && element.Length > 1 && name.IndexOf(element) != -1) { return; } } PrintLine("++++====" + "Expected:" + popedName + ": got :" + name + ": StackSize:" + threadInfo.NestingStack.Count); // relevel the stack while (threadInfo.NestingStack.Count > 0) { string popedName2 = (string)threadInfo.NestingStack.Pop(); string [] parsedList2 = popedName2.Split(new char [] { '(', ')', ' ', '.', ':', ',', '#' }); foreach (string element2 in parsedList2) { if (element2 != null && element2.Length > 1 && name.IndexOf(element2) != -1) { return; } } } } catch { PrintLine("++++====" + "ValidatePop failed for: " + name); } } }