Exemple #1
0
        public void SetUp()
        {
            mockFrame = Substitute.For <RemoteFrame>();

            var childAdapterFactory = new RemoteValueChildAdapter.Factory();
            var varInfoFactory      = new LLDBVariableInformationFactory(childAdapterFactory);
            var varInfoBuilder      = new VarInfoBuilder(varInfoFactory);

            varInfoFactory.SetVarInfoBuilder(varInfoBuilder);
            var registerSetsBuilderFactory = new RegisterSetsBuilder.Factory(varInfoFactory);

            registerSetsBuilder = registerSetsBuilderFactory.Create(mockFrame);

            generalPurposeRegisters = Substitute.For <RemoteValue>();
            generalPurposeRegisters.GetName().Returns("General Purpose Registers");
            generalPurposeRegisters.GetNumChildren().Returns(0u);

            floatingPointRegisters = Substitute.For <RemoteValue>();
            floatingPointRegisters.GetName().Returns("Floating Point Registers");
            floatingPointRegisters.GetNumChildren().Returns(3u);
            xmm0 = Substitute.For <RemoteValue>();
            xmm0.GetName().Returns("xmm0");
            xmm8 = Substitute.For <RemoteValue>();
            xmm8.GetName().Returns("xmm8");
            other = Substitute.For <RemoteValue>();
            other.GetName().Returns("other");
            floatingPointRegisters.GetChildren(0, 3).Returns(
                new List <RemoteValue>()
            {
                xmm0, xmm8, other
            });
        }
Exemple #2
0
        public void SetUp()
        {
            lineEntry                  = new LineEntryInfo();
            mockDocumentContext        = Substitute.For <IDebugDocumentContext2>();
            mockThread                 = Substitute.For <IDebugThread>();
            mockDocumentContextFactory = Substitute.For <DebugDocumentContext.Factory>();
            mockDocumentContextFactory.Create(lineEntry).Returns(mockDocumentContext);
            mockDebuggerStackFrame = Substitute.For <RemoteFrame>();
            mockDebuggerStackFrame.GetLineEntry().Returns(lineEntry);
            mockDebuggerStackFrame.GetPC().Returns(TEST_PC);
            mockDebuggerStackFrame.GetFunctionName().Returns(NAME);
            mockDebuggerStackFrame.GetFunctionNameWithSignature().Returns(NAME);

            mockCodeContextFactory = Substitute.For <DebugCodeContext.Factory>();
            mockExpressionFactory  = Substitute.For <DebugExpression.Factory>();
            mockModuleCache        = Substitute.For <IDebugModuleCache>();

            mockDebugEngineHandler = Substitute.For <IDebugEngineHandler>();
            mockProgram            = Substitute.For <IGgpDebugProgram>();

            taskExecutor = new TaskExecutor(new JoinableTaskContext().Factory);

            var childAdapterFactory     = new RemoteValueChildAdapter.Factory();
            var varInfoFactory          = new LLDBVariableInformationFactory(childAdapterFactory);
            var varInfoEnumFactory      = new VariableInformationEnum.Factory(taskExecutor);
            var childrenProviderFactory = new ChildrenProvider.Factory();
            var propertyFactory         =
                new DebugProperty.Factory(varInfoEnumFactory, childrenProviderFactory,
                                          Substitute.For <DebugCodeContext.Factory>(),
                                          new VsExpressionCreator(), taskExecutor);

            childrenProviderFactory.Initialize(propertyFactory.Create);
            var registerSetsBuilderFactory = new RegisterSetsBuilder.Factory(varInfoFactory);

            stackFrame = new DebugStackFrame.Factory(mockDocumentContextFactory,
                                                     childrenProviderFactory, mockCodeContextFactory, mockExpressionFactory.Create,
                                                     varInfoFactory, varInfoEnumFactory, registerSetsBuilderFactory, taskExecutor)
                         .Create(new AD7FrameInfoCreator(mockModuleCache), mockDebuggerStackFrame,
                                 mockThread, mockDebugEngineHandler, mockProgram);

            stackFrameAsync = new DebugStackFrameAsync.Factory(mockDocumentContextFactory,
                                                               childrenProviderFactory, mockCodeContextFactory, mockExpressionFactory.Create,
                                                               varInfoFactory, varInfoEnumFactory, registerSetsBuilderFactory, taskExecutor)
                              .Create(new AD7FrameInfoCreator(mockModuleCache), mockDebuggerStackFrame,
                                      mockThread, mockDebugEngineHandler, mockProgram);
        }