예제 #1
0
 public RemoteThreadRpcServiceImpl(ConcurrentDictionary <int, SbProcess> processStore,
                                   ObjectStore <RemoteThread> threadStore, ObjectStore <RemoteFrame> frameStore,
                                   UniqueObjectStore <SbModule> moduleStore)
 {
     this.processStore = processStore;
     this.threadStore  = threadStore;
     this.frameStore   = frameStore;
     this.moduleStore  = moduleStore;
 }
 public SbModuleRpcServiceImpl(UniqueObjectStore <SbModule> moduleStore,
                               ObjectStore <SbAddress> addressStore,
                               ObjectStore <SbSection> sectionStore,
                               ILldbFileSpecFactory fileSpecFactory)
 {
     this.moduleStore     = moduleStore;
     this.addressStore    = addressStore;
     this.sectionStore    = sectionStore;
     this.fileSpecFactory = fileSpecFactory;
 }
 public RemoteTargetRpcServiceImpl(ConcurrentDictionary <long, RemoteTarget> targetStore,
                                   ConcurrentDictionary <long, SbListener> listenerStore,
                                   ConcurrentDictionary <int, SbProcess> processStore,
                                   UniqueObjectStore <SbModule> moduleStore,
                                   ObjectStore <SbWatchpoint> watchpointStore,
                                   ObjectStore <SbAddress> addressStore)
 {
     _targetStore     = targetStore;
     _listenerStore   = listenerStore;
     _processStore    = processStore;
     _moduleStore     = moduleStore;
     _watchpointStore = watchpointStore;
     _addressStore    = addressStore;
 }
예제 #4
0
 public RemoteFrameRpcServiceImpl(ObjectStore <RemoteValue> valueStore,
                                  ObjectStore <SbFunction> functionStore,
                                  ObjectStore <SbSymbol> symbolStore,
                                  UniqueObjectStore <SbModule> moduleStore,
                                  ObjectStore <RemoteFrame> frameStore,
                                  ObjectStore <RemoteThread> threadStore)
 {
     this.valueStore    = valueStore;
     this.functionStore = functionStore;
     this.symbolStore   = symbolStore;
     this.moduleStore   = moduleStore;
     this.frameStore    = frameStore;
     this.threadStore   = threadStore;
 }
예제 #5
0
        static async Task <int> RunServerAsync(CommandLineOptions opts)
        {
            // Create pipes.
            string[] inPipeHandles  = opts.InPipeHandles.ToArray();
            string[] outPipeHandles = opts.OutPipeHandles.ToArray();
            int      numPipes       = inPipeHandles.Length;

            if (numPipes != outPipeHandles.Length)
            {
                return(-1);
            }

            GrpcEnvironment.SetLogger(new ConsoleLogger());

            // Re-direct trace logging to the console.
            ConsoleTraceListener consoleTraceListener = new ConsoleTraceListener();

            consoleTraceListener.Name = "mainConsoleTracer";
            Trace.Listeners.Add(consoleTraceListener);

            var listenerManager            = new ConcurrentDictionary <long, SbListener>();
            var targetManager              = new ConcurrentDictionary <long, RemoteTarget>();
            var processManager             = new ConcurrentDictionary <int, SbProcess>();
            var valueManager               = new ObjectStore <RemoteValue>();
            var addressManager             = new ObjectStore <SbAddress>();
            var functionManager            = new ObjectStore <SbFunction>();
            var symbolManager              = new ObjectStore <SbSymbol>();
            var typeManager                = new ObjectStore <SbType>();
            var typeMemberManager          = new ObjectStore <SbTypeMember>();
            var moduleManager              = new UniqueObjectStore <SbModule>(SbModuleEqualityComparer.Instance);
            var instructionManager         = new ObjectStore <SbInstruction>();
            var watchpointManager          = new ObjectStore <SbWatchpoint>();
            var commandInterpreterManager  = new ObjectStore <SbCommandInterpreter>();
            var commandReturnObjectManager = new ObjectStore <SbCommandReturnObject>();
            var unixSignalsManager         = new ObjectStore <SbUnixSignals>();
            var frameManager               = new ObjectStore <RemoteFrame>();
            var threadManager              = new ObjectStore <RemoteThread>();
            var sectionManager             = new ObjectStore <SbSection>();

            var lldbExpressionOptionsFactory = new LLDBExpressionOptionsFactory();
            var remoteValueFactory           = new RemoteValueImpl.Factory(lldbExpressionOptionsFactory);
            var remoteFrameFactory           = new RemoteFrameImpl.Factory(
                remoteValueFactory, lldbExpressionOptionsFactory);

            var remoteThreadFactory = new RemoteThreadImpl.Factory(remoteFrameFactory);

            remoteFrameFactory.SetRemoteThreadFactory(remoteThreadFactory);

            var fileSpecFactory = new LLDBFileSpecFactory();

            var sbDebuggerRpc = new SbDebuggerRpcServiceImpl(targetManager,
                                                             commandInterpreterManager);
            var sbCommandInterpreterRpc = new SbCommandInterpreterRpcServiceImpl(
                commandInterpreterManager, commandReturnObjectManager);
            var sbCommandReturnObjectRpc = new SbCommandReturnObjectServiceImpl(
                commandReturnObjectManager);
            var sbPlatformRpc   = new SbPlatformRpcServiceImpl();
            var remoteTargetRpc = new RemoteTargetRpcServiceImpl(targetManager, listenerManager,
                                                                 processManager, moduleManager, watchpointManager, addressManager);
            var sbListenerRpc = new SbListenerRpcServiceImpl(listenerManager);

            var sbProcessRpc = new SbProcessRpcServiceImpl(processManager, threadManager,
                                                           remoteThreadFactory, unixSignalsManager);
            var remoteThreadRpc = new RemoteThreadRpcServiceImpl(
                processManager, threadManager, frameManager, moduleManager);
            var remoteBreakpointRpc     = new RemoteBreakpointRpcServiceImpl(targetManager);
            var sbUnixSignalsRpc        = new SbUnixSignalsRpcServiceImpl(unixSignalsManager);
            var sbWatchpointRpc         = new SbWatchpointRpcServiceImpl(watchpointManager);
            var sbBreakpointLocationRpc = new SbBreakpointLocationRpcServiceImpl(targetManager,
                                                                                 addressManager);
            var remoteFrameRpc =
                new RemoteFrameRpcServiceImpl(valueManager, functionManager, symbolManager,
                                              moduleManager, frameManager, threadManager);
            var remoteValueRpc  = new RemoteValueRpcServiceImpl(valueManager, typeManager);
            var sbTypeRpc       = new SbTypeRpcServiceImpl(typeManager, typeMemberManager);
            var sbTypeMemberRpc = new SbTypeMemberRpcServiceImpl(typeMemberManager, typeManager);
            var sbAddressRpc    = new SbAddressRpcServiceImpl(addressManager, targetManager,
                                                              functionManager, symbolManager);
            var sbFunctionRpc = new SbFunctionRpcServiceImpl(
                addressManager, functionManager, instructionManager, targetManager);
            var sbSymbolRpc = new SbSymbolRpcServiceImpl(addressManager, symbolManager);
            var sbModuleRpc = new SbModuleRpcServiceImpl(moduleManager, addressManager,
                                                         sectionManager, fileSpecFactory);
            var sbSectionRpc = new SbSectionRpcServiceImpl(sectionManager, targetManager);

            sbDebuggerRpc.Initialize(sbPlatformRpc);

            PipeServiceBinder server = new PipeServiceBinder(inPipeHandles, outPipeHandles);

            SbDebuggerRpcService.BindService(server, sbDebuggerRpc);
            SbCommandInterpreterRpcService.BindService(server, sbCommandInterpreterRpc);
            SbCommandReturnObjectRpcService.BindService(server, sbCommandReturnObjectRpc);
            RemoteTargetRpcService.BindService(server, remoteTargetRpc);
            SbListenerRpcService.BindService(server, sbListenerRpc);
            SbPlatformRpcService.BindService(server, sbPlatformRpc);
            SbProcessRpcService.BindService(server, sbProcessRpc);
            RemoteThreadRpcService.BindService(server, remoteThreadRpc);
            RemoteBreakpointRpcService.BindService(server, remoteBreakpointRpc);
            SbBreakpointLocationRpcService.BindService(server, sbBreakpointLocationRpc);
            RemoteFrameRpcService.BindService(server, remoteFrameRpc);
            RemoteValueRpcService.BindService(server, remoteValueRpc);
            SbTypeRpcService.BindService(server, sbTypeRpc);
            SbTypeMemberRpcService.BindService(server, sbTypeMemberRpc);
            SbAddressRpcService.BindService(server, sbAddressRpc);
            SbFunctionRpcService.BindService(server, sbFunctionRpc);
            SbSymbolRpcService.BindService(server, sbSymbolRpc);
            SbModuleRpcService.BindService(server, sbModuleRpc);
            SbWatchpointRpcService.BindService(server, sbWatchpointRpc);
            SbUnixSignalsRpcService.BindService(server, sbUnixSignalsRpc);
            SbSectionRpcService.BindService(server, sbSectionRpc);

            server.Start();
            Console.WriteLine("LLDB GRPC server listening to the pipes");
            await server.ShutdownTask;

            Console.WriteLine("Shutdown complete.");
            return(0);
        }