Пример #1
0
        static internal LocalLaunchOptions CreateFromXml(Xml.LaunchOptions.LocalLaunchOptions source)
        {
            var options = new LocalLaunchOptions(
                RequireAttribute(source.MIDebuggerPath, "MIDebuggerPath"),
                source.MIDebuggerServerAddress,
                source.ProcessId,
                source.Environment);

            options.InitializeCommonOptions(source);
            options.InitializeServerOptions(source);

            return(options);
        }
Пример #2
0
        static internal LocalLaunchOptions CreateFromXml(Xml.LaunchOptions.LocalLaunchOptions source)
        {
            string miDebuggerPath = source.MIDebuggerPath;

            // If no path to the debugger was specified, look for the proper binary in the user's $PATH
            if (String.IsNullOrEmpty(miDebuggerPath))
            {
                string debuggerBinary = null;
                switch (source.MIMode)
                {
                case Xml.LaunchOptions.MIMode.gdb:
                    debuggerBinary = "gdb";
                    break;

                case Xml.LaunchOptions.MIMode.lldb:
                    debuggerBinary = "lldb-mi";
                    break;
                }

                if (!String.IsNullOrEmpty(debuggerBinary))
                {
                    miDebuggerPath = LocalLaunchOptions.ResolveFromPath(debuggerBinary);
                }

                if (String.IsNullOrEmpty(miDebuggerPath))
                {
                    throw new InvalidLaunchOptionsException(MICoreResources.Error_NoMiDebuggerPath);
                }
            }

            var options = new LocalLaunchOptions(
                RequireAttribute(miDebuggerPath, "MIDebuggerPath"),
                source.MIDebuggerServerAddress,
                source.Environment);

            options.InitializeCommonOptions(source);
            options.InitializeServerOptions(source);
            options._useExternalConsole = source.ExternalConsole;

            // when using local options the core dump path must check out
            if (options.IsCoreDump && !LocalLaunchOptions.CheckPath(options.CoreDumpPath))
            {
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, MICoreResources.Error_InvalidLocalExePath, options.CoreDumpPath));
            }

            return(options);
        }
Пример #3
0
        static internal LocalLaunchOptions CreateFromXml(Xml.LaunchOptions.LocalLaunchOptions source)
        {
            var options = new LocalLaunchOptions(
                RequireAttribute(source.MIDebuggerPath, "MIDebuggerPath"),
                source.MIDebuggerServerAddress,
                source.ProcessId,
                source.Environment);

            options.InitializeCommonOptions(source);
            options.InitializeServerOptions(source);
            options.CoreDumpPath        = source.CoreDumpPath;
            options._useExternalConsole = source.ExternalConsole;

            // Ensure that CoreDumpPath and ProcessId are not specified at the same time
            if (!String.IsNullOrEmpty(source.CoreDumpPath) && source.ProcessId != 0)
            {
                throw new InvalidLaunchOptionsException(String.Format(CultureInfo.InvariantCulture, MICoreResources.Error_CannotSpecifyBoth, nameof(source.CoreDumpPath), nameof(source.ProcessId)));
            }

            return(options);
        }
Пример #4
0
        static internal LocalLaunchOptions CreateFromXml(Xml.LaunchOptions.LocalLaunchOptions source)
        {
            string miDebuggerPath = source.MIDebuggerPath;

            // If no path to the debugger was specified, look for the proper binary in the user's $PATH
            if (String.IsNullOrEmpty(miDebuggerPath))
            {
                string debuggerBinary = null;
                switch (source.MIMode)
                {
                    case Xml.LaunchOptions.MIMode.gdb:
                        debuggerBinary = "gdb";
                        break;

                    case Xml.LaunchOptions.MIMode.lldb:
                        debuggerBinary = "lldb-mi";
                        break;
                }

                if (!String.IsNullOrEmpty(debuggerBinary))
                {
                    miDebuggerPath = LocalLaunchOptions.ResolveFromPath(debuggerBinary);
                }

                if (String.IsNullOrEmpty(miDebuggerPath))
                {
                    throw new InvalidLaunchOptionsException(MICoreResources.Error_NoMiDebuggerPath);
                }
            }

            var options = new LocalLaunchOptions(
                RequireAttribute(miDebuggerPath, "MIDebuggerPath"),
                source.MIDebuggerServerAddress,
                source.Environment);
            options.InitializeCommonOptions(source);
            options.InitializeServerOptions(source);
            options._useExternalConsole = source.ExternalConsole;

            // when using local options the core dump path must check out
            if (options.IsCoreDump && !LocalLaunchOptions.CheckFilePath(options.CoreDumpPath))
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, MICoreResources.Error_InvalidLocalExePath, options.CoreDumpPath));

            return options;
        }
Пример #5
0
        static internal LocalLaunchOptions CreateFromXml(Xml.LaunchOptions.LocalLaunchOptions source)
        {
            var options = new LocalLaunchOptions(
                RequireAttribute(source.MIDebuggerPath, "MIDebuggerPath"),
                source.MIDebuggerServerAddress,
                source.ProcessId,
                source.Environment);
            options.InitializeCommonOptions(source);
            options.InitializeServerOptions(source);

            return options;
        }
Пример #6
0
        internal static LocalLaunchOptions CreateFromXml(Xml.LaunchOptions.LocalLaunchOptions source)
        {
            string miDebuggerPath = source.MIDebuggerPath;

            // If no path to the debugger was specified, look for the proper binary in the user's $PATH
            if (String.IsNullOrEmpty(miDebuggerPath))
            {
                string debuggerBinary = null;
                switch (source.MIMode)
                {
                    case Xml.LaunchOptions.MIMode.gdb:
                        debuggerBinary = "gdb";
                        break;

                    case Xml.LaunchOptions.MIMode.lldb:
                        debuggerBinary = "lldb-mi";
                        break;
                }

                if (!String.IsNullOrEmpty(debuggerBinary))
                {
                    miDebuggerPath = LocalLaunchOptions.ResolveFromPath(debuggerBinary);
                }

                if (String.IsNullOrEmpty(miDebuggerPath))
                {
                    throw new InvalidLaunchOptionsException(MICoreResources.Error_NoMiDebuggerPath);
                }
            }

            var options = new LocalLaunchOptions(
                RequireAttribute(miDebuggerPath, "MIDebuggerPath"),
                source.MIDebuggerServerAddress,
                source.ProcessId,
                source.Environment);
            options.InitializeCommonOptions(source);
            options.InitializeServerOptions(source);
            options.CoreDumpPath = source.CoreDumpPath;
            options._useExternalConsole = source.ExternalConsole;

            // Ensure that CoreDumpPath and ProcessId are not specified at the same time
            if (!String.IsNullOrEmpty(source.CoreDumpPath) && source.ProcessId != 0)
                throw new InvalidLaunchOptionsException(String.Format(CultureInfo.InvariantCulture, MICoreResources.Error_CannotSpecifyBoth, nameof(source.CoreDumpPath), nameof(source.ProcessId)));

            return options;
        }
Пример #7
0
        static internal LocalLaunchOptions CreateFromXml(Xml.LaunchOptions.LocalLaunchOptions source)
        {
            var options = new LocalLaunchOptions(
                RequireAttribute(source.MIDebuggerPath, "MIDebuggerPath"),
                source.MIDebuggerServerAddress,
                source.ProcessId,
                source.Environment);
            options.InitializeCommonOptions(source);
            options.InitializeServerOptions(source);
            options.CoreDumpPath = source.CoreDumpPath;

            // Ensure that CoreDumpPath and ProcessId are not specified at the same time
            if (!String.IsNullOrEmpty(source.CoreDumpPath) && source.ProcessId != 0)
                throw new InvalidLaunchOptionsException(String.Format(CultureInfo.InvariantCulture, MICoreResources.Error_CannotSpecifyBoth, nameof(source.CoreDumpPath), nameof(source.ProcessId)));

            return options;
        }