diff options
Diffstat (limited to 'debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java')
-rw-r--r-- | debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java deleted file mode 100644 index 6a128f5c517..00000000000 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/DebugConfiguration.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * (c) Copyright QNX Software System Ltd. 2002. - * All Rights Reserved. - */ -package org.eclipse.cdt.debug.internal.core; - -import java.util.HashSet; -import java.util.Set; -import java.util.StringTokenizer; - -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.debug.core.ICDebugger; -import org.eclipse.core.boot.BootLoader; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; - -public class DebugConfiguration implements ICDebugConfiguration { - /** - * The configuration element of the extension. - */ - private IConfigurationElement fElement; - private HashSet fModes; - private HashSet fCPUs; - public static final String NATIVE = "native"; - - public DebugConfiguration(IConfigurationElement element) { - fElement = element; - } - - private IConfigurationElement getConfigurationElement() { - return fElement; - } - - public ICDebugger getDebugger() throws CoreException { - return (ICDebugger) getConfigurationElement().createExecutableExtension("class"); - } - - public String getName() { - String name = getConfigurationElement().getAttribute("name"); //$NON-NLS-1$ - return name != null ? name : ""; - } - - public String getID() { - return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$ - } - - public String getPlatform() { - String platform = getConfigurationElement().getAttribute("platform"); - if (platform == null) { - return NATIVE; - } - return platform; - } - - public String[] getCPUList() { - return (String[]) getCPUs().toArray(new String[0]); - } - - public String[] getModeList() { - return (String[]) getModes().toArray(new String[0]); - } - - public boolean supportsMode(String mode) { - return getModes().contains(mode); - } - - public boolean supportsCPU(String cpu) { - String nativeCPU = BootLoader.getOSArch(); - boolean ret = false; - if ( nativeCPU.startsWith(cpu) ) { - ret = getCPUs().contains(NATIVE); - } - return ret || getCPUs().contains(cpu); - } - /** - * Returns the set of modes specified in the configuration data. - * - * @return the set of modes specified in the configuration data - */ - protected Set getModes() { - if (fModes == null) { - String modes = getConfigurationElement().getAttribute("modes"); //$NON-NLS-1$ - if (modes == null) { - return new HashSet(0); - } - StringTokenizer tokenizer = new StringTokenizer(modes, ","); //$NON-NLS-1$ - fModes = new HashSet(tokenizer.countTokens()); - while (tokenizer.hasMoreTokens()) { - fModes.add(tokenizer.nextToken().trim()); - } - } - return fModes; - } - - protected Set getCPUs() { - if (fCPUs == null) { - String cpus = getConfigurationElement().getAttribute("cpu"); //$NON-NLS-1$ - if (cpus == null) { - fCPUs = new HashSet(1); - fCPUs.add(NATIVE); - } - else { - String nativeCPU = BootLoader.getOSArch(); - StringTokenizer tokenizer = new StringTokenizer(cpus, ","); //$NON-NLS-1$ - fCPUs = new HashSet(tokenizer.countTokens()); - while (tokenizer.hasMoreTokens()) { - String cpu = tokenizer.nextToken().trim(); - fCPUs.add(cpu); - if (nativeCPU.startsWith(cpu)) { // os arch be cpu{le/be} - fCPUs.add(NATIVE); - } - } - } - } - return fCPUs; - } - -} |