/// <summary> /// Create an instance of the hosting class /// </summary> /// <param name="serviceProvider">Service provider</param> public SOSHost(IServiceProvider serviceProvider) { DataTarget dataTarget = serviceProvider.GetService <DataTarget>(); DataReader = dataTarget.DataReader; _console = serviceProvider.GetService <IConsoleService>(); AnalyzeContext = serviceProvider.GetService <AnalyzeContext>(); _memoryService = serviceProvider.GetService <MemoryService>(); _registerService = serviceProvider.GetService <RegisterService>(); _versionCache = new ReadVirtualCache(_memoryService); string rid = InstallHelper.GetRid(); SOSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), rid); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var debugClient = new DebugClient(this); _ccw = debugClient; _interface = debugClient.IDebugClient; } else { var lldbServices = new LLDBServices(this); _ccw = lldbServices; _interface = lldbServices.ILLDBServices; } }
/// <summary> /// Create an instance of the hosting class /// </summary> public SOSHost(IDataReader dataReader, ISOSHostContext context) { DataReader = dataReader; SOSHostContext = context; string rid = InstallHelper.GetRid(); SOSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), rid); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var debugClient = new DebugClient(this); _ccw = debugClient; _interface = debugClient.IDebugClient; } else { var lldbServices = new LLDBServices(this); _ccw = lldbServices; _interface = lldbServices.ILLDBServices; } }