[Esbox-commits] r406 - in trunk/org.indt.esbox.launch: . src/org/indt/esbox/launch src/org/indt/esbox/launch/internal/ui src/org/indt/esbox/launch/oprofile src/org/indt/esbox/launch/valgrind

raul at garage.maemo.org raul at garage.maemo.org
Thu Feb 14 21:28:46 EET 2008


Author: raul
Date: 2008-02-14 21:28:34 +0200 (Thu, 14 Feb 2008)
New Revision: 406

Modified:
   trunk/org.indt.esbox.launch/plugin.xml
   trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/AbstractLaunchShortcut.java
   trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/ui/OProfileMainTab.java
   trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/oprofile/OProfileLaunchDelegate.java
   trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/oprofile/OProfileLaunchShortcut.java
   trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/valgrind/ValgrindLaunchDelegate.java
   trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/valgrind/ValgrindLaunchShortcut.java
Log:
bugs related to launching.

Modified: trunk/org.indt.esbox.launch/plugin.xml
===================================================================
--- trunk/org.indt.esbox.launch/plugin.xml	2008-02-14 19:24:42 UTC (rev 405)
+++ trunk/org.indt.esbox.launch/plugin.xml	2008-02-14 19:28:34 UTC (rev 406)
@@ -25,7 +25,7 @@
       </launchConfigurationType>
       <launchConfigurationType
             delegate="org.indt.esbox.launch.oprofile.OProfileLaunchDelegate"
-            id="oprofileLaunchType"
+            id="esboxOprofileLaunchType"
             modes="run"
             name="OProfile Profiler"
             public="true"
@@ -34,7 +34,7 @@
       </launchConfigurationType>
       <launchConfigurationType
             delegate="org.indt.esbox.launch.valgrind.ValgrindLaunchDelegate"
-            id="valgrindLaunchType"
+            id="esboxValgrindLaunchType"
             modes="run"
             name="Valgrind Profiler"
             public="true"
@@ -56,12 +56,12 @@
             id="esboxRemoteLaunchImage">
       </launchConfigurationTypeImage>
       <launchConfigurationTypeImage
-            configTypeID="oprofileLaunchType"
+            configTypeID="esboxOprofileLaunchType"
             icon="icons/maemo_project.png"
             id="oprofileLaunchTypeImage">
       </launchConfigurationTypeImage>
       <launchConfigurationTypeImage
-            configTypeID="valgrindLaunchType"
+            configTypeID="esboxValgrindLaunchType"
             icon="icons/valgrind.png"
             id="valgrindLaunchTypeImage">
       </launchConfigurationTypeImage>
@@ -82,12 +82,12 @@
       <launchConfigurationTabGroup
             class="org.indt.esbox.launch.oprofile.OProfileLaunchConfigurationTabGroup"
             id="oprofileLaunchTabGroup"
-            type="oprofileLaunchType">
+            type="esboxOprofileLaunchType">
       </launchConfigurationTabGroup>
       <launchConfigurationTabGroup
             class="org.indt.esbox.launch.valgrind.ValgrindLaunchConfigurationTabGroup"
             id="valgrindLaunchTabGroup"
-            type="valgrindLaunchType">
+            type="esboxValgrindLaunchType">
       </launchConfigurationTabGroup>
    </extension>
    <extension
@@ -173,7 +173,7 @@
       <shortcut
             class="org.indt.esbox.launch.oprofile.OProfileLaunchShortcut"
             icon="icons/maemo_project.png"
-            id="org.indt.esbox.launch.shortcut1"
+            id="maemoOProfileShortcut"
             label="OProfile Profiler"
             modes="run">
          <contextualLaunch>
@@ -193,13 +193,13 @@
                   mode="run">
             </contextLabel></contextualLaunch>
          <perspective
-               id="org.indt.esbox.launch.perspective2">
+               id="org.eclipse.cdt.ui.CPerspective">
          </perspective>
       </shortcut>
       <shortcut
             class="org.indt.esbox.launch.valgrind.ValgrindLaunchShortcut"
             icon="icons/valgrind.png"
-            id="org.indt.esbox.launch.shortcut2"
+            id="maemoValgrindShortcut"
             label="Valgrind Memory Profiler"
             modes="run">
          <contextualLaunch>
@@ -219,7 +219,7 @@
                   mode="run">
             </contextLabel></contextualLaunch>
          <perspective
-               id="org.indt.esbox.launch.perspective4">
+               id="org.eclipse.cdt.ui.CPerspective">
          </perspective>
       </shortcut>
    </extension>

Modified: trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/AbstractLaunchShortcut.java
===================================================================
--- trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/AbstractLaunchShortcut.java	2008-02-14 19:24:42 UTC (rev 405)
+++ trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/AbstractLaunchShortcut.java	2008-02-14 19:28:34 UTC (rev 406)
@@ -46,7 +46,6 @@
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Shell;
@@ -62,15 +61,9 @@
 	
 	public abstract void launch(IBinary bin, String mode);
 	
-	public void launch(IEditorPart editor, String mode) {
-		searchAndLaunch(new Object[] { editor.getEditorInput()}, mode);
-	}
+	public abstract void launch(IEditorPart editor, String mode);
 
-	public void launch(ISelection selection, String mode) {
-		if (selection instanceof IStructuredSelection) {
-			searchAndLaunch(((IStructuredSelection) selection).toArray(), mode);
-		}
-	}
+	public abstract void launch(ISelection selection, String mode);
 	
 	/**
 	 * Locate a configuration to relaunch for the given type.  If one cannot be found, create one.
@@ -172,9 +165,7 @@
 	 * Method getCLaunchConfigType.
 	 * @return ILaunchConfigurationType
 	 */
-	protected ILaunchConfigurationType getCLaunchConfigType() {		
-		return getLaunchManager().getLaunchConfigurationType(ESboxRemoteRunLaunchDelegate.ESBOX_CONFIG_TYPE); //the ID of the configuration type that we want to link with.
-	}
+	protected abstract ILaunchConfigurationType getCLaunchConfigType();
 
 	protected ILaunchManager getLaunchManager() {
 		return DebugPlugin.getDefault().getLaunchManager();

Modified: trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/ui/OProfileMainTab.java
===================================================================
--- trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/ui/OProfileMainTab.java	2008-02-14 19:24:42 UTC (rev 405)
+++ trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/internal/ui/OProfileMainTab.java	2008-02-14 19:28:34 UTC (rev 406)
@@ -114,9 +114,7 @@
 		}
 		
 		fLocalMountPoint.setText(localMounPoint);
-		fRemoteMountPoint.setText(remoteMounPoint);
-		
-		
+		fRemoteMountPoint.setText(remoteMounPoint);		
 	}
 	
     protected void updateFromConfig(ILaunchConfiguration config) {

Modified: trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/oprofile/OProfileLaunchDelegate.java
===================================================================
--- trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/oprofile/OProfileLaunchDelegate.java	2008-02-14 19:24:42 UTC (rev 405)
+++ trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/oprofile/OProfileLaunchDelegate.java	2008-02-14 19:28:34 UTC (rev 406)
@@ -53,6 +53,8 @@
  */
 public class OProfileLaunchDelegate extends AbstractCLaunchDelegate {
 	
+	public static final String ESBOX_CONFIG_TYPE = "esboxOprofileLaunchType";
+	
 	/* (non-Javadoc)
 	 * @see org.eclipse.cdt.launch.AbstractCLaunchDelegate#getPluginID()
 	 */
@@ -74,6 +76,7 @@
 		}
 		
 		monitor.beginTask("Running OProfile on Device", 10);
+		
 		// check for cancellation
 		if (monitor.isCanceled()) {
 			return;
@@ -109,22 +112,24 @@
 			}
 		}
 		
+		monitor.worked(2);
+		
 		IPath command = new Path(prefs.getString(ESboxPreferenceConstants.SBRSH_EXEC_FILE_LOCATION.toString()));
 		ESboxCommonCommandLauncher launcher = new ESboxCommonCommandLauncher();
 		String program = isRunStandalone ? "run-standalone.sh " : "" + "./" + exePath.lastSegment();
 		String args[] = new String[] { "-d", remoteMounPoint,  program };	
 		
 		String password = promptPassword();
+		if (password == null)
+			return;
 		
-		try{ 
-			monitor.worked(2);
+		try { 
+			monitor.worked(4);
 			
 			startOProfile(password);
-			monitor.worked(4);
+			monitor.worked(6);
 			
 			Process process = launcher.execute(command, args, new String[] { }, new Path(wd.getAbsolutePath()));
-			
-			monitor.worked(6);
 			DebugPlugin.newProcess(launch, process, renderProcessLabel(exePath.toOSString()));
 			
 			monitor.worked(8);
@@ -137,7 +142,6 @@
 		}		
 		
 		monitor.worked(10);
-
 	}
 	
 	private void startOProfile(String password) throws ESboxException {
@@ -251,21 +255,16 @@
 		private String password;
 		
 		public void run() {
-			LaunchActivator.getDefault().getWorkbench().getDisplay().syncExec(new Runnable() {
-				public void run() {
-					// TODO Auto-generated method stub
-					IWorkbenchWindow window = LaunchActivator.getDefault().getWorkbench().getActiveWorkbenchWindow();
-					Shell shell = null;
-					
-					if (window != null)
-						shell = window.getShell();
-					
-					PasswordInputDialog dialog = new PasswordInputDialog(getShell(),"Password","Insert root password to execute commands with superuser privileges");
-					if (dialog.open() == Window.OK)
-						password = dialog.getPassword();
-				}
-			});
+			// TODO Auto-generated method stub
+			IWorkbenchWindow window = LaunchActivator.getDefault().getWorkbench().getActiveWorkbenchWindow();
+			Shell shell = null;
 			
+			if (window != null)
+				shell = window.getShell();
+			
+			PasswordInputDialog dialog = new PasswordInputDialog(getShell(),"Password","Insert root password to execute commands with superuser privileges");
+			if (dialog.open() == Window.OK)
+				password = dialog.getPassword();			
 		}
 		
 		public String getPassword() {

Modified: trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/oprofile/OProfileLaunchShortcut.java
===================================================================
--- trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/oprofile/OProfileLaunchShortcut.java	2008-02-14 19:24:42 UTC (rev 405)
+++ trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/oprofile/OProfileLaunchShortcut.java	2008-02-14 19:28:34 UTC (rev 406)
@@ -15,6 +15,7 @@
 import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
 import org.eclipse.debug.ui.DebugUITools;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -47,5 +48,10 @@
 			LaunchUIPlugin.errorDialog(LaunchMessages.getString("CApplicationLaunchShortcut.LaunchFailed"), e.getStatus());  //$NON-NLS-1$
 		}
 	}
+	
+	@Override
+	protected ILaunchConfigurationType getCLaunchConfigType() {		
+		return getLaunchManager().getLaunchConfigurationType(""); //the ID of the configuration type that we want to link with.
+	}	
 
 }

Modified: trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/valgrind/ValgrindLaunchDelegate.java
===================================================================
--- trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/valgrind/ValgrindLaunchDelegate.java	2008-02-14 19:24:42 UTC (rev 405)
+++ trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/valgrind/ValgrindLaunchDelegate.java	2008-02-14 19:28:34 UTC (rev 406)
@@ -37,6 +37,8 @@
  */
 public class ValgrindLaunchDelegate extends AbstractCLaunchDelegate {
 
+	public static final String ESBOX_CONFIG_TYPE = "esboxValgrindLaunchType";
+	
 	/* (non-Javadoc)
 	 * @see org.eclipse.cdt.launch.AbstractCLaunchDelegate#getPluginID()
 	 */
@@ -55,7 +57,8 @@
 			monitor = new NullProgressMonitor();
 		}
 		
-		monitor.beginTask("Launching the application on Device", 10);
+		monitor.beginTask("Running Valgrind profiler", 8);
+		
 		// check for cancellation
 		if (monitor.isCanceled()) {
 			return;
@@ -66,6 +69,8 @@
 		ITool valgrind = ESboxToolEngine.getInstance().getTool("Valgrind")[0];		
 		ToolRunnerInfo valgrindInfo = null;
 		
+		monitor.worked(2);
+		
 		try {
 			valgrindInfo = valgrind.getProvider().getRunner().createToolRunnerInfo();
 		} catch (ESboxException e) {
@@ -82,6 +87,8 @@
 			cmdArray.add(args[i]);
 		}
 		
+		monitor.worked(4);
+		
 		LaunchActivator.getDefault().getWorkbench().getDisplay().syncExec(new Runnable() {
 			public void run() {
 				try {
@@ -102,8 +109,10 @@
 			e.printStackTrace();
 		}
 		
-		monitor.worked(3);
+		monitor.worked(6);
 		DebugPlugin.newProcess(launch, process, renderProcessLabel(exePath.toOSString()));
+		
+		monitor.worked(8);
 	}
 
 }

Modified: trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/valgrind/ValgrindLaunchShortcut.java
===================================================================
--- trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/valgrind/ValgrindLaunchShortcut.java	2008-02-14 19:24:42 UTC (rev 405)
+++ trunk/org.indt.esbox.launch/src/org/indt/esbox/launch/valgrind/ValgrindLaunchShortcut.java	2008-02-14 19:28:34 UTC (rev 406)
@@ -15,6 +15,7 @@
 import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
 import org.eclipse.debug.ui.DebugUITools;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -47,5 +48,10 @@
 			LaunchUIPlugin.errorDialog(LaunchMessages.getString("CApplicationLaunchShortcut.LaunchFailed"), e.getStatus());  //$NON-NLS-1$
 		}
 	}
+
+	@Override
+	protected ILaunchConfigurationType getCLaunchConfigType() {		
+		return getLaunchManager().getLaunchConfigurationType(""); //the ID of the configuration type that we want to link with.
+	}	
 	
 }



More information about the Esbox-commits mailing list