List <FRAMEINFO> ToFrameInfo(List <FrameInfoPair> framesInfo, IDebugThread debugThread,
                                     uint startIndex)
        {
            if (framesInfo == null)
            {
                return(null);
            }

            var ad7FramesInfo = new List <FRAMEINFO>();

            for (int i = 0; i < framesInfo.Count; ++i)
            {
                var frame = _stackFrameCreator(framesInfo[i].Frame, debugThread, _debugProgram);
                ad7FramesInfo.Add(_ad7FrameInfoCreator.Create(frame, framesInfo[i].Info, _program));
            }

            if (startIndex + ad7FramesInfo.Count > MaxStackDepth)
            {
                int lastIndex = ad7FramesInfo.Count - 1;
                // Create an entry to indicate that the maximum number is exceeded.
                var info = new FrameInfo <SbModule>()
                {
                    FuncName = "The maximum number of stack frames supported by the Stadia " +
                               "debugger has been exceeded.",
                    HasDebugInfo = 0, // for clarity, grays the entry out in the UI
                    ValidFields  = FrameInfoFlags.FIF_FUNCNAME | FrameInfoFlags.FIF_DEBUGINFO,
                };
                ad7FramesInfo[lastIndex] = _ad7FrameInfoCreator.Create(null, info, _program);
            }

            return(ad7FramesInfo);
        }
示例#2
0
        // Retrieves requested information about this stack frame.
        // fields specifies what should be included in the output FRAMEINFO.
        public int GetInfo(enum_FRAMEINFO_FLAGS fields, uint radix, FRAMEINFO[] frameInfo)
        {
            var info = lldbFrame.GetInfo((FrameInfoFlags)fields);

            if (info.HasValue)
            {
                frameInfo[0] = ad7FrameInfoCreator.Create(Self, info.Value, debugProgram);
                return(VSConstants.S_OK);
            }

            return(VSConstants.E_FAIL);
        }
 public void SetUp()
 {
     _remoteThread        = Substitute.For <RemoteThread>();
     _debugProgram        = Substitute.For <IGgpDebugProgram>();
     _ad7FrameInfoCreator = Substitute.For <AD7FrameInfoCreator>(
         Substitute.For <IDebugModuleCache>());
     _ad7FrameInfoCreator
     .Create(Arg.Any <IDebugStackFrame>(), Arg.Any <FrameInfo <SbModule> >(), _debugProgram)
     .ReturnsForAnyArgs(args => CreateFRAMEINFO((IDebugStackFrame)args[0],
                                                (FrameInfo <SbModule>)args[1]));
     _debugThread         = Substitute.For <IDebugThread>();
     _stackFramesProvider =
         new StackFramesProvider(_remoteThread, CreateStackFrame, _debugProgram,
                                 _ad7FrameInfoCreator, _debugProgram);
 }