1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

added missing copyright

This commit is contained in:
David Inglis 2004-06-10 15:15:51 +00:00
parent 6ffa80bd87
commit e661886b30
20 changed files with 405 additions and 258 deletions

View file

@ -1,9 +1,9 @@
###################################################################### ######################################################################
# Copyright (c) 2002 QNX Software Systems Ltd. and others. # Copyright (c) 2002 - 2004 QNX Software Systems Ltd. and others.
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Common Public License v0.5 # are made available under the terms of the Common Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/cpl-v05.html # http://www.eclipse.org/legal/cpl-v10.html
# #
# Contributors: # Contributors:
# QNX Software Systems Ltd. - Initial implementation # QNX Software Systems Ltd. - Initial implementation

View file

@ -1,6 +1,13 @@
/* /**********************************************************************
* (c) Copyright QNX Software System Ltd. 2002. All Rights Reserved. * Copyright (c) 2002 - 2004 QNX Software Systems and others.
*/ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch; package org.eclipse.cdt.launch;
import java.io.File; import java.io.File;
@ -64,13 +71,14 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
throws CoreException; throws CoreException;
/** /**
* Return the save environment variables in the configuration. The array does not include the default environment of the target. * Return the save environment variables in the configuration. The array
* array[n] : name=value * does not include the default environment of the target. array[n] :
* name=value
*/ */
protected String[] getEnvironmentArray(ILaunchConfiguration config) { protected String[] getEnvironmentArray(ILaunchConfiguration config) {
Map env = null; Map env = null;
try { try {
env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null); env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map)null);
} catch (CoreException e) { } catch (CoreException e) {
} }
if (env == null) { if (env == null) {
@ -80,21 +88,21 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
Iterator entries = env.entrySet().iterator(); Iterator entries = env.entrySet().iterator();
Entry entry; Entry entry;
for (int i = 0; entries.hasNext() && i < array.length; i++) { for (int i = 0; entries.hasNext() && i < array.length; i++) {
entry = (Entry) entries.next(); entry = (Entry)entries.next();
array[i] = ((String) entry.getKey()) + "=" + ((String) entry.getValue()); //$NON-NLS-1$ array[i] = ((String)entry.getKey()) + "=" + ((String)entry.getValue()); //$NON-NLS-1$
} }
return array; return array;
} }
/** /**
* Return the save environment variables of this configuration. The array does not include the default environment of the * Return the save environment variables of this configuration. The array
* target. * does not include the default environment of the target.
*/ */
protected Properties getEnvironmentProperty(ILaunchConfiguration config) { protected Properties getEnvironmentProperty(ILaunchConfiguration config) {
Properties prop = new Properties(); Properties prop = new Properties();
Map env = null; Map env = null;
try { try {
env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null); env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map)null);
} catch (CoreException e) { } catch (CoreException e) {
} }
if (env == null) if (env == null)
@ -102,8 +110,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
Iterator entries = env.entrySet().iterator(); Iterator entries = env.entrySet().iterator();
Entry entry; Entry entry;
while (entries.hasNext()) { while (entries.hasNext()) {
entry = (Entry) entries.next(); entry = (Entry)entries.next();
prop.setProperty((String) entry.getKey(), (String) entry.getValue()); prop.setProperty((String)entry.getKey(), (String)entry.getValue());
} }
return prop; return prop;
} }
@ -116,22 +124,22 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
/** /**
* Expand the variable with the format ${key}. example: HOME=/foobar NEWHOME = ${HOME}/project The environement NEWHOME will be * Expand the variable with the format ${key}. example: HOME=/foobar NEWHOME =
* /foobar/project. * ${HOME}/project The environement NEWHOME will be /foobar/project.
*/ */
protected Properties expandEnvironment(ILaunchConfiguration config) { protected Properties expandEnvironment(ILaunchConfiguration config) {
return expandEnvironment(getEnvironmentProperty(config)); return expandEnvironment(getEnvironmentProperty(config));
} }
/** /**
* Expand the variable with the format ${key}. example: HOME=/foobar NEWHOME = ${HOME}/project The environement NEWHOME will be * Expand the variable with the format ${key}. example: HOME=/foobar NEWHOME =
* /foobar/project. * ${HOME}/project The environement NEWHOME will be /foobar/project.
*/ */
protected Properties expandEnvironment(Properties props) { protected Properties expandEnvironment(Properties props) {
Enumeration names = props.propertyNames(); Enumeration names = props.propertyNames();
if (names != null) { if (names != null) {
while (names.hasMoreElements()) { while (names.hasMoreElements()) {
String key = (String) names.nextElement(); String key = (String)names.nextElement();
String value = props.getProperty(key); String value = props.getProperty(key);
if (value != null && value.indexOf('$') != -1) { if (value != null && value.indexOf('$') != -1) {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
@ -170,7 +178,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
String v = null; String v = null;
String p = param.toString(); String p = param.toString();
/* /*
* Search in the current property only if it is not the same name. * Search in the current property only if it
* is not the same name.
*/ */
if (!p.equals(key)) { if (!p.equals(key)) {
v = props.getProperty(p); v = props.getProperty(p);
@ -197,7 +206,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
sb.append(ch); sb.append(ch);
} else { } else {
/* Do not had the '{' */ /* Do not had the '{' */
if (!(ch == '{' && prev == '$')) { if (! (ch == '{' && prev == '$')) {
param.append(ch); param.append(ch);
} }
} }
@ -211,12 +220,14 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
/** /**
* Returns the working directory specified by the given launch configuration, or <code>null</code> if none. * Returns the working directory specified by the given launch
* configuration, or <code>null</code> if none.
* *
* @deprecated Should use getWorkingDirectory() * @deprecated Should use getWorkingDirectory()
* @param configuration * @param configuration
* launch configuration * launch configuration
* @return the working directory specified by the given launch configuration, or <code>null</code> if none * @return the working directory specified by the given launch
* configuration, or <code>null</code> if none
* @exception CoreException * @exception CoreException
* if unable to retrieve the attribute * if unable to retrieve the attribute
*/ */
@ -225,11 +236,13 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
/** /**
* Returns the working directory specified by the given launch configuration, or <code>null</code> if none. * Returns the working directory specified by the given launch
* configuration, or <code>null</code> if none.
* *
* @param configuration * @param configuration
* launch configuration * launch configuration
* @return the working directory specified by the given launch configuration, or <code>null</code> if none * @return the working directory specified by the given launch
* configuration, or <code>null</code> if none
* @exception CoreException * @exception CoreException
* if unable to retrieve the attribute * if unable to retrieve the attribute
*/ */
@ -238,7 +251,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
protected IPath getWorkingDirectoryPath(ILaunchConfiguration config) throws CoreException { protected IPath getWorkingDirectoryPath(ILaunchConfiguration config) throws CoreException {
String path = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); String path = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
if (path != null) { if (path != null) {
return new Path(path); return new Path(path);
} }
@ -246,12 +259,14 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
/** /**
* Throws a core exception with an error status object built from the given message, lower level exception, and error code. * Throws a core exception with an error status object built from the given
* message, lower level exception, and error code.
* *
* @param message * @param message
* the status message * the status message
* @param exception * @param exception
* lower level exception associated with the error, or <code>null</code> if none * lower level exception associated with the error, or
* <code>null</code> if none
* @param code * @param code
* error code * error code
*/ */
@ -284,16 +299,17 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
public static String getProjectName(ILaunchConfiguration configuration) throws CoreException { public static String getProjectName(ILaunchConfiguration configuration) throws CoreException {
return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null); return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
} }
public static String getProgramName(ILaunchConfiguration configuration) throws CoreException { public static String getProgramName(ILaunchConfiguration configuration) throws CoreException {
return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) null); return configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String)null);
} }
/** /**
* Assigns a default source locator to the given launch if a source locator has not yet been assigned to it, and the associated * Assigns a default source locator to the given launch if a source locator
* launch configuration does not specify a source locator. * has not yet been assigned to it, and the associated launch configuration
* does not specify a source locator.
* *
* @param launch * @param launch
* launch object * launch object
@ -306,7 +322,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
// set default source locator if none specified // set default source locator if none specified
if (launch.getSourceLocator() == null) { if (launch.getSourceLocator() == null) {
IPersistableSourceLocator sourceLocator; IPersistableSourceLocator sourceLocator;
String id = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String) null); String id = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
if (id == null) { if (id == null) {
ICProject cProject = getCProject(configuration); ICProject cProject = getCProject(configuration);
if (cProject == null) { if (cProject == null) {
@ -317,7 +333,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
sourceLocator.initializeDefaults(configuration); sourceLocator.initializeDefaults(configuration);
} else { } else {
sourceLocator = DebugPlugin.getDefault().getLaunchManager().newSourceLocator(id); sourceLocator = DebugPlugin.getDefault().getLaunchManager().newSourceLocator(id);
String memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String) null); String memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
if (memento == null) { if (memento == null) {
sourceLocator.initializeDefaults(configuration); sourceLocator.initializeDefaults(configuration);
} else { } else {
@ -334,7 +350,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* @return the program arguments as a String * @return the program arguments as a String
*/ */
public String getProgramArguments(ILaunchConfiguration config) throws CoreException { public String getProgramArguments(ILaunchConfiguration config) throws CoreException {
return config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null); return config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null);
} }
/** /**
@ -394,7 +410,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
protected String renderDebuggerProcessLabel() { protected String renderDebuggerProcessLabel() {
String format = "{0} ({1})"; //$NON-NLS-1$ String format = "{0} ({1})"; //$NON-NLS-1$
String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis())); String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
return MessageFormat.format(format, new String[]{LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Debugger_Process"), timestamp}); //$NON-NLS-1$ return MessageFormat.format(format, new String[]{
LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Debugger_Process"), timestamp}); //$NON-NLS-1$
} }
protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException { protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException {
@ -427,7 +444,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM); ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM);
} }
IFile programPath = ((IProject) cproject.getResource()).getFile(fileName); IFile programPath = ((IProject)cproject.getResource()).getFile(fileName);
if (programPath == null || !programPath.exists() || !programPath.getLocation().toFile().exists()) { if (programPath == null || !programPath.exists() || !programPath.getLocation().toFile().exists()) {
abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Program_file_does_not_exist"), //$NON-NLS-1$ abort(LaunchUIPlugin.getResourceString("AbstractCLaunchDelegate.Program_file_does_not_exist"), //$NON-NLS-1$
new FileNotFoundException(LaunchUIPlugin.getFormattedResourceString( new FileNotFoundException(LaunchUIPlugin.getFormattedResourceString(
@ -442,12 +459,14 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
/** /**
* Verifies the working directory specified by the given launch configuration exists, and returns the working directory, or * Verifies the working directory specified by the given launch
* configuration exists, and returns the working directory, or
* <code>null</code> if none is specified. * <code>null</code> if none is specified.
* *
* @param configuration * @param configuration
* launch configuration * launch configuration
* @return the working directory specified by the given launch configuration, or <code>null</code> if none * @return the working directory specified by the given launch
* configuration, or <code>null</code> if none
* @exception CoreException * @exception CoreException
* if unable to retrieve the attribute * if unable to retrieve the attribute
*/ */
@ -499,7 +518,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
ch = getNext(); ch = getNext();
while (ch > 0) { while (ch > 0) {
while (Character.isWhitespace((char) ch)) while (Character.isWhitespace((char)ch))
ch = getNext(); ch = getNext();
if (ch == '"') { if (ch == '"') {
@ -531,7 +550,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
} }
if (ch > 0) { if (ch > 0) {
buf.append((char) ch); buf.append((char)ch);
ch = getNext(); ch = getNext();
} }
} }
@ -544,14 +563,14 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
private String parseToken() { private String parseToken() {
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
while (ch > 0 && !Character.isWhitespace((char) ch)) { while (ch > 0 && !Character.isWhitespace((char)ch)) {
if (ch == '\\') { if (ch == '\\') {
ch = getNext(); ch = getNext();
if (ch > 0) { if (ch > 0) {
if (ch != '"') { // Only escape double quotes if (ch != '"') { // Only escape double quotes
buf.append('\\'); buf.append('\\');
} }
buf.append((char) ch); buf.append((char)ch);
ch = getNext(); ch = getNext();
} else if (ch == -1) { // Don't lose a trailing backslash } else if (ch == -1) { // Don't lose a trailing backslash
buf.append('\\'); buf.append('\\');
@ -559,7 +578,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} else if (ch == '"') { } else if (ch == '"') {
buf.append(parseString()); buf.append(parseString());
} else { } else {
buf.append((char) ch); buf.append((char)ch);
ch = getNext(); ch = getNext();
} }
} }
@ -575,7 +594,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* @param referencedProjSet * @param referencedProjSet
* A set of referenced projects * A set of referenced projects
* @throws CoreException * @throws CoreException
* if an error occurs while getting referenced projects from the current project * if an error occurs while getting referenced projects from the
* current project
*/ */
private void getReferencedProjectSet(IProject project, HashSet referencedProjSet) throws CoreException { private void getReferencedProjectSet(IProject project, HashSet referencedProjSet) throws CoreException {
IProject[] projects = project.getReferencedProjects(); IProject[] projects = project.getReferencedProjects();
@ -590,7 +610,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
/** /**
* creates a list of project ordered by their build order from an unordered list of projects. * creates a list of project ordered by their build order from an unordered
* list of projects.
* *
* @param resourceCollection * @param resourceCollection
* The list of projects to sort. * The list of projects to sort.
@ -600,14 +621,15 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
String[] orderedNames = ResourcesPlugin.getWorkspace().getDescription().getBuildOrder(); String[] orderedNames = ResourcesPlugin.getWorkspace().getDescription().getBuildOrder();
if (orderedNames != null) { if (orderedNames != null) {
List orderedProjects = new ArrayList(resourceCollection.size()); List orderedProjects = new ArrayList(resourceCollection.size());
//Projects may not be in the build order but should be built if selected //Projects may not be in the build order but should be built if
// selected
List unorderedProjects = new ArrayList(resourceCollection.size()); List unorderedProjects = new ArrayList(resourceCollection.size());
unorderedProjects.addAll(resourceCollection); unorderedProjects.addAll(resourceCollection);
for (int i = 0; i < orderedNames.length; i++) { for (int i = 0; i < orderedNames.length; i++) {
String projectName = orderedNames[i]; String projectName = orderedNames[i];
for (int j = 0; j < resourceCollection.size(); j++) { for (int j = 0; j < resourceCollection.size(); j++) {
IProject project = (IProject) resourceCollection.get(j); IProject project = (IProject)resourceCollection.get(j);
if (project.getName().equals(projectName)) { if (project.getName().equals(projectName)) {
orderedProjects.add(project); orderedProjects.add(project);
unorderedProjects.remove(project); unorderedProjects.remove(project);
@ -622,7 +644,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
// Try the project prerequisite order then // Try the project prerequisite order then
IProject[] projects = new IProject[resourceCollection.size()]; IProject[] projects = new IProject[resourceCollection.size()];
projects = (IProject[]) resourceCollection.toArray(projects); projects = (IProject[])resourceCollection.toArray(projects);
IWorkspace.ProjectOrder po = ResourcesPlugin.getWorkspace().computeProjectOrder(projects); IWorkspace.ProjectOrder po = ResourcesPlugin.getWorkspace().computeProjectOrder(projects);
ArrayList orderedProjects = new ArrayList(); ArrayList orderedProjects = new ArrayList();
orderedProjects.addAll(Arrays.asList(po.projects)); orderedProjects.addAll(Arrays.asList(po.projects));
@ -630,7 +652,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
/** /**
* Builds the current project and all of it's prerequisite projects if necessary. Respects specified build order if any exists. * Builds the current project and all of it's prerequisite projects if
* necessary. Respects specified build order if any exists.
* *
* @param configuration * @param configuration
* the configuration being launched * the configuration being launched
@ -638,7 +661,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* the mode the configuration is being launched in * the mode the configuration is being launched in
* @param monitor * @param monitor
* progress monitor * progress monitor
* @return whether the debug platform should perform an incremental workspace build before the launch * @return whether the debug platform should perform an incremental
* workspace build before the launch
* @throws CoreException * @throws CoreException
* if an exception occurrs while building * if an exception occurrs while building
*/ */
@ -649,7 +673,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
orderedProjects.size() + 1); orderedProjects.size() + 1);
for (Iterator i = orderedProjects.iterator(); i.hasNext();) { for (Iterator i = orderedProjects.iterator(); i.hasNext();) {
IProject proj = (IProject) i.next(); IProject proj = (IProject)i.next();
monitor.subTask(LaunchUIPlugin.getResourceString("AbstractCLaunchConfigurationDelegate.building") + proj.getName()); //$NON-NLS-1$ monitor.subTask(LaunchUIPlugin.getResourceString("AbstractCLaunchConfigurationDelegate.building") + proj.getName()); //$NON-NLS-1$
proj.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); proj.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
} }
@ -662,8 +686,9 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} }
/** /**
* Searches for compile errors in the current project and any of its prerequisite projects. If any compile errors, give the user * Searches for compile errors in the current project and any of its
* a chance to abort the launch and correct the errors. * prerequisite projects. If any compile errors, give the user a chance to
* abort the launch and correct the errors.
* *
* @param configuration * @param configuration
* @param mode * @param mode
@ -683,7 +708,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
//check prerequisite projects for compile errors. //check prerequisite projects for compile errors.
for (Iterator i = orderedProjects.iterator(); i.hasNext();) { for (Iterator i = orderedProjects.iterator(); i.hasNext();) {
IProject proj = (IProject) i.next(); IProject proj = (IProject)i.next();
monitor.subTask(LaunchUIPlugin.getResourceString("AbstractCLaunchConfigurationDelegate.searching_for_errors_in") //$NON-NLS-1$ monitor.subTask(LaunchUIPlugin.getResourceString("AbstractCLaunchConfigurationDelegate.searching_for_errors_in") //$NON-NLS-1$
+ proj.getName()); + proj.getName());
compileErrorsInProjs = existsErrors(proj); compileErrorsInProjs = existsErrors(proj);
@ -703,7 +728,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
if (compileErrorsInProjs) { if (compileErrorsInProjs) {
IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus); IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus);
if (prompter != null) { if (prompter != null) {
continueLaunch = ((Boolean) prompter.handleStatus(complileErrorPromptStatus, null)).booleanValue(); continueLaunch = ((Boolean)prompter.handleStatus(complileErrorPromptStatus, null)).booleanValue();
} }
} }
} }
@ -725,7 +750,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
if (markers.length > 0) { if (markers.length > 0) {
for (int j = 0; j < markers.length; j++) { for (int j = 0; j < markers.length; j++) {
if (((Integer) markers[j].getAttribute(IMarker.SEVERITY)).intValue() == IMarker.SEVERITY_ERROR) { if ( ((Integer)markers[j].getAttribute(IMarker.SEVERITY)).intValue() == IMarker.SEVERITY_ERROR) {
return true; return true;
} }
} }

View file

@ -1,3 +1,13 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal; package org.eclipse.cdt.launch.internal;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
@ -43,20 +53,12 @@ import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.dialogs.ElementListSelectionDialog; import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.dialogs.TwoPaneElementSelector; import org.eclipse.ui.dialogs.TwoPaneElementSelector;
/**
*/
public class CApplicationLaunchShortcut implements ILaunchShortcut { public class CApplicationLaunchShortcut implements ILaunchShortcut {
/**
* @see org.eclipse.debug.ui.ILaunchShortcut#launch(IEditorPart, String)
*/
public void launch(IEditorPart editor, String mode) { public void launch(IEditorPart editor, String mode) {
searchAndLaunch(new Object[] { editor.getEditorInput()}, mode); searchAndLaunch(new Object[] { editor.getEditorInput()}, mode);
} }
/**
* @see org.eclipse.debug.ui.ILaunchShortcut#launch(ISelection, String)
*/
public void launch(ISelection selection, String mode) { public void launch(ISelection selection, String mode) {
if (selection instanceof IStructuredSelection) { if (selection instanceof IStructuredSelection) {
searchAndLaunch(((IStructuredSelection) selection).toArray(), mode); searchAndLaunch(((IStructuredSelection) selection).toArray(), mode);

View file

@ -1,3 +1,13 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal; package org.eclipse.cdt.launch.internal;
import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ICProject;
@ -24,10 +34,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
/**
* Insert the type's description here.
* @see ILaunchConfigurationDelegate
*/
public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate { public class CoreFileLaunchDelegate extends AbstractCLaunchDelegate {
public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {

View file

@ -1,16 +1,22 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal; package org.eclipse.cdt.launch.internal;
/*
* (c) Copyright QNX Software System 2002.
* All Rights Reserved.
*/
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Properties; import java.util.Properties;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.IProcessInfo; import org.eclipse.cdt.core.IProcessInfo;
import org.eclipse.cdt.core.IProcessList; import org.eclipse.cdt.core.IProcessList;
@ -38,7 +44,6 @@ import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.IStatusHandler; import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
import org.eclipse.debug.core.model.IProcess; import org.eclipse.debug.core.model.IProcess;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ILabelProvider;
@ -49,10 +54,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.TwoPaneElementSelector; import org.eclipse.ui.dialogs.TwoPaneElementSelector;
/**
* Insert the type's description here.
* @see ILaunchConfigurationDelegate
*/
public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate { public class LocalCLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {

View file

@ -1,7 +1,13 @@
/* /**********************************************************************
* (c) Copyright QNX Software System Ltd. 2002. * Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All Rights Reserved. * All rights reserved. This program and the accompanying materials
*/ * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal.ui; package org.eclipse.cdt.launch.internal.ui;
import java.util.Map; import java.util.Map;

View file

@ -1,3 +1,13 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal.ui; package org.eclipse.cdt.launch.internal.ui;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
@ -10,15 +20,10 @@ import org.eclipse.debug.ui.CommonTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab; import org.eclipse.debug.ui.ILaunchConfigurationTab;
/**
* Insert the type's description here.
* @see AbstractLaunchConfigurationTabGroup
*/
public class CoreFileCLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { public class CoreFileCLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
/** /* (non-Javadoc)
* Insert the method's description here. * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
* @see AbstractLaunchConfigurationTabGroup#createTabs
*/ */
public void createTabs(ILaunchConfigurationDialog dialog, String mode) { public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
@ -30,6 +35,9 @@ public class CoreFileCLaunchConfigurationTabGroup extends AbstractLaunchConfigur
setTabs(tabs); setTabs(tabs);
} }
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
// This configuration should work for all platforms // This configuration should work for all platforms
configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, "*"); //$NON-NLS-1$ configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, "*"); //$NON-NLS-1$

View file

@ -1,3 +1,13 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal.ui; package org.eclipse.cdt.launch.internal.ui;
import java.net.MalformedURLException; import java.net.MalformedURLException;
@ -9,10 +19,6 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
/*
* (c) Copyright QN Software Systems Ltd. 2002.
* All Rights Reserved.
*/
public class LaunchImages { public class LaunchImages {
private static final String NAME_PREFIX= LaunchUIPlugin.PLUGIN_ID + '.'; private static final String NAME_PREFIX= LaunchUIPlugin.PLUGIN_ID + '.';
private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length(); private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length();

View file

@ -1,3 +1,13 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal.ui; package org.eclipse.cdt.launch.internal.ui;
import java.text.MessageFormat; import java.text.MessageFormat;
@ -21,9 +31,6 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
/*
* (c) Copyright QNX Software Systems Ltd. 2002. All Rights Reserved.
*/
public class LaunchUIPlugin extends AbstractUIPlugin public class LaunchUIPlugin extends AbstractUIPlugin
implements implements
IDebugEventSetListener { IDebugEventSetListener {

View file

@ -1,3 +1,13 @@
#####################################################################
# Copyright (c) 2002 - 2004 QNX Software Systems and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Common Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/cpl-v10.html
#
# Contributors:
# QNX Software Systems - Initial API and implementation
#######################################################################
AbstractCLaunchDelegate.Debugger_not_installed=CDT Debugger not installed AbstractCLaunchDelegate.Debugger_not_installed=CDT Debugger not installed
AbstractCLaunchDelegate.C_Project_not_specified=C Project not specified AbstractCLaunchDelegate.C_Project_not_specified=C Project not specified

View file

@ -1,3 +1,13 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal.ui; package org.eclipse.cdt.launch.internal.ui;
import org.eclipse.cdt.launch.ui.CArgumentsTab; import org.eclipse.cdt.launch.ui.CArgumentsTab;
@ -10,15 +20,10 @@ import org.eclipse.debug.ui.CommonTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog; import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab; import org.eclipse.debug.ui.ILaunchConfigurationTab;
/**
* Insert the type's description here.
* @see AbstractLaunchConfigurationTabGroup
*/
public class LocalCLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { public class LocalCLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
/** /* (non-Javadoc)
* Insert the method's description here. * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
* @see AbstractLaunchConfigurationTabGroup#createTabs
*/ */
public void createTabs(ILaunchConfigurationDialog dialog, String mode) { public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {

View file

@ -1,3 +1,13 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.internal.ui; package org.eclipse.cdt.launch.internal.ui;
import java.io.File; import java.io.File;

View file

@ -1,10 +1,15 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.ui; package org.eclipse.cdt.launch.ui;
/*
* (c) Copyright QNX Software System 2002.
* All Rights Reserved.
*/
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.launch.internal.ui.LaunchImages; import org.eclipse.cdt.launch.internal.ui.LaunchImages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;

View file

@ -1,6 +1,13 @@
/* /**********************************************************************
* (c) Copyright QNX Software System Ltd. 2002. All Rights Reserved. * Copyright (c) 2002 - 2004 QNX Software Systems and others.
*/ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.ui; package org.eclipse.cdt.launch.ui;
import java.util.Arrays; import java.util.Arrays;

View file

@ -1,10 +1,15 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.ui; package org.eclipse.cdt.launch.ui;
/*
* (c) Copyright QNX Software System 2002.
* All Rights Reserved.
*/
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;

View file

@ -1,3 +1,13 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.ui; package org.eclipse.cdt.launch.ui;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
@ -22,17 +32,14 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPage;
/*
* (c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*/
public abstract class CLaunchConfigurationTab extends AbstractLaunchConfigurationTab { public abstract class CLaunchConfigurationTab extends AbstractLaunchConfigurationTab {
/** /**
* Returns the current C element context from which to initialize * Returns the current C element context from which to initialize default
* default settings, or <code>null</code> if none. * settings, or <code>null</code> if none. Note, if possible we will
* Note, if possible we will return the IBinary based on config entry * return the IBinary based on config entry as this may be more usefull then
* as this may be more usefull then just the project. * just the project.
*
* @return C element context. * @return C element context.
*/ */
protected ICElement getContext(ILaunchConfiguration config, String platform) { protected ICElement getContext(ILaunchConfiguration config, String platform) {
@ -41,10 +48,9 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
IWorkbenchPage page = LaunchUIPlugin.getActivePage(); IWorkbenchPage page = LaunchUIPlugin.getActivePage();
Object obj = null; Object obj = null;
try { try {
projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null); projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) null); programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String)null);
} } catch (CoreException e) {
catch (CoreException e) {
} }
if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$ if (projectName != null && !projectName.equals("")) { //$NON-NLS-1$
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
@ -52,12 +58,11 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
if (cProject != null && cProject.exists()) { if (cProject != null && cProject.exists()) {
obj = cProject; obj = cProject;
} }
} } else {
else {
if (page != null) { if (page != null) {
ISelection selection = page.getSelection(); ISelection selection = page.getSelection();
if (selection instanceof IStructuredSelection) { if (selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) selection; IStructuredSelection ss = (IStructuredSelection)selection;
if (!ss.isEmpty()) { if (!ss.isEmpty()) {
obj = ss.getFirstElement(); obj = ss.getFirstElement();
} }
@ -65,9 +70,9 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
} }
} }
if (obj instanceof IResource) { if (obj instanceof IResource) {
ICElement ce = CoreModel.getDefault().create((IResource) obj); ICElement ce = CoreModel.getDefault().create((IResource)obj);
if (ce == null) { if (ce == null) {
IProject pro = ((IResource) obj).getProject(); IProject pro = ((IResource)obj).getProject();
ce = CoreModel.getDefault().create(pro); ce = CoreModel.getDefault().create(pro);
} }
obj = ce; obj = ce;
@ -76,34 +81,36 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
if (platform != null && !platform.equals("*")) { //$NON-NLS-1$ if (platform != null && !platform.equals("*")) { //$NON-NLS-1$
ICDescriptor descriptor; ICDescriptor descriptor;
try { try {
descriptor = CCorePlugin.getDefault().getCProjectDescription(((ICElement) obj).getCProject().getProject()); descriptor = CCorePlugin.getDefault().getCProjectDescription( ((ICElement)obj).getCProject().getProject(),
false);
if (descriptor != null) {
String projectPlatform = descriptor.getPlatform(); String projectPlatform = descriptor.getPlatform();
if (!projectPlatform.equals(platform) && !projectPlatform.equals("*")) { //$NON-NLS-1$ if (!projectPlatform.equals(platform) && !projectPlatform.equals("*")) { //$NON-NLS-1$
obj = null; obj = null;
} }
} }
catch (CoreException e) { } catch (CoreException e) {
} }
} }
if (obj != null) { if (obj != null) {
if (programName == null || programName.equals("")) { //$NON-NLS-1$ if (programName == null || programName.equals("")) { //$NON-NLS-1$
return (ICElement) obj; return (ICElement)obj;
} }
ICElement ce = (ICElement) obj; ICElement ce = (ICElement)obj;
IProject project; IProject project;
project = (IProject) ce.getCProject().getResource(); project = (IProject)ce.getCProject().getResource();
IPath programFile = project.getFile(programName).getLocation(); IPath programFile = project.getFile(programName).getLocation();
ce = CCorePlugin.getDefault().getCoreModel().create(programFile); ce = CCorePlugin.getDefault().getCoreModel().create(programFile);
if (ce != null && ce.exists()) { if (ce != null && ce.exists()) {
return ce; return ce;
} }
return (ICElement) obj; return (ICElement)obj;
} }
} }
IEditorPart part = page.getActiveEditor(); IEditorPart part = page.getActiveEditor();
if (part != null) { if (part != null) {
IEditorInput input = part.getEditorInput(); IEditorInput input = part.getEditorInput();
return (ICElement) input.getAdapter(ICElement.class); return (ICElement)input.getAdapter(ICElement.class);
} }
return null; return null;
} }
@ -125,8 +132,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
String platform = Platform.getOS(); String platform = Platform.getOS();
try { try {
return config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, platform); return config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PLATFORM, platform);
} } catch (CoreException e) {
catch (CoreException e) {
return platform; return platform;
} }
} }

View file

@ -1,10 +1,15 @@
/**********************************************************************
* Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.ui; package org.eclipse.cdt.launch.ui;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.util.ArrayList; import java.util.ArrayList;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
@ -31,7 +36,6 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
@ -58,11 +62,12 @@ import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider; import org.eclipse.ui.model.WorkbenchLabelProvider;
/** /**
* A launch configuration tab that displays and edits project and * A launch configuration tab that displays and edits project and main type name
* main type name launch configuration attributes. * launch configuration attributes.
* <p> * <p>
* This class may be instantiated. This class is not intended to be subclassed. * This class may be instantiated. This class is not intended to be subclassed.
* </p> * </p>
*
* @since 2.0 * @since 2.0
*/ */
@ -82,8 +87,8 @@ public class CMainTab extends CLaunchConfigurationTab {
private String filterPlatform = EMPTY_STRING; private String filterPlatform = EMPTY_STRING;
/** /* (non-Javadoc)
* @see ILaunchConfigurationTab#createControl(Composite) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/ */
public void createControl(Composite parent) { public void createControl(Composite parent) {
@ -95,7 +100,6 @@ public class CMainTab extends CLaunchConfigurationTab {
GridLayout topLayout = new GridLayout(); GridLayout topLayout = new GridLayout();
comp.setLayout(topLayout); comp.setLayout(topLayout);
createVerticalSpacer(comp, 1); createVerticalSpacer(comp, 1);
Composite projComp = new Composite(comp, SWT.NONE); Composite projComp = new Composite(comp, SWT.NONE);
@ -117,6 +121,7 @@ public class CMainTab extends CLaunchConfigurationTab {
gd = new GridData(GridData.FILL_HORIZONTAL); gd = new GridData(GridData.FILL_HORIZONTAL);
fProjText.setLayoutData(gd); fProjText.setLayoutData(gd);
fProjText.addModifyListener(new ModifyListener() { fProjText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) { public void modifyText(ModifyEvent evt) {
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
} }
@ -124,6 +129,7 @@ public class CMainTab extends CLaunchConfigurationTab {
fProjButton = createPushButton(projComp, LaunchUIPlugin.getResourceString("Launch.common.B&rowse..."), null); //$NON-NLS-1$ fProjButton = createPushButton(projComp, LaunchUIPlugin.getResourceString("Launch.common.B&rowse..."), null); //$NON-NLS-1$
fProjButton.addSelectionListener(new SelectionAdapter() { fProjButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleProjectButtonSelected(); handleProjectButtonSelected();
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
@ -149,6 +155,7 @@ public class CMainTab extends CLaunchConfigurationTab {
gd = new GridData(GridData.FILL_HORIZONTAL); gd = new GridData(GridData.FILL_HORIZONTAL);
fProgText.setLayoutData(gd); fProgText.setLayoutData(gd);
fProgText.addModifyListener(new ModifyListener() { fProgText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) { public void modifyText(ModifyEvent evt) {
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
} }
@ -156,6 +163,7 @@ public class CMainTab extends CLaunchConfigurationTab {
fSearchButton = createPushButton(mainComp, LaunchUIPlugin.getResourceString("CMainTab.Search..."), null); //$NON-NLS-1$ fSearchButton = createPushButton(mainComp, LaunchUIPlugin.getResourceString("CMainTab.Search..."), null); //$NON-NLS-1$
fSearchButton.addSelectionListener(new SelectionAdapter() { fSearchButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleSearchButtonSelected(); handleSearchButtonSelected();
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
@ -165,6 +173,7 @@ public class CMainTab extends CLaunchConfigurationTab {
Button fBrowseForBinaryButton; Button fBrowseForBinaryButton;
fBrowseForBinaryButton = createPushButton(mainComp, LaunchUIPlugin.getResourceString("Launch.common.B&rowse..."), null); //$NON-NLS-1$ fBrowseForBinaryButton = createPushButton(mainComp, LaunchUIPlugin.getResourceString("Launch.common.B&rowse..."), null); //$NON-NLS-1$
fBrowseForBinaryButton.addSelectionListener(new SelectionAdapter() { fBrowseForBinaryButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) { public void widgetSelected(SelectionEvent evt) {
handleBinaryBrowseButtonSelected(); handleBinaryBrowseButtonSelected();
updateLaunchConfigurationDialog(); updateLaunchConfigurationDialog();
@ -174,8 +183,8 @@ public class CMainTab extends CLaunchConfigurationTab {
LaunchUIPlugin.setDialogShell(parent.getShell()); LaunchUIPlugin.setDialogShell(parent.getShell());
} }
/** /* (non-Javadoc)
* @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/ */
public void initializeFrom(ILaunchConfiguration config) { public void initializeFrom(ILaunchConfiguration config) {
filterPlatform = getPlatform(config); filterPlatform = getPlatform(config);
@ -204,8 +213,8 @@ public class CMainTab extends CLaunchConfigurationTab {
fProgText.setText(programName); fProgText.setText(programName);
} }
/** /* (non-Javadoc)
* @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/ */
public void performApply(ILaunchConfigurationWorkingCopy config) { public void performApply(ILaunchConfigurationWorkingCopy config) {
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText()); config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText());
@ -218,14 +227,13 @@ public class CMainTab extends CLaunchConfigurationTab {
protected void handleSearchButtonSelected() { protected void handleSearchButtonSelected() {
if (getCProject() == null) { if (getCProject() == null) {
MessageDialog.openInformation( MessageDialog.openInformation(getShell(), LaunchUIPlugin.getResourceString("CMainTab.Project_required"), //$NON-NLS-1$
getShell(),
LaunchUIPlugin.getResourceString("CMainTab.Project_required"), //$NON-NLS-1$
LaunchUIPlugin.getResourceString("CMainTab.Enter_project_before_searching_for_program")); //$NON-NLS-1$ LaunchUIPlugin.getResourceString("CMainTab.Enter_project_before_searching_for_program")); //$NON-NLS-1$
return; return;
} }
ILabelProvider programLabelProvider = new CElementLabelProvider() { ILabelProvider programLabelProvider = new CElementLabelProvider() {
CElementImageProvider imageProvider = new CElementImageProvider(); CElementImageProvider imageProvider = new CElementImageProvider();
public String getText(Object element) { public String getText(Object element) {
@ -239,17 +247,18 @@ public class CMainTab extends CLaunchConfigurationTab {
} }
public Image getImage(Object element) { public Image getImage(Object element) {
if(!(element instanceof ICElement)) { if (! (element instanceof ICElement)) {
return super.getImage(element); return super.getImage(element);
} }
ICElement celement = (ICElement)element; ICElement celement = (ICElement)element;
if(celement.getElementType() == ICElement.C_BINARY) { if (celement.getElementType() == ICElement.C_BINARY) {
IBinary belement = (IBinary)celement; IBinary belement = (IBinary)celement;
if(belement.isExecutable()) { if (belement.isExecutable()) {
Image image = super.getImage(element); Image image = super.getImage(element);
Point size= new Point(image.getBounds().width, image.getBounds().height); Point size = new Point(image.getBounds().width, image.getBounds().height);
return CUIPlugin.getImageDescriptorRegistry().get(new CElementImageDescriptor(CPluginImages.DESC_OBJS_CEXEC, 0, size)); return CUIPlugin.getImageDescriptorRegistry().get(
new CElementImageDescriptor(CPluginImages.DESC_OBJS_CEXEC, 0, size));
} }
} }
@ -258,6 +267,7 @@ public class CMainTab extends CLaunchConfigurationTab {
}; };
ILabelProvider qualifierLabelProvider = new CElementLabelProvider() { ILabelProvider qualifierLabelProvider = new CElementLabelProvider() {
public String getText(Object element) { public String getText(Object element) {
if (element instanceof IBinary) { if (element instanceof IBinary) {
IBinary bin = (IBinary)element; IBinary bin = (IBinary)element;
@ -280,11 +290,10 @@ public class CMainTab extends CLaunchConfigurationTab {
dialog.setMultipleSelection(false); dialog.setMultipleSelection(false);
//dialog.set //dialog.set
if (dialog.open() == ElementListSelectionDialog.OK) { if (dialog.open() == ElementListSelectionDialog.OK) {
IBinary binary = (IBinary) dialog.getFirstResult(); IBinary binary = (IBinary)dialog.getFirstResult();
fProgText.setText(binary.getResource().getProjectRelativePath().toString()); fProgText.setText(binary.getResource().getProjectRelativePath().toString());
} }
} }
/** /**
@ -294,10 +303,8 @@ public class CMainTab extends CLaunchConfigurationTab {
*/ */
protected void handleBinaryBrowseButtonSelected() { protected void handleBinaryBrowseButtonSelected() {
final ICProject cproject = getCProject(); final ICProject cproject = getCProject();
if(cproject == null) { if (cproject == null) {
MessageDialog.openInformation( MessageDialog.openInformation(getShell(), LaunchUIPlugin.getResourceString("CMainTab.Project_required"), //$NON-NLS-1$
getShell(),
LaunchUIPlugin.getResourceString("CMainTab.Project_required"), //$NON-NLS-1$
LaunchUIPlugin.getResourceString("CMainTab.Enter_project_before_browsing_for_program")); //$NON-NLS-1$ LaunchUIPlugin.getResourceString("CMainTab.Enter_project_before_browsing_for_program")); //$NON-NLS-1$
return; return;
} }
@ -307,57 +314,62 @@ public class CMainTab extends CLaunchConfigurationTab {
WorkbenchContentProvider contentProvider = new WorkbenchContentProvider(); WorkbenchContentProvider contentProvider = new WorkbenchContentProvider();
dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, contentProvider); dialog = new ElementTreeSelectionDialog(getShell(), labelProvider, contentProvider);
dialog.setTitle(LaunchUIPlugin.getResourceString("CMainTab.Program_selection")); //$NON-NLS-1$ dialog.setTitle(LaunchUIPlugin.getResourceString("CMainTab.Program_selection")); //$NON-NLS-1$
dialog.setMessage(LaunchUIPlugin.getFormattedResourceString("CMainTab.Choose_program_to_run_from_NAME", cproject.getResource().getName())); //$NON-NLS-1$ dialog.setMessage(LaunchUIPlugin.getFormattedResourceString(
"CMainTab.Choose_program_to_run_from_NAME", cproject.getResource().getName())); //$NON-NLS-1$
dialog.setBlockOnOpen(true); dialog.setBlockOnOpen(true);
dialog.setAllowMultiple(false); dialog.setAllowMultiple(false);
dialog.setInput(cproject.getResource()); dialog.setInput(cproject.getResource());
dialog.setValidator(new ISelectionStatusValidator() { dialog.setValidator(new ISelectionStatusValidator() {
public IStatus validate(Object [] selection) {
if(selection.length == 0 || !(selection[0] instanceof IFile)) { public IStatus validate(Object[] selection) {
return new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_file"), null); //$NON-NLS-1$ if (selection.length == 0 || ! (selection[0] instanceof IFile)) {
return new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), 1,
LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_file"), null); //$NON-NLS-1$
} }
try { try {
ICElement celement = cproject.findElement(((IFile)selection[0]).getProjectRelativePath()); ICElement celement = cproject.findElement( ((IFile)selection[0]).getProjectRelativePath());
if(celement == null || if (celement == null
(celement.getElementType() != ICElement.C_BINARY && celement.getElementType() != ICElement.C_ARCHIVE)) { || (celement.getElementType() != ICElement.C_BINARY && celement.getElementType() != ICElement.C_ARCHIVE)) {
return new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$ return new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), 1,
LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$
} }
return new Status(IStatus.OK, LaunchUIPlugin.getUniqueIdentifier(), IStatus.OK, celement.getResource().getName(), null); return new Status(IStatus.OK, LaunchUIPlugin.getUniqueIdentifier(), IStatus.OK,
} catch(Exception ex) { celement.getResource().getName(), null);
return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$ } catch (Exception ex) {
return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1,
LaunchUIPlugin.getResourceString("CMainTab.Selection_must_be_binary_file"), null); //$NON-NLS-1$
} }
} }
}); });
if(dialog.open() == ElementTreeSelectionDialog.CANCEL) { if (dialog.open() == ElementTreeSelectionDialog.CANCEL) {
return; return;
} }
Object [] results = dialog.getResult(); Object[] results = dialog.getResult();
try { try {
fProgText.setText(((IResource)results[0]).getProjectRelativePath().toString()); fProgText.setText( ((IResource)results[0]).getProjectRelativePath().toString());
} catch(Exception ex) { } catch (Exception ex) {
/* Make sure it is a file */ /* Make sure it is a file */
} }
} }
/** /**
* Iterate through and suck up all of the executable files that * Iterate through and suck up all of the executable files that we can find.
* we can find.
*/ */
protected IBinary[] getBinaryFiles(final ICProject cproject) { protected IBinary[] getBinaryFiles(final ICProject cproject) {
final Display display; final Display display;
if ( getShell() == null ) { if (getShell() == null) {
display = LaunchUIPlugin.getShell().getDisplay(); display = LaunchUIPlugin.getShell().getDisplay();
} else { } else {
display = getShell().getDisplay(); display = getShell().getDisplay();
} }
final Object[] ret = new Object[1]; final Object[] ret = new Object[1];
BusyIndicator.showWhile(display, new Runnable() { BusyIndicator.showWhile(display, new Runnable() {
public void run() { public void run() {
try { try {
ret[0] = cproject.getBinaryContainer().getBinaries(); ret[0] = cproject.getBinaryContainer().getBinaries();
@ -386,8 +398,8 @@ public class CMainTab extends CLaunchConfigurationTab {
} }
/** /**
* Realize a C Project selection dialog and return the first selected project, * Realize a C Project selection dialog and return the first selected
* or null if there was none. * project, or null if there was none.
*/ */
protected ICProject chooseCProject() { protected ICProject chooseCProject() {
try { try {
@ -401,10 +413,10 @@ public class CMainTab extends CLaunchConfigurationTab {
ICProject cProject = getCProject(); ICProject cProject = getCProject();
if (cProject != null) { if (cProject != null) {
dialog.setInitialSelections(new Object[] { cProject }); dialog.setInitialSelections(new Object[]{cProject});
} }
if (dialog.open() == ElementListSelectionDialog.OK) { if (dialog.open() == ElementListSelectionDialog.OK) {
return (ICProject) dialog.getFirstResult(); return (ICProject)dialog.getFirstResult();
} }
} catch (CModelException e) { } catch (CModelException e) {
LaunchUIPlugin.errorDialog("Launch UI internal error", e); //$NON-NLS-1$ LaunchUIPlugin.errorDialog("Launch UI internal error", e); //$NON-NLS-1$
@ -414,7 +426,7 @@ public class CMainTab extends CLaunchConfigurationTab {
/** /**
* Return an array a ICProject whose platform match that of the runtime env. * Return an array a ICProject whose platform match that of the runtime env.
**/ */
protected ICProject[] getCProjects() throws CModelException { protected ICProject[] getCProjects() throws CModelException {
ICProject cproject[] = CoreModel.getDefault().getCModel().getCProjects(); ICProject cproject[] = CoreModel.getDefault().getCModel().getCProjects();
@ -423,22 +435,26 @@ public class CMainTab extends CLaunchConfigurationTab {
for (int i = 0; i < cproject.length; i++) { for (int i = 0; i < cproject.length; i++) {
ICDescriptor cdesciptor = null; ICDescriptor cdesciptor = null;
try { try {
cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject) cproject[i].getResource()); cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject)cproject[i].getResource(), false);
if (cdesciptor != null) {
String projectPlatform = cdesciptor.getPlatform(); String projectPlatform = cdesciptor.getPlatform();
if (filterPlatform.equals("*") //$NON-NLS-1$ if (filterPlatform.equals("*") //$NON-NLS-1$
|| projectPlatform.equals("*") //$NON-NLS-1$ || projectPlatform.equals("*") //$NON-NLS-1$
|| filterPlatform.equalsIgnoreCase(projectPlatform) == true) { || filterPlatform.equalsIgnoreCase(projectPlatform) == true) {
list.add(cproject[i]); list.add(cproject[i]);
} }
} else {
list.add(cproject[i]);
}
} catch (CoreException e) { } catch (CoreException e) {
list.add(cproject[i]); list.add(cproject[i]);
} }
} }
return (ICProject[]) list.toArray(new ICProject[list.size()]); return (ICProject[])list.toArray(new ICProject[list.size()]);
} }
/** /**
* Return the ICProject corresponding to the project name in the project name * Return the ICProject corresponding to the project name in the project
* text field, or null if the text does not match a project name. * name text field, or null if the text does not match a project name.
*/ */
protected ICProject getCProject() { protected ICProject getCProject() {
String projectName = fProjText.getText().trim(); String projectName = fProjText.getText().trim();
@ -448,8 +464,8 @@ public class CMainTab extends CLaunchConfigurationTab {
return CoreModel.getDefault().getCModel().getCProject(projectName); return CoreModel.getDefault().getCModel().getCProject(projectName);
} }
/** /* (non-Javadoc)
* @see ILaunchConfigurationTab#isValid(ILaunchConfiguration) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/ */
public boolean isValid(ILaunchConfiguration config) { public boolean isValid(ILaunchConfiguration config) {
@ -487,13 +503,16 @@ public class CMainTab extends CLaunchConfigurationTab {
return true; return true;
} }
/** /* (non-Javadoc)
* @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/ */
public void setDefaults(ILaunchConfigurationWorkingCopy config) { public void setDefaults(ILaunchConfigurationWorkingCopy config) {
// We set empty attributes for project & program so that when one config is // We set empty attributes for project & program so that when one config
// compared to another, the existence of empty attributes doesn't cause an // is
// incorrect result (the performApply() method can result in empty values // compared to another, the existence of empty attributes doesn't cause
// an
// incorrect result (the performApply() method can result in empty
// values
// for these attributes being set on a config if there is nothing in the // for these attributes being set on a config if there is nothing in the
// corresponding text boxes) // corresponding text boxes)
// plus getContext will use this to base context from if set. // plus getContext will use this to base context from if set.
@ -507,12 +526,13 @@ public class CMainTab extends CLaunchConfigurationTab {
} }
/** /**
* Set the program name attributes on the working copy based on the ICElement * Set the program name attributes on the working copy based on the
* ICElement
*/ */
protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) { protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) {
IBinary binary = null; IBinary binary = null;
if (cElement instanceof ICProject) { if (cElement instanceof ICProject) {
IBinary[] bins = getBinaryFiles((ICProject) cElement); IBinary[] bins = getBinaryFiles((ICProject)cElement);
if (bins.length == 1) { if (bins.length == 1) {
binary = bins[0]; binary = bins[0];
} }
@ -534,21 +554,22 @@ public class CMainTab extends CLaunchConfigurationTab {
config.rename(name); config.rename(name);
} }
} }
/**
* @see ILaunchConfigurationTab#getName() /* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/ */
public String getName() { public String getName() {
return LaunchUIPlugin.getResourceString("CMainTab.Main"); //$NON-NLS-1$ return LaunchUIPlugin.getResourceString("CMainTab.Main"); //$NON-NLS-1$
} }
/** /* (non-Javadoc)
* @see ILaunchConfigurationTab#getImage() * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/ */
public Image getImage() { public Image getImage() {
return LaunchImages.get(LaunchImages.IMG_VIEW_MAIN_TAB); return LaunchImages.get(LaunchImages.IMG_VIEW_MAIN_TAB);
} }
/** /* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
*/ */
protected void updateLaunchConfigurationDialog() { protected void updateLaunchConfigurationDialog() {

View file

@ -1,8 +1,13 @@
/* /**********************************************************************
*(c) Copyright QNX Software Systems Ltd. 2002. * Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All Rights Reserved. * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
* *
*/ * Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.ui; package org.eclipse.cdt.launch.ui;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;

View file

@ -1,7 +1,13 @@
/* /**********************************************************************
* (c) Copyright QNX Software System Ltd. 2002. * Copyright (c) 2002 - 2004 QNX Software Systems and others.
* All Rights Reserved. * All rights reserved. This program and the accompanying materials
*/ * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.launch.ui; package org.eclipse.cdt.launch.ui;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
@ -73,8 +79,10 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
String projectCPU = "*"; //$NON-NLS-1$ String projectCPU = "*"; //$NON-NLS-1$
if (ce != null) { if (ce != null) {
try { try {
ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject()); ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject(), false);
if (descriptor != null) {
projectPlatform = descriptor.getPlatform(); projectPlatform = descriptor.getPlatform();
}
IBinary bin = (IBinary) ce; IBinary bin = (IBinary) ce;
projectCPU = bin.getCPU(); projectCPU = bin.getCPU();
} catch (Exception e) { } catch (Exception e) {
@ -156,8 +164,10 @@ public class CorefileDebuggerTab extends AbstractCDebuggerTab {
String projectCPU = "*"; //$NON-NLS-1$ String projectCPU = "*"; //$NON-NLS-1$
if (ce != null) { if (ce != null) {
try { try {
ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject()); ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(ce.getCProject().getProject(), false);
if (descriptor != null) {
projectPlatform = descriptor.getPlatform(); projectPlatform = descriptor.getPlatform();
}
IBinary bin = (IBinary) ce; IBinary bin = (IBinary) ce;
projectCPU = bin.getCPU(); projectCPU = bin.getCPU();
} catch (Exception e) { } catch (Exception e) {

View file

@ -1,7 +1,9 @@
/* /**********************************************************************
* Created on 22-Sep-2003 * Copyright (c) 2002 - 2004 QNX Software Systems and others.
* * All rights reserved. This program and the accompanying materials
* Copyright (c) 2002,2003 QNX Software Systems Ltd. * are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation