Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 121414 Details for
Bug 181517
[usability] Specify commands to be run before remote application launch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
solution
remotecdt-prelaunchCmds.diff (text/plain), 12.94 KB, created by
Anna Dushistova
on 2009-01-01 14:13:43 EST
(
hide
)
Description:
solution
Filename:
MIME Type:
Creator:
Anna Dushistova
Created:
2009-01-01 14:13:43 EST
Size:
12.94 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.remotecdt >Index: src/org/eclipse/rse/internal/remotecdt/Messages.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/Messages.java,v >retrieving revision 1.5 >diff -u -r1.5 Messages.java >--- src/org/eclipse/rse/internal/remotecdt/Messages.java 25 Sep 2008 19:30:25 -0000 1.5 >+++ src/org/eclipse/rse/internal/remotecdt/Messages.java 1 Jan 2009 19:09:42 -0000 >@@ -10,6 +10,7 @@ > * Ewa Matejska (PalmSource) - [158783] browse button for cdt remote path > * Johann Draschwandtner (Wind River) - [231827][remotecdt]Auto-compute default for Remote path > * Anna Dushistova (MontaVista) - [244173][remotecdt][nls] Externalize Strings in RemoteRunLaunchDelegate >+ * Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch > *******************************************************************************/ > package org.eclipse.rse.internal.remotecdt; > >@@ -26,6 +27,8 @@ > > public static String Remote_GDB_Debugger_Options; > >+ public static String RemoteCMainTab_Prerun; >+ > public static String RemoteCMainTab_Program; > > public static String RemoteCMainTab_Remote_Path_Browse_Button; >Index: src/org/eclipse/rse/internal/remotecdt/IRemoteConnectionConfigurationConstants.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/IRemoteConnectionConfigurationConstants.java,v >retrieving revision 1.1 >diff -u -r1.1 IRemoteConnectionConfigurationConstants.java >--- src/org/eclipse/rse/internal/remotecdt/IRemoteConnectionConfigurationConstants.java 29 Mar 2007 12:01:16 -0000 1.1 >+++ src/org/eclipse/rse/internal/remotecdt/IRemoteConnectionConfigurationConstants.java 1 Jan 2009 19:09:42 -0000 >@@ -1,12 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2006 PalmSource, Inc. >+ * Copyright (c) 2006 PalmSource, Inc. and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Ewa Matejska (PalmSource) - Adapted from IGDBServerMILaunchConfigurationConstants >+ * Ewa Matejska (PalmSource) - Adapted from IGDBServerMILaunchConfigurationConstants >+ * Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch > *******************************************************************************/ > > >@@ -40,4 +41,7 @@ > public static final String ATTR_SKIP_DOWNLOAD_TO_TARGET = > DebugPlugin.getUniqueIdentifier() + ".ATTR_SKIP_DOWNLOAD_TO_TARGET"; //$NON-NLS-1$ > >+ >+ public static final String ATTR_PRERUN_COMMANDS = DebugPlugin.getUniqueIdentifier() + ".ATTR_PRERUN_CMDS"; //$NON-NLS-1$ >+ > } >Index: src/org/eclipse/rse/internal/remotecdt/messages.properties >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/messages.properties,v >retrieving revision 1.5 >diff -u -r1.5 messages.properties >--- src/org/eclipse/rse/internal/remotecdt/messages.properties 25 Sep 2008 19:30:25 -0000 1.5 >+++ src/org/eclipse/rse/internal/remotecdt/messages.properties 1 Jan 2009 19:09:42 -0000 >@@ -10,6 +10,7 @@ > # Ewa Matejska (PalmSource) - [158783] browse button for cdt remote path > # Johann Draschwandtner (Wind River) - [231827][remotecdt]Auto-compute default for Remote path > # Anna Dushistova (MontaVista) - [244173][remotecdt][nls] Externalize Strings in RemoteRunLaunchDelegate >+# Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch > ################################################################################ > > # NLS_MESSAGEFORMAT_VAR >@@ -29,6 +30,7 @@ > RemoteRunLaunchDelegate_8=Executing {0} {1} > RemoteRunLaunchDelegate_9=Starting Program > >+RemoteCMainTab_Prerun=Commands to execute before application > RemoteCMainTab_Program=Remote Absolute File Path for C/C++ Application: > RemoteCMainTab_SkipDownload=Skip download to target path. > Remote_GDB_Debugger_Options=Remote GDB Debugger Options >Index: src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java,v >retrieving revision 1.11 >diff -u -r1.11 RemoteCMainTab.java >--- src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java 26 May 2008 14:38:09 -0000 1.11 >+++ src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java 1 Jan 2009 19:09:42 -0000 >@@ -6,13 +6,14 @@ > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: >- * Ewa Matejska (PalmSource) - initial API and implementation >- * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry >- * Martin Oberhuber (Wind River) - [196934] hide disabled system types in remotecdt combo >- * Yu-Fen Kuo (MontaVista) - [190613] Fix NPE in Remotecdt when RSEUIPlugin has not been loaded >- * Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code >+ * Ewa Matejska (PalmSource) - initial API and implementation >+ * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry >+ * Martin Oberhuber (Wind River) - [196934] hide disabled system types in remotecdt combo >+ * Yu-Fen Kuo (MontaVista) - [190613] Fix NPE in Remotecdt when RSEUIPlugin has not been loaded >+ * Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code > * Johann Draschwandtner (Wind River) - [231827][remotecdt]Auto-compute default for Remote path > * Johann Draschwandtner (Wind River) - [233057][remotecdt]Fix button enablement >+ * Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch > *******************************************************************************/ > > package org.eclipse.rse.internal.remotecdt; >@@ -63,6 +64,7 @@ > private static final String SKIP_DOWNLOAD_BUTTON_TEXT = Messages.RemoteCMainTab_SkipDownload; > private static final String REMOTE_PROG_TEXT_ERROR = Messages.RemoteCMainTab_ErrorNoProgram; > private static final String CONNECTION_TEXT_ERROR = Messages.RemoteCMainTab_ErrorNoConnection; >+ private static final String PRE_RUN_LABEL_TEXT = Messages.RemoteCMainTab_Prerun; > > /* Defaults */ > private static final String REMOTE_PATH_DEFAULT = EMPTY_STRING; >@@ -81,6 +83,8 @@ > private static int initializedRSE = 0; //0=not initialized; -1=initializing; 1=initialized > > SystemNewConnectionAction action = null; >+ private Text preRunText; >+ private Label preRunLabel; > > public RemoteCMainTab(boolean terminalOption) { > super(terminalOption); >@@ -241,6 +245,25 @@ > updateLaunchConfigurationDialog(); > } > }); >+ >+ //Commands to run before execution >+ preRunLabel = new Label(mainComp, SWT.NONE); >+ preRunLabel.setText(PRE_RUN_LABEL_TEXT); >+ gd = new GridData(); >+ gd.horizontalSpan = 2; >+ preRunLabel.setLayoutData(gd); >+ >+ preRunText = new Text(mainComp, SWT.MULTI | SWT.BORDER); >+ gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd.horizontalSpan = 2; >+ preRunText.setLayoutData(gd); >+ preRunText.addModifyListener(new ModifyListener() { >+ >+ public void modifyText(ModifyEvent evt) { >+ updateLaunchConfigurationDialog(); >+ } >+ }); >+ > } > > /* >@@ -279,6 +302,7 @@ > remoteProgText.getText()); > config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_SKIP_DOWNLOAD_TO_TARGET, > skipDownloadButton.getSelection()); >+ config.setAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, preRunText.getText()); > super.performApply(config); > } > >@@ -514,6 +538,15 @@ > // Ignore > } > remoteProgText.setText(targetPath); >+ >+ String prelaunchCmd = null; >+ try { >+ prelaunchCmd = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, >+ ""); //$NON-NLS-1$ >+ } catch (CoreException e) { >+ // Ignore >+ } >+ preRunText.setText(prelaunchCmd); > } > > protected void updateSkipDownloadFromConfig(ILaunchConfiguration config) { >Index: src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java,v >retrieving revision 1.9 >diff -u -r1.9 RemoteRunLaunchDelegate.java >--- src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java 25 Sep 2008 19:30:25 -0000 1.9 >+++ src/org/eclipse/rse/internal/remotecdt/RemoteRunLaunchDelegate.java 1 Jan 2009 19:09:42 -0000 >@@ -13,6 +13,7 @@ > * Anna Dushistova (MontaVista) - [234490][remotecdt] Launching with disconnected target fails > * Anna Dushistova (MontaVista) - [235298][remotecdt] Further improve progress reporting and cancellation of Remote CDT Launch > * Anna Dushistova (MontaVista) - [244173][remotecdt][nls] Externalize Strings in RemoteRunLaunchDelegate >+ * Anna Dushistova (MontaVista) - [181517][usability] Specify commands to be run before remote application launch > *******************************************************************************/ > > >@@ -82,6 +83,7 @@ > > String arguments = getProgramArguments(config); > String remoteExePath = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_REMOTE_PATH, ""); //$NON-NLS-1$ >+ String prelaunchCmd = config.getAttribute(IRemoteConnectionConfigurationConstants.ATTR_PRERUN_COMMANDS, ""); //$NON-NLS-1$ > > if(monitor==null) > monitor = new NullProgressMonitor(); >@@ -111,7 +113,7 @@ > if(arguments != null && !arguments.equals("")) //$NON-NLS-1$ > command_arguments += " " + arguments; //$NON-NLS-1$ > monitor.setTaskName(Messages.RemoteRunLaunchDelegate_9); >- remoteShellProcess = remoteShellExec(config, gdbserver_command, >+ remoteShellProcess = remoteShellExec(config, prelaunchCmd,gdbserver_command, > command_arguments, new SubProgressMonitor(monitor, 5)); > DebugPlugin.newProcess(launch, remoteShellProcess, Messages.RemoteRunLaunchDelegate_RemoteShell); > >@@ -174,11 +176,9 @@ > remoteFileDownload(config, launch, exePath.toString(),remoteExePath, new SubProgressMonitor(monitor,80)); > // Use a remote shell to launch the binary. > monitor.setTaskName(Messages.RemoteRunLaunchDelegate_12); >- remoteProcess = remoteShellExec(config, remoteExePath, arguments, new SubProgressMonitor(monitor,20)); >+ remoteProcess = remoteShellExec(config, prelaunchCmd, remoteExePath, arguments, new SubProgressMonitor(monitor,20)); > DebugPlugin.newProcess(launch, remoteProcess, renderProcessLabel(exePath.toOSString())); > } catch (CoreException e) { >- if(remoteProcess != null) >- remoteProcess.destroy(); > throw e; > } finally { > monitor.done(); >@@ -270,7 +270,7 @@ > fileService.upload(file, remotePath.removeLastSegments(1).toString(), remotePath.lastSegment(), > true, null, null, new SubProgressMonitor(monitor, 85)); > // Need to change the permissions to match the original file permissions because of a bug in upload >- Process p = remoteShellExec(config, "chmod", "+x " + spaceEscapify(remotePath.toString()), new SubProgressMonitor(monitor, 5)); //$NON-NLS-1$ //$NON-NLS-2$ >+ Process p = remoteShellExec(config,"", "chmod", "+x " + spaceEscapify(remotePath.toString()), new SubProgressMonitor(monitor, 5)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ > Thread.sleep(500); > p.destroy(); > } catch (SystemOperationCancelledException e) { >@@ -288,7 +288,7 @@ > return currentConnection.getHostName(); > } > >- protected Process remoteShellExec(ILaunchConfiguration config, String remoteCommandPath, >+ protected Process remoteShellExec(ILaunchConfiguration config, String prelaunchCmd, String remoteCommandPath, > String arguments, IProgressMonitor monitor) throws CoreException { > // The exit command is called to force the remote shell to close after our command > // is executed. This is to prevent a running process at the end of the debug session. >@@ -296,8 +296,11 @@ > monitor.beginTask(NLS.bind(Messages.RemoteRunLaunchDelegate_8, remoteCommandPath,arguments), 10); > String real_remote_command = arguments == null ? spaceEscapify(remoteCommandPath) : > spaceEscapify(remoteCommandPath) + " " + arguments; //$NON-NLS-1$ >+ > String remote_command = real_remote_command + CMD_DELIMITER + EXIT_CMD; > >+ if(!prelaunchCmd.trim().equals("")) //$NON-NLS-1$ >+ remote_command = prelaunchCmd + CMD_DELIMITER + remote_command; > > IShellService shellService = (IShellService) getConnectedRemoteService(config, SHELL_SERVICE, new SubProgressMonitor(monitor,7)); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 181517
:
121082
| 121414