Exemplo n.º 1
0
        internal static void InternalRun(ExecutionCommand cmd, DebuggerEngine factory, IConsole c)
        {
            if (factory == null)
            {
                factory = GetFactoryForCommand(cmd);
                if (factory == null)
                {
                    throw new InvalidOperationException("Unsupported command: " + cmd);
                }
            }

            DebuggerStartInfo startInfo = factory.CreateDebuggerStartInfo(cmd);

            startInfo.UseExternalConsole         = c is ExternalConsole;
            startInfo.CloseExternalConsoleOnExit = c.CloseOnDispose;
            currentEngine = factory;
            session       = factory.CreateSession();
            session.Initialize();
            console = c;

            SetupSession();

            try {
                session.Run(startInfo, GetUserOptions());
            } catch {
                Cleanup();
                throw;
            }
        }
Exemplo n.º 2
0
        internal static void InternalRun(ExecutionCommand cmd, DebuggerEngine factory, IConsole c)
        {
            if (factory == null)
            {
                factory = GetFactoryForCommand(cmd);
                if (factory == null)
                {
                    throw new InvalidOperationException("Unsupported command: " + cmd);
                }
            }

            if (session != null)
            {
                throw new InvalidOperationException("A debugger session is already started");
            }

            DebuggerStartInfo startInfo = factory.CreateDebuggerStartInfo(cmd);

            startInfo.UseExternalConsole         = c is ExternalConsole;
            startInfo.CloseExternalConsoleOnExit = c.CloseOnDispose;
            currentEngine            = factory;
            session                  = factory.CreateSession();
            session.ExceptionHandler = ExceptionHandler;

            // When using an external console, create a new internal console which will be used
            // to show the debugger log
            if (startInfo.UseExternalConsole)
            {
                console = (IConsole)IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor();
            }
            else
            {
                console = c;
            }

            SetupSession();

            // Dispatch synchronously to avoid start/stop races
            DispatchService.GuiSyncDispatch(delegate
            {
                oldLayout = IdeApp.Workbench.CurrentLayout;
                IdeApp.Workbench.CurrentLayout = "Debug";
            });

            try
            {
                session.Run(startInfo, GetUserOptions());
            }
            catch
            {
                Cleanup();
                throw;
            }
        }
Exemplo n.º 3
0
        public static IAsyncOperation AttachToProcess(DebuggerEngine debugger, ProcessInfo proc)
        {
            currentEngine = debugger;
            session       = debugger.CreateSession();
            IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor();

            console = monitor as IConsole;
            SetupSession();
            session.TargetExited += delegate {
                monitor.Dispose();
            };
            session.AttachToProcess(proc, GetUserOptions());
            return(monitor.AsyncOperation);
        }
Exemplo n.º 4
0
        internal static void InternalRun(ExecutionCommand cmd, DebuggerEngine factory, OperationConsole c)
        {
            if (factory == null)
            {
                factory = GetFactoryForCommand(cmd);
                if (factory == null)
                {
                    throw new InvalidOperationException("Unsupported command: " + cmd);
                }
            }

            if (session != null)
            {
                throw new InvalidOperationException("A debugger session is already started");
            }

            DebuggerStartInfo startInfo = factory.CreateDebuggerStartInfo(cmd);

            startInfo.UseExternalConsole = c is ExternalConsole;
            if (startInfo.UseExternalConsole)
            {
                startInfo.CloseExternalConsoleOnExit = ((ExternalConsole)c).CloseOnDispose;
            }
            currentEngine            = factory;
            session                  = factory.CreateSession();
            session.ExceptionHandler = ExceptionHandler;

            // When using an external console, create a new internal console which will be used
            // to show the debugger log
            if (startInfo.UseExternalConsole)
            {
                console = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor().Console;
            }
            else
            {
                console = c;
            }

            SetupSession();

            SetDebugLayout();

            try {
                session.Run(startInfo, GetUserOptions());
            } catch {
                Cleanup();
                throw;
            }
        }
Exemplo n.º 5
0
		internal static void InternalRun (ExecutionCommand cmd, DebuggerEngine factory, IConsole c)
		{
			if (factory == null) {
				factory = GetFactoryForCommand (cmd);
				if (factory == null)
					throw new InvalidOperationException ("Unsupported command: " + cmd);
			}
			
			if (session != null)
				throw new InvalidOperationException ("A debugger session is already started");

			DebuggerStartInfo startInfo = factory.CreateDebuggerStartInfo (cmd);
			startInfo.UseExternalConsole = c is ExternalConsole;
			startInfo.CloseExternalConsoleOnExit = c.CloseOnDispose;
			currentEngine = factory;
			session = factory.CreateSession ();
			session.ExceptionHandler = ExceptionHandler;
			
			// When using an external console, create a new internal console which will be used
			// to show the debugger log
			if (startInfo.UseExternalConsole)
				console = (IConsole) IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
			else
				console = c;
			
			SetupSession ();
			
			// Dispatch synchronously to avoid start/stop races
			DispatchService.GuiSyncDispatch (delegate {
				oldLayout = IdeApp.Workbench.CurrentLayout;
				IdeApp.Workbench.CurrentLayout = "Debug";
			});
			
			try {
				session.Run (startInfo, GetUserOptions ());
			} catch {
				Cleanup ();
				throw;
			}
		}
Exemplo n.º 6
0
		public static IAsyncOperation AttachToProcess (DebuggerEngine debugger, ProcessInfo proc)
		{
			currentEngine = debugger;
			session = debugger.CreateSession ();
			session.ExceptionHandler = ExceptionHandler;
			IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
			console = monitor as IConsole;
			SetupSession ();
			session.TargetExited += delegate {
				monitor.Dispose ();
			};
			session.AttachToProcess (proc, GetUserOptions ());
			return monitor.AsyncOperation;
		}
Exemplo n.º 7
0
		internal static void InternalRun (ExecutionCommand cmd, DebuggerEngine factory, IConsole c)
		{
			if (factory == null) {
				factory = GetFactoryForCommand (cmd);
				if (factory == null)
					throw new InvalidOperationException ("Unsupported command: " + cmd);
			}
			
			DebuggerStartInfo startInfo = factory.CreateDebuggerStartInfo (cmd);
			startInfo.UseExternalConsole = c is ExternalConsole;
			startInfo.CloseExternalConsoleOnExit = c.CloseOnDispose;
			currentEngine = factory;
			session = factory.CreateSession ();
			session.ExceptionHandler = ExceptionHandler;
			session.Initialize ();
			
			// When using an external console, create a new internal console which will be used
			// to show the debugger log
			if (startInfo.UseExternalConsole)
				console = (IConsole) IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor (GettextCatalog.GetString ("Application Output"), Stock.RunProgramIcon, true, true);
			else
				console = c;
			
			SetupSession ();

			try {
				session.Run (startInfo, GetUserOptions ());
			} catch {
				Cleanup ();
				throw;
			}
		}
		internal static void InternalRun (ExecutionCommand cmd, DebuggerEngine factory, IConsole c)
		{
			if (factory == null) {
				factory = GetFactoryForCommand (cmd);
				if (factory == null)
					throw new InvalidOperationException ("Unsupported command: " + cmd);
			}
			
			DebuggerStartInfo startInfo = factory.CreateDebuggerStartInfo (cmd);
			startInfo.UseExternalConsole = c is ExternalConsole;
			startInfo.CloseExternalConsoleOnExit = c.CloseOnDispose;
			currentEngine = factory;
			session = factory.CreateSession ();
			session.Initialize ();
			console = c;
			
			SetupSession ();

			try {
				session.Run (startInfo, GetUserOptions ());
			} catch {
				Cleanup ();
				throw;
			}
		}