/// <summary> /// Create an instance of the hosting class /// </summary> /// <param name="target">target instance</param> public SOSHost(ITarget target) { Target = target; ConsoleService = target.Services.GetService <IConsoleService>(); ModuleService = target.Services.GetService <IModuleService>(); ThreadService = target.Services.GetService <IThreadService>(); MemoryService = target.Services.GetService <IMemoryService>(); _ignoreAddressBitsMask = MemoryService.SignExtensionMask(); string rid = InstallHelper.GetRid(); SOSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), rid); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { var debugClient = new DebugClient(this); _interface = debugClient.IDebugClient; } else { var lldbServices = new LLDBServices(this); _interface = lldbServices.ILLDBServices; } _hostWrapper = new HostWrapper(target.Host); _hostWrapper.AddServiceWrapper(SymbolServiceWrapper.IID_ISymbolService, () => new SymbolServiceWrapper(target.Host)); }
/// <summary> /// Create an instance of the hosting class /// </summary> /// <param name="target">target instance</param> private SOSLibrary(IHost host) { _contextService = host.Services.GetService <IContextService>(); string rid = InstallHelper.GetRid(); SOSPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), rid); _hostWrapper = new HostWrapper(host, () => GetSOSHost()?.TargetWrapper); _hostWrapper.AddServiceWrapper(SymbolServiceWrapper.IID_ISymbolService, () => new SymbolServiceWrapper(host, () => GetSOSHost()?.MemoryService)); }