예제 #1
0
 public ModuleFileLoadMetricsRecorder(ILldbModuleUtil moduleUtil,
                                      IModuleFileFinder moduleFileFinder, Metrics.IAction action)
 {
     this.moduleUtil       = moduleUtil;
     this.moduleFileFinder = moduleFileFinder;
     this.action           = action;
 }
예제 #2
0
 public Factory(JoinableTaskContext taskContext, GrpcDebuggerFactory lldbDebuggerFactory,
                GrpcListenerFactory lldbListenerFactory,
                GrpcPlatformFactory lldbPlatformFactory,
                GrpcPlatformConnectOptionsFactory lldbPlatformConnectOptionsFactory,
                GrpcPlatformShellCommandFactory lldbPlatformShellCommandFactory,
                ILldbAttachedProgramFactory attachedProgramFactory,
                ActionRecorder actionRecorder,
                ModuleFileLoadMetricsRecorder.Factory moduleFileLoadRecorderFactory,
                LldbExceptionManager.Factory exceptionManagerFactory,
                IFileSystem fileSystem, bool fastExpressionEvaluation,
                IModuleFileFinder moduleFileFinder,
                IDumpModulesProvider dumpModulesProvider,
                IModuleSearchLogHolder moduleSearchLogHolder,
                ISymbolSettingsProvider symbolSettingsProvider,
                CoreAttachWarningDialogUtil warningDialog)
 {
     _taskContext         = taskContext;
     _lldbDebuggerFactory = lldbDebuggerFactory;
     _lldbListenerFactory = lldbListenerFactory;
     _lldbPlatformFactory = lldbPlatformFactory;
     _lldbPlatformConnectOptionsFactory = lldbPlatformConnectOptionsFactory;
     _lldbPlatformShellCommandFactory   = lldbPlatformShellCommandFactory;
     _attachedProgramFactory            = attachedProgramFactory;
     _actionRecorder = actionRecorder;
     _moduleFileLoadRecorderFactory = moduleFileLoadRecorderFactory;
     _exceptionManagerFactory       = exceptionManagerFactory;
     _fileSystem = fileSystem;
     _fastExpressionEvaluation = fastExpressionEvaluation;
     _moduleFileFinder         = moduleFileFinder;
     _dumpModulesProvider      = dumpModulesProvider;
     _moduleSearchLogHolder    = moduleSearchLogHolder;
     _symbolSettingsProvider   = symbolSettingsProvider;
     _warningDialog            = warningDialog;
 }
예제 #3
0
 public BinaryLoader(ILldbModuleUtil moduleUtil, IModuleFileFinder moduleFileFinder,
                     RemoteTarget lldbTarget)
 {
     this.moduleUtil       = moduleUtil;
     this.moduleFileFinder = moduleFileFinder;
     this.lldbTarget       = lldbTarget;
 }
예제 #4
0
 public Factory(ILldbModuleUtil moduleUtil, IBinaryFileUtil binaryFileUtil,
                IModuleFileFinder moduleFileFinder)
 {
     this.moduleUtil       = moduleUtil;
     this.binaryFileUtil   = binaryFileUtil;
     this.moduleFileFinder = moduleFileFinder;
 }
예제 #5
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;
        }
예제 #6
0
 public SymbolLoader(ILldbModuleUtil moduleUtil, IBinaryFileUtil binaryFileUtil,
                     IModuleFileFinder moduleFileFinder, SbCommandInterpreter lldbCommandInterpreter)
 {
     this.moduleUtil             = moduleUtil;
     this.binaryFileUtil         = binaryFileUtil;
     this.moduleFileFinder       = moduleFileFinder;
     this.lldbCommandInterpreter = lldbCommandInterpreter;
 }
예제 #7
0
        public override IDebugEngineFactory CreateDebugEngineFactory()
        {
            ServiceManager serviceManager      = CreateServiceManager();
            var            joinableTaskContext = GetJoinableTaskContext();
            var            vsiService          = GetVsiService();

            joinableTaskContext.ThrowIfNotOnMainThread();

            var debugEngineCommands =
                new DebugEngineCommands(joinableTaskContext, null, false);

            var actionRecorder           = new ActionRecorder(GetDebugSessionMetrics());
            var backgroundProcessFactory = new BackgroundProcess.Factory();

            var processFactory = new ManagedProcess.Factory();
            var binaryFileUtil = new ElfFileUtil(processFactory);
            var lldbModuleUtil = new LldbModuleUtil();

            IModuleFileFinder moduleFileFinder = Substitute.For <IModuleFileFinder>();
            var moduleFileLoadRecorderFactory  =
                new ModuleFileLoadMetricsRecorder.Factory(lldbModuleUtil, moduleFileFinder);
            var grpcInterceptors = CreateGrpcInterceptors(vsiService.DebuggerOptions);
            var vsOutputWindow   =
                serviceManager.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow;
            var callInvokerFactory      = new PipeCallInvokerFactory();
            var transportSessionFactory =
                new LldbTransportSession.Factory(new MemoryMappedFileFactory());
            var yetiTransport = new YetiDebugTransport(
                joinableTaskContext, transportSessionFactory, callInvokerFactory,
                new GrpcConnectionFactory(joinableTaskContext.Factory, grpcInterceptors.ToArray()),
                GetTaskExecutor().CancelAsyncOperationIfRequested, processFactory, _dialogUtil,
                vsOutputWindow, vsiService);

            var chromeLauncher            = new ChromeLauncher(backgroundProcessFactory);
            var testClientLauncherFactory = new ChromeClientsLauncher.Factory(
                new ChromeClientLaunchCommandFormatter(GetJsonUtil()), GetSdkConfigFactory(),
                chromeLauncher);

            var exitDialogUtil         = new ExitDialogUtil(_dialogUtil, GetDialogExecutionContext());
            var preflightBinaryChecker =
                new PreflightBinaryChecker(GetFileSystem(), binaryFileUtil);

            var paramsFactory = new YetiVSI.DebugEngine.DebugEngine.Params.Factory(GetJsonUtil());

            var  cancelableTaskFactory  = GetCancelableTaskFactory();
            bool deployLldbServer       = true;
            IDebugEngineFactory factory = new YetiVSI.DebugEngine.DebugEngine.Factory(
                joinableTaskContext, serviceManager, GetDebugSessionMetrics(), yetiTransport,
                actionRecorder, null, moduleFileLoadRecorderFactory, moduleFileFinder,
                testClientLauncherFactory, GetNatvis(), GetNatvisDiagnosticLogger(),
                exitDialogUtil, preflightBinaryChecker, _debugSessionLauncherFactory, paramsFactory,
                _remoteDeploy, cancelableTaskFactory, _dialogUtil,
                GetNatvisLoggerOutputWindowListener(), GetSolutionExplorer(), debugEngineCommands,
                GetDebugEventCallbackDecorator(vsiService.DebuggerOptions),
                GetSymbolSettingsProvider(), deployLldbServer, _gameLauncher);

            return(GetFactoryDecorator().Decorate(factory));
        }
예제 #8
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);
 }
예제 #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();
        }
예제 #10
0
 public DebugSessionLauncher(
     JoinableTaskContext taskContext, GrpcDebuggerFactory lldbDebuggerFactory,
     GrpcListenerFactory lldbListenerFactory, GrpcPlatformFactory lldbPlatformFactory,
     GrpcPlatformConnectOptionsFactory lldbPlatformConnectOptionsFactory,
     GrpcPlatformShellCommandFactory lldbPlatformShellCommandFactory,
     ILldbAttachedProgramFactory attachedProgramFactory, IDebugEngine3 debugEngine,
     LaunchOption launchOption, ActionRecorder actionRecorder,
     ModuleFileLoadMetricsRecorder.Factory moduleFileLoadRecorderFactory,
     string coreFilePath, string executableFileName, string executableFullPath,
     LldbExceptionManager.Factory exceptionManagerFactory, IFileSystem fileSystem,
     bool fastExpressionEvaluation, IModuleFileFinder moduleFileFinder,
     IDumpModulesProvider dumpModulesProvider, IModuleSearchLogHolder moduleSearchLogHolder,
     ISymbolSettingsProvider symbolSettingsProvider,
     CoreAttachWarningDialogUtil warningDialog, IVsiGameLaunch gameLaunch)
 {
     _taskContext         = taskContext;
     _lldbDebuggerFactory = lldbDebuggerFactory;
     _lldbListenerFactory = lldbListenerFactory;
     _lldbPlatformFactory = lldbPlatformFactory;
     _lldbPlatformConnectOptionsFactory = lldbPlatformConnectOptionsFactory;
     _lldbPlatformShellCommandFactory   = lldbPlatformShellCommandFactory;
     _attachedProgramFactory            = attachedProgramFactory;
     _debugEngine             = debugEngine;
     _exceptionManagerFactory = exceptionManagerFactory;
     _fileSystem = fileSystem;
     _fastExpressionEvaluation      = fastExpressionEvaluation;
     _launchOption                  = launchOption;
     _actionRecorder                = actionRecorder;
     _moduleFileLoadRecorderFactory = moduleFileLoadRecorderFactory;
     _coreFilePath                  = coreFilePath;
     _executableFileName            = executableFileName;
     _executableFullPath            = executableFullPath;
     _moduleFileFinder              = moduleFileFinder;
     _dumpModulesProvider           = dumpModulesProvider;
     _moduleSearchLogHolder         = moduleSearchLogHolder;
     _symbolSettingsProvider        = symbolSettingsProvider;
     _warningDialog                 = warningDialog;
     _gameLaunch = gameLaunch;
 }