private LaunchOptions CreateAttachLaunchOptions(uint processId, IDebugPort2 port) { LaunchOptions launchOptions; var unixPort = port as IDebugUnixShellPort; if (unixPort != null) { MIMode miMode; if (_engineGuid == EngineConstants.ClrdbgEngine) { miMode = MIMode.Clrdbg; } else if (_engineGuid == EngineConstants.GdbEngine) { miMode = MIMode.Gdb; } else { // TODO: LLDB support throw new NotImplementedException(); } if (processId > int.MaxValue) { throw new ArgumentOutOfRangeException("processId"); } string getClrDbgUrl = GetMetric("GetClrDbgUrl") as string; string remoteDebuggerInstallationDirectory = GetMetric("RemoteInstallationDirectory") as string; string remoteDebuggerInstallationSubDirectory = GetMetric("RemoteInstallationSubDirectory") as string; string clrDbgVersion = GetMetric("ClrDbgVersion") as string; launchOptions = LaunchOptions.CreateForAttachRequest(unixPort, (int)processId, miMode, getClrDbgUrl, remoteDebuggerInstallationDirectory, remoteDebuggerInstallationSubDirectory, clrDbgVersion, Logger); } else { // TODO: when we have a tools options page, we can add support for the attach dialog here pretty easily: //var defaultPort = port as IDebugDefaultPort2; //if (defaultPort != null && defaultPort.QueryIsLocal() == Constants.S_OK) //{ // launchOptions = new LocalLaunchOptions(...); //} //else //{ // // Invalid port // throw new ArgumentException(); //} throw new NotSupportedException(); } return(launchOptions); }
private LaunchOptions CreateAttachLaunchOptions(uint processId, IDebugPort2 port) { LaunchOptions launchOptions; var unixPort = port as IDebugUnixShellPort; if (unixPort != null) { MIMode miMode; if (_engineGuid == EngineConstants.GdbEngine) { miMode = MIMode.Gdb; } else if (_engineGuid == EngineConstants.LldbEngine) { miMode = MIMode.Lldb; } else { throw new NotImplementedException(); } if (processId > int.MaxValue) { throw new ArgumentOutOfRangeException(nameof(processId)); } launchOptions = LaunchOptions.CreateForAttachRequest(unixPort, (int)processId, miMode, Logger); } else { // TODO: when we have a tools options page, we can add support for the attach dialog here pretty easily: //var defaultPort = port as IDebugDefaultPort2; //if (defaultPort != null && defaultPort.QueryIsLocal() == Constants.S_OK) //{ // launchOptions = new LocalLaunchOptions(...); //} //else //{ // // Invalid port // throw new ArgumentException(); //} throw new NotSupportedException(); } return(launchOptions); }