[Esbox-commits] r166 - trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/local

raul at garage.maemo.org raul at garage.maemo.org
Tue Oct 23 01:09:03 EEST 2007


Author: raul
Date: 2007-10-23 01:09:02 +0300 (Tue, 23 Oct 2007)
New Revision: 166

Modified:
   trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/local/ESboxLocalRunLaunchDelegate.java
Log:


Modified: trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/local/ESboxLocalRunLaunchDelegate.java
===================================================================
--- trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/local/ESboxLocalRunLaunchDelegate.java	2007-10-22 22:04:45 UTC (rev 165)
+++ trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/local/ESboxLocalRunLaunchDelegate.java	2007-10-22 22:09:02 UTC (rev 166)
@@ -27,6 +27,7 @@
 import org.eclipse.cdt.debug.core.cdi.model.ICDIRuntimeOptions;
 import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
 import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
+import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
 import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
 import org.eclipse.cdt.utils.pty.PTY;
 import org.eclipse.cdt.utils.spawner.ProcessFactory;
@@ -108,56 +109,44 @@
 			if (mode.equals(ILaunchManager.DEBUG_MODE)) {				
 				ICDebugConfiguration debugConfig = getDebugConfig(config);
 				ICDISession dsession = null;
-				String debugMode = config
-				.getAttribute(
-						ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
+				String debugMode = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
 						ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
-				if (debugMode
-						.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) {
-					
-					dsession = debugConfig.createDebugger()
-					.createDebuggerSession(launch, exeFile,
+				if (debugMode.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) {
+					dsession = debugConfig.createDebugger().createDebuggerSession(launch, exeFile,
 							new SubProgressMonitor(monitor, 8));
 					try {
 						try {
 							ICDITarget[] dtargets = dsession.getTargets();
 							for (int i = 0; i < dtargets.length; ++i) {
-								ICDIRuntimeOptions opt = dtargets[i]
-								                                  .getRuntimeOptions();
+								ICDIRuntimeOptions opt = dtargets[i].getRuntimeOptions();
 								opt.setArguments(arguments);
-								
 								if (wd != null) {
-									opt.setWorkingDirectory(wd
-											.getAbsolutePath());
+									opt.setWorkingDirectory(wd.getAbsolutePath());
 								}
-								opt
-								.setEnvironment(getEnvironmentAsProperty(config));
+								opt.setEnvironment(getEnvironmentAsProperty(config));
 							}
 						} catch (CDIException e) {
 							abort(
-									"ESbox Launch failed setting a runtime option through the debugger",
-									e, //$NON-NLS-1$
+									LaunchMessages
+											.getString("LocalRunLaunchDelegate.Failed_setting_runtime_option_though_debugger"), e, //$NON-NLS-1$
 									ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
 						}
 						monitor.worked(1);
 						boolean stopInMain = config
-						.getAttribute(
-								ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN,
-								false);
-						
+								.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false);
+						String stopSymbol = null;
+						if ( stopInMain )
+							stopSymbol = launch.getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT );
+
 						ICDITarget[] targets = dsession.getTargets();
 						for (int i = 0; i < targets.length; i++) {
 							Process process = targets[i].getProcess();
-							
 							IProcess iprocess = null;
 							if (process != null) {
-								iprocess = DebugPlugin.newProcess(launch,
-										process, renderProcessLabel(exePath
-												.toOSString()));
+								iprocess = DebugPlugin.newProcess(launch, process, renderProcessLabel(exePath.toOSString()), getDefaultProcessMap());
 							}
-							CDIDebugModel.newDebugTarget(launch, project.getProject(), targets[i],
-									renderTargetLabel(debugConfig), iprocess,
-									exeFile, true, false, stopInMain, true);
+							CDIDebugModel.newDebugTarget(launch, project.getProject(), targets[i], renderTargetLabel(debugConfig),
+									iprocess, exeFile, true, false, stopSymbol, true);
 						}
 					} catch (CoreException e) {
 						try {
@@ -246,6 +235,7 @@
 			try {
 				String command = "run-standalone.sh " + commandPath.toOSString();
 				fCommandArgs = constructCommandArray(command,args, env, changeToDirectory);
+								
 				PTY pty = new PTY();				
 				fProcess = ProcessFactory.getFactory().exec(fCommandArgs, new String[] {}, changeToDirectory.toFile(), new PTY());				
 			



More information about the Esbox-commits mailing list