Exemplo n.º 1
0
 public ModuleFileLoadMetricsRecorder(ILldbModuleUtil moduleUtil,
                                      IModuleFileFinder moduleFileFinder, Metrics.IAction action)
 {
     this.moduleUtil       = moduleUtil;
     this.moduleFileFinder = moduleFileFinder;
     this.action           = action;
 }
Exemplo n.º 2
0
 public BinaryLoader(ILldbModuleUtil moduleUtil, IModuleFileFinder moduleFileFinder,
                     RemoteTarget lldbTarget)
 {
     this.moduleUtil       = moduleUtil;
     this.moduleFileFinder = moduleFileFinder;
     this.lldbTarget       = lldbTarget;
 }
Exemplo n.º 3
0
 public Factory(ILldbModuleUtil moduleUtil, IBinaryFileUtil binaryFileUtil,
                IModuleFileFinder moduleFileFinder)
 {
     this.moduleUtil       = moduleUtil;
     this.binaryFileUtil   = binaryFileUtil;
     this.moduleFileFinder = moduleFileFinder;
 }
Exemplo n.º 4
0
        public void SetUp()
        {
            searchLog = new StringWriter();

            mockTarget            = Substitute.For <RemoteTarget>();
            moduleReplacedHandler = Substitute.For <EventHandler <LldbModuleReplacedEventArgs> >();

            mockModuleFileFinder = Substitute.For <IModuleFileFinder>();
            mockModuleFileFinder.FindFileAsync(BINARY_FILENAME, UUID, false, searchLog)
            .Returns(Task.FromResult(PATH_IN_STORE));

            placeholderModule = Substitute.For <SbModule>();
            placeholderModule.GetPlatformFileSpec().GetFilename().Returns(BINARY_FILENAME);
            placeholderModule.GetUUIDString().Returns(UUID.ToString());

            placeholderProperties =
                new PlaceholderModuleProperties(MODULE_SLIDE, Substitute.For <SbFileSpec>());

            mockModuleUtil = Substitute.For <ILldbModuleUtil>();
            mockModuleUtil.IsPlaceholderModule(placeholderModule).Returns(true);
            mockModuleUtil.GetPlaceholderProperties(Arg.Any <SbModule>(), Arg.Any <RemoteTarget>())
            .ReturnsForAnyArgs(placeholderProperties);
            mockModuleUtil.ApplyPlaceholderProperties(
                Arg.Any <SbModule>(), Arg.Any <PlaceholderModuleProperties>(),
                Arg.Any <RemoteTarget>())
            .ReturnsForAnyArgs(true);


            binaryLoader = new BinaryLoader(mockModuleUtil, mockModuleFileFinder,
                                            mockTarget);
            binaryLoader.LldbModuleReplaced += moduleReplacedHandler;
        }
Exemplo n.º 5
0
 public SymbolLoader(ILldbModuleUtil moduleUtil, IBinaryFileUtil binaryFileUtil,
                     IModuleFileFinder moduleFileFinder, SbCommandInterpreter lldbCommandInterpreter)
 {
     this.moduleUtil             = moduleUtil;
     this.binaryFileUtil         = binaryFileUtil;
     this.moduleFileFinder       = moduleFileFinder;
     this.lldbCommandInterpreter = lldbCommandInterpreter;
 }
Exemplo n.º 6
0
 public void SetUp()
 {
     mockModuleUtil       = Substitute.For <ILldbModuleUtil>();
     mockModuleFileFinder = Substitute.For <IModuleFileFinder>();
     action = new Action(
         DeveloperEventType.Types.Type.VsiDebugEngineLoadSymbols,
         Substitute.For <Timer.Factory>(), Substitute.For <IMetrics>());
     moduleFileLoadRecorder = new ModuleFileLoadMetricsRecorder(mockModuleUtil,
                                                                mockModuleFileFinder, action);
 }
Exemplo n.º 7
0
 public Factory(CancelableTask.Factory cancelableTaskFactory,
                ActionRecorder actionRecorder,
                ModuleFileLoadMetricsRecorder.Factory moduleFileLoadRecorderFactory,
                ILldbModuleUtil moduleUtil,
                ISymbolSettingsProvider symbolSettingsProvider)
 {
     _cancelableTaskFactory         = cancelableTaskFactory;
     _actionRecorder                = actionRecorder;
     _moduleUtil                    = moduleUtil;
     _symbolSettingsProvider        = symbolSettingsProvider;
     _moduleFileLoadRecorderFactory = moduleFileLoadRecorderFactory;
 }
Exemplo n.º 8
0
        public void SetUp()
        {
            logSpy = new LogSpy();
            logSpy.Attach();

            var noError = new SbErrorStub(true, null);

            mockTarget = Substitute.For <RemoteTarget>();
            mockTarget.SetModuleLoadAddress(Arg.Any <SbModule>(), Arg.Any <long>()).Returns(noError);
            mockModule = Substitute.For <SbModule>();
            mockModule.HasCompileUnits().Returns(false);
            mockModule.FindSection(Arg.Any <string>()).Returns((SbSection)null);
            mockPlatformFileSpec = Substitute.For <SbFileSpec>();
            moduleUtil           = new LldbModuleUtil();
        }
Exemplo n.º 9
0
        public void SetUp()
        {
            searchLog = new StringWriter();

            mockBinaryFileUtil = Substitute.For <IBinaryFileUtil>();

            mockSuccessCommandReturnObject = Substitute.For <SbCommandReturnObject>();
            mockSuccessCommandReturnObject.GetOutput().Returns(LLDB_OUTPUT);
            mockSuccessCommandReturnObject.GetDescription().Returns("Success: " + LLDB_OUTPUT);
            mockSuccessCommandReturnObject.Succeeded().Returns(true);

            mockCommandInterpreter = Substitute.For <SbCommandInterpreter>();
            SetHandleCommandReturnValue(mockCommandInterpreter, COMMAND_WITH_MODULE_PATH,
                                        ReturnStatus.SuccessFinishResult,
                                        mockSuccessCommandReturnObject);

            mockPlatformFileSpec = Substitute.For <SbFileSpec>();
            mockPlatformFileSpec.GetDirectory().Returns(PLATFORM_DIRECTORY);
            mockPlatformFileSpec.GetFilename().Returns(BINARY_FILENAME);

            mockSymbolFileSpec = Substitute.For <SbFileSpec>();
            mockSymbolFileSpec.GetDirectory().Returns("");
            mockSymbolFileSpec.GetFilename().Returns(SYMBOL_FILE_NAME);

            mockBinaryFileSpec = Substitute.For <SbFileSpec>();
            mockBinaryFileSpec.GetDirectory().Returns(BINARY_DIRECTORY);
            mockBinaryFileSpec.GetFilename().Returns(BINARY_FILENAME);

            mockModuleFileFinder = Substitute.For <IModuleFileFinder>();
            SetFindFileReturnValue(PATH_IN_STORE);
            mockModuleUtil = Substitute.For <ILldbModuleUtil>();
            mockModuleUtil.HasSymbolsLoaded(Arg.Any <SbModule>()).Returns(false);

            symbolLoader = new SymbolLoader(mockModuleUtil, mockBinaryFileUtil,
                                            mockModuleFileFinder, mockCommandInterpreter);

            symbolFileInStore = Substitute.For <IFileReference>();
            symbolFileInStore.IsFilesystemLocation.Returns(true);
            symbolFileInStore.Location.Returns(PATH_IN_STORE);

            logSpy = new LogSpy();
            logSpy.Attach();
        }
Exemplo n.º 10
0
 DebugModule(CancelableTask.Factory cancelableTaskFactory, ActionRecorder actionRecorder,
             ModuleFileLoadMetricsRecorder.Factory moduleFileLoadRecorderFactory,
             ILldbModuleUtil moduleUtil, IModuleFileLoader moduleFileLoader,
             IModuleSearchLogHolder moduleSearchLogHolder, SbModule lldbModule,
             uint loadOrder, IDebugEngineHandler engineHandler, IGgpDebugProgram program,
             ISymbolSettingsProvider symbolSettingsProvider)
 {
     _cancelableTaskFactory         = cancelableTaskFactory;
     _actionRecorder                = actionRecorder;
     _moduleFileLoadRecorderFactory = moduleFileLoadRecorderFactory;
     _moduleUtil            = moduleUtil;
     _moduleFileLoader      = moduleFileLoader;
     _moduleSearchLogHolder = moduleSearchLogHolder;
     _lldbModule            = lldbModule;
     _loadOrder             = loadOrder;
     _engineHandler         = engineHandler;
     _program = program;
     _symbolSettingsProvider = symbolSettingsProvider;
 }
Exemplo n.º 11
0
        public void SetUp()
        {
            _mockCancelableTaskFactory = Substitute.For <CancelableTask.Factory>();
            _mockModuleUtil            = Substitute.For <ILldbModuleUtil>();
            _mockModuleUtil.HasSymbolsLoaded(Arg.Any <SbModule>()).Returns(false);
            _mockModuleFileLoader      = Substitute.For <IModuleFileLoader>();
            _mockModuleSearchLogHolder = Substitute.For <IModuleSearchLogHolder>();
            _mockModule         = Substitute.For <SbModule>();
            _mockActionRecorder = Substitute.For <ActionRecorder>(null, null);
            var mockModuleFileLoadRecorderFactory =
                Substitute.For <ModuleFileLoadMetricsRecorder.Factory>();

            _mockEngineHandler          = Substitute.For <IDebugEngineHandler>();
            _mockDebugProgram           = Substitute.For <IGgpDebugProgram>();
            _mockSymbolSettingsProvider = Substitute.For <ISymbolSettingsProvider>();
            _debugModule =
                new DebugModule
                .Factory(_mockCancelableTaskFactory, _mockActionRecorder,
                         mockModuleFileLoadRecorderFactory, _mockModuleUtil,
                         _mockSymbolSettingsProvider)
                .Create(_mockModuleFileLoader, _mockModuleSearchLogHolder, _mockModule,
                        _testLoadOrder, _mockEngineHandler, _mockDebugProgram);
        }