VSNDK.DebugEngine.AD7StackFrame.create C# (CSharp) Method

create() public static method

Search the __stackframes cache for the internal representation of the stack frame associated to the GDB frameInfo information. If successful, returns the stack frame; otherwise, creates a new one and return it.
public static create ( AD7Engine engine, AD7Thread thread, string frameInfo, bool &created ) : AD7StackFrame
engine AD7Engine The AD7Engine object that represents the DE.
thread AD7Thread Represents the thread for this stack frame.
frameInfo string Array of strings with the information provided by GDB about this stack frame.
created bool Boolean value that indicates if a new object for this stack frame was created or not.
return AD7StackFrame
        public static AD7StackFrame create(AD7Engine engine, AD7Thread thread, string[] frameInfo, ref bool created)
        {
            created = false;
            if (thread.__stackFrames != null)
            {
                foreach (AD7StackFrame frame in thread.__stackFrames)
                {
                    if (frame.m_documentName != null && frame.m_functionName != null)
                    {
                        if (frame.m_documentName == frameInfo[3] && frame.m_functionName == frameInfo[2]) // frameInfo[2] = func, frameInfo[3] = file
                            return frame;
                    }
                }
            }
            else
                thread.__stackFrames = new ArrayList();

            AD7StackFrame newFrame = new AD7StackFrame(engine, thread, frameInfo);
            if (thread.__stackFrames == null) // that's weird, but sometimes VS is not initializing __stackFrames, so I added this loop to avoid other problems.
                thread.__stackFrames = new ArrayList() { newFrame };
            else
                thread.__stackFrames.Add(newFrame);
            created = true;
            return newFrame;
        }