Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Support of debugger console

Index: ChangeLog
===================================================================
RCS file: ChangeLog
diff -N ChangeLog
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ChangeLog	23 Oct 2002 18:39:32 -0000
@@ -0,0 +1,6 @@
+2002-10-23 David Inglis
+	
+	* /src/.../launch/internal/CoreFileDelegate.java
+	* /src/.../launch/internal/LocalCLaunchConfigurationDelegate.java
+		create new IProcess for debug console from CDISession and pass
+		to newDebugTarget methods
\ No newline at end of file
Index: src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java,v
retrieving revision 1.7
diff -u -r1.7 CoreFileLaunchDelegate.java
--- src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java	2 Oct 2002 16:20:08 -0000	1.7
+++ src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java	23 Oct 2002 18:39:32 -0000
@@ -17,8 +17,10 @@
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IProcess;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Shell;
@@ -52,16 +54,23 @@
 		if (corefile == null) {
 			cancel("No Corefile selected", ICDTLaunchConfigurationConstants.ERR_NO_COREFILE);
 		}
+		Process debugger = null;
+		IProcess debuggerProcess = null;
 		try {
 			dsession = debugConfig.getDebugger().createCoreSession(config, exe, corefile);
+			debugger = dsession.getSessionProcess();
 		} catch (CDIException e) {
 			abort("Failed Launching CDI Debugger", e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
 		}
-
+		if ( debugger != null ) {
+			debuggerProcess = DebugPlugin.getDefault().newProcess(launch, debugger, "Debug Console");
+			launch.removeProcess(debuggerProcess);
+		}
 		CDebugModel.newCoreFileDebugTarget(
 			launch,
 			dsession.getCurrentTarget(),
 			renderTargetLabel(debugConfig),
+			debuggerProcess,
 			exe.getProject());
 	}

Index: src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java,v
retrieving revision 1.16
diff -u -r1.16 LocalCLaunchConfigurationDelegate.java
--- src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java	1 Oct 2002 18:13:00 -0000	1.16
+++ src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java	23 Oct 2002 18:39:32 -0000
@@ -66,6 +66,8 @@
 		String[] commandArray = (String[]) command.toArray(new String[command.size()]);

 		if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+			IProcess debuggerProcess = null;
+			Process debugger;
 			ICDebugConfiguration debugConfig = getDebugConfig(config);
 			IFile exe = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(projectPath);
 			ICDISession dsession = null;
@@ -86,12 +88,18 @@
 					ICDITarget dtarget = dsession.getTargets()[0];
 					Process process = dtarget.getProcess();
 					IProcess iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(commandArray[0]));
+					debugger =  dsession.getSessionProcess();
+					if ( debugger != null ) {
+						debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console");
+						launch.removeProcess(debuggerProcess);
+					}
 					boolean stopInMain = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false);
 					CDebugModel.newDebugTarget(
 						launch,
 						dsession.getCurrentTarget(),
 						renderTargetLabel(debugConfig),
 						iprocess,
+						debuggerProcess,
 						exe.getProject(),
 						true,
 						false,
@@ -103,10 +111,16 @@
 						cancel("No Process ID selected", ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID);
 					}
 					dsession = debugConfig.getDebugger().createAttachSession(config, exe, pid);
+					debugger = dsession.getSessionProcess();
+					if ( debugger != null ) {
+						debuggerProcess = DebugPlugin.newProcess(launch, debugger, "Debug Console");
+						launch.removeProcess(debuggerProcess);
+					}
 					CDebugModel.newAttachDebugTarget(
 						launch,
 						dsession.getCurrentTarget(),
 						renderTargetLabel(debugConfig),
+						debuggerProcess,
 						exe.getProject());
 				}
 			} catch (CDIException e) {



Back to the top