mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-02 06:35:28 +02:00
Bug 244567 Make the executable optional in the Main launch tab, when doing an attach session.
The project is still mandatory for two reasons: 1- platform does not allow an empty project 2- Source lookup was not able to find the code with an empty project; since the platform did not allow for an empty project anyway, I did not investigate the source lookup issue.
This commit is contained in:
parent
7c38e68d1d
commit
0ea73d63b0
4 changed files with 30 additions and 10 deletions
|
@ -527,9 +527,6 @@ public class CMainTab extends CLaunchConfigurationTab {
|
|||
setErrorMessage(null);
|
||||
setMessage(null);
|
||||
|
||||
if (dontCheckProgram)
|
||||
return true;
|
||||
|
||||
String name = fProjText.getText().trim();
|
||||
if (name.length() == 0) {
|
||||
setErrorMessage(LaunchMessages.getString("CMainTab.Project_not_specified")); //$NON-NLS-1$
|
||||
|
@ -545,6 +542,9 @@ public class CMainTab extends CLaunchConfigurationTab {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (dontCheckProgram)
|
||||
return true;
|
||||
|
||||
name = fProgText.getText().trim();
|
||||
if (name.length() == 0) {
|
||||
setErrorMessage(LaunchMessages.getString("CMainTab.Program_not_specified")); //$NON-NLS-1$
|
||||
|
|
|
@ -24,7 +24,7 @@ public class GdbAttachLaunchConfigurationTabGroup extends AbstractLaunchConfigur
|
|||
*/
|
||||
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
|
||||
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
|
||||
new CMainTab(),
|
||||
new CMainTab(2), // In some case, we don't need to specify an executable
|
||||
// We don't know yet if we are going to do a remote or local session
|
||||
new CDebuggerTab(null, true),
|
||||
new SourceLookupTab(),
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.core.runtime.IPath;
|
|||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.Sequence;
|
||||
|
@ -98,12 +99,30 @@ public class GdbLaunchDelegate extends LaunchConfigurationDelegate
|
|||
monitor.subTask( "Debugging local C/C++ application" ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
IPath exePath = new Path(""); //$NON-NLS-1$
|
||||
// An attach session does not need to necessarily have an
|
||||
// executable specified. This is because:
|
||||
// - In remote multi-process attach, there will be more than one executable
|
||||
// In this case executables need to be specified differently.
|
||||
// The current solution is to use the solib-search-path to specify
|
||||
// the path of any executable we can attach to.
|
||||
// - In local single process, GDB has the ability to find the executable
|
||||
// automatically.
|
||||
//
|
||||
// An attach session also does not need to necessarily have a project
|
||||
// specified. This is because we can perform source lookup towards
|
||||
// code that is outside the workspace.
|
||||
// However, the Platform does not support this, so for now, we check
|
||||
// See bug 244567
|
||||
|
||||
// First verify we are dealing with a proper project.
|
||||
ICProject project = LaunchUtils.verifyCProject(config);
|
||||
// Now verify we know the program to debug.
|
||||
IPath exePath = LaunchUtils.verifyProgramPath(config, project);
|
||||
// Finally, make sure the program is a proper binary.
|
||||
LaunchUtils.verifyBinary(config, exePath);
|
||||
ICProject project = LaunchUtils.verifyCProject(config);
|
||||
if (!attach) {
|
||||
// Now verify we know the program to debug.
|
||||
exePath = LaunchUtils.verifyProgramPath(config, project);
|
||||
// Finally, make sure the program is a proper binary.
|
||||
LaunchUtils.verifyBinary(config, exePath);
|
||||
}
|
||||
|
||||
monitor.worked( 1 );
|
||||
|
||||
|
|
|
@ -55,9 +55,10 @@ public class LaunchUtils {
|
|||
if (name == null) {
|
||||
abort(LaunchMessages.getString("AbstractCLaunchDelegate.C_Project_not_specified"), null, //$NON-NLS-1$
|
||||
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT);
|
||||
return null;
|
||||
}
|
||||
ICProject cproject = getCProject(configuration);
|
||||
if (cproject == null) {
|
||||
if (cproject == null && name.length() > 0) {
|
||||
IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
|
||||
if (!proj.exists()) {
|
||||
abort(
|
||||
|
|
Loading…
Add table
Reference in a new issue