mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
added mode attribute to debugger config run,attach,core
This commit is contained in:
parent
c8f9368b0b
commit
92dda1a9a6
3 changed files with 29 additions and 3 deletions
|
@ -11,4 +11,5 @@ public interface ICDebugConfiguration {
|
||||||
public String getName();
|
public String getName();
|
||||||
public String getID();
|
public String getID();
|
||||||
public String[] getPlatforms();
|
public String[] getPlatforms();
|
||||||
|
public boolean supportsMode(String mode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,11 @@ package org.eclipse.cdt.debug.core;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDISession;
|
import org.eclipse.cdt.debug.core.cdi.ICDISession;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
|
|
||||||
public interface ICDebugger {
|
public interface ICDebugger {
|
||||||
public ICDISession createLaunchSession(ILaunchConfiguration config, IFile exe) throws CDIException ;
|
public ICDISession createLaunchSession(ILaunchConfiguration config, IFile exe) throws CDIException ;
|
||||||
public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException;
|
public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException;
|
||||||
public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IFile corefile) throws CDIException;
|
public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile) throws CDIException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
*/
|
*/
|
||||||
package org.eclipse.cdt.debug.internal.core;
|
package org.eclipse.cdt.debug.internal.core;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
|
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
|
||||||
|
@ -12,11 +14,11 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IConfigurationElement;
|
import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
|
|
||||||
public class DebugConfiguration implements ICDebugConfiguration {
|
public class DebugConfiguration implements ICDebugConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The configuration element of the extension.
|
* The configuration element of the extension.
|
||||||
*/
|
*/
|
||||||
private IConfigurationElement fElement;
|
private IConfigurationElement fElement;
|
||||||
|
private HashSet fModes;
|
||||||
|
|
||||||
public DebugConfiguration(IConfigurationElement element) {
|
public DebugConfiguration(IConfigurationElement element) {
|
||||||
fElement = element;
|
fElement = element;
|
||||||
|
@ -50,8 +52,30 @@ public class DebugConfiguration implements ICDebugConfiguration {
|
||||||
platforms[i] = stoken.nextToken();
|
platforms[i] = stoken.nextToken();
|
||||||
}
|
}
|
||||||
return platforms;
|
return platforms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean supportsMode(String mode) {
|
||||||
|
return getModes().contains(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue