Esempio n. 1
0
        static internal LocalLaunchOptions CreateFromXml(Xml.LaunchOptions.LocalLaunchOptions source)
        {
            var options = new LocalLaunchOptions(RequireAttribute(source.MIDebuggerPath, "MIDebuggerPath"), source.MIDebuggerServerAddress);

            options.InitializeCommonOptions(source);

            return(options);
        }
Esempio n. 2
0
 private void InitializeServerOptions(Xml.LaunchOptions.LocalLaunchOptions source)
 {
     if (!String.IsNullOrWhiteSpace(source.DebugServer))
     {
         DebugServer     = source.DebugServer;
         DebugServerArgs = source.DebugServerArgs;
         ServerStarted   = source.ServerStarted;
         FilterStderr    = source.FilterStderr;
         FilterStdout    = source.FilterStdout;
         if (!FilterStderr && !FilterStdout)
         {
             FilterStdout = true;    // no pattern source specified, use stdout
         }
         ServerLaunchTimeout = source.ServerLaunchTimeoutSpecified ? source.ServerLaunchTimeout : DefaultLaunchTimeout;
     }
 }
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }