Exemple #1
0
        /// <summary>
        /// Compilation test, do not execute.
        /// Verify that types relied upon by launcher extensions are exported by MIEngine in current build.
        /// Don't change this test without checking with C++ team.
        /// </summary>
        public void VerifyCoreApisPresent()
        {
            LaunchOptions launchOptions = new LocalLaunchOptions("/usr/bin/gdb", "10.10.10.10:2345");

            launchOptions.ExePath = @"c:\users\me\myapp.out";
            launchOptions.AdditionalSOLibSearchPath = @"c:\temp;e:\foo\bar";
            launchOptions.TargetArchitecture        = TargetArchitecture.ARM;
            launchOptions.WorkingDirectory          = "/home/user";
            launchOptions.DebuggerMIMode            = MIMode.Gdb;
            launchOptions.WaitDynamicLibLoad        = false;
            launchOptions.VisualizerFile            = @"c:\myproject\file.natvis";
            launchOptions.SourceMap   = new ReadOnlyCollection <SourceMapEntry>(new List <SourceMapEntry>());
            launchOptions.Environment = new ReadOnlyCollection <EnvironmentEntry>(new List <EnvironmentEntry>());
            Microsoft.DebugEngineHost.HostConfigurationStore configStore = null;
            IDeviceAppLauncherEventCallback eventCallback = null;
            IPlatformAppLauncher            iLauncher     = null;
            IPlatformAppLauncherSerializer  iSerializer   = null;

            iLauncher.Initialize(configStore, eventCallback);
            iLauncher.OnResume();
            iLauncher.SetLaunchOptions(string.Empty, string.Empty, string.Empty, (object)null, TargetEngine.Native);
            iLauncher.SetupForDebugging(out launchOptions);
            iLauncher.Dispose();
            XmlSerializer serializer = iSerializer.GetXmlSerializer("foobar");
        }
Exemple #2
0
        private static LaunchOptions ExecuteLauncher(HostConfigurationStore configStore, IPlatformAppLauncher deviceAppLauncher, string exePath, string args, string dir, object launcherXmlOptions, IDeviceAppLauncherEventCallback eventCallback, TargetEngine targetEngine, Logger logger)
        {
            bool success = false;

            try
            {
                try
                {
                    deviceAppLauncher.Initialize(configStore, eventCallback);
                    deviceAppLauncher.SetLaunchOptions(exePath, args, dir, launcherXmlOptions, targetEngine);
                }
                catch (Exception e) when (!(e is InvalidLaunchOptionsException) && ExceptionHelper.BeforeCatch(e, logger, reportOnlyCorrupting: true))
                {
                    throw new InvalidLaunchOptionsException(e.Message);
                }

                LaunchOptions debuggerLaunchOptions;
                deviceAppLauncher.SetupForDebugging(out debuggerLaunchOptions);
                debuggerLaunchOptions.DeviceAppLauncher = deviceAppLauncher;

                success = true;
                return debuggerLaunchOptions;
            }
            finally
            {
                if (!success)
                {
                    deviceAppLauncher.Dispose();
                }
            }
        }