Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2002-08-13 04:02:57 +0000
committerDavid Inglis2002-08-13 04:02:57 +0000
commit912ea8b98a2141bf7a0e8668175cdfbfbc880709 (patch)
tree39869f2c4cc305039a0aaead7daf0c3b9c8d2572
parent44e30964ffb4819f9051af670bfb1ae18f29f15a (diff)
downloadorg.eclipse.cdt-912ea8b98a2141bf7a0e8668175cdfbfbc880709.tar.gz
org.eclipse.cdt-912ea8b98a2141bf7a0e8668175cdfbfbc880709.tar.xz
org.eclipse.cdt-912ea8b98a2141bf7a0e8668175cdfbfbc880709.zip
added new Debugger extension
-rw-r--r--debug/org.eclipse.cdt.debug.core/plugin.properties5
-rw-r--r--debug/org.eclipse.cdt.debug.core/plugin.xml41
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java10
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java16
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebuggerInfo.java10
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebuggerManager.java10
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CDebuggerManager.java88
7 files changed, 159 insertions, 21 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/plugin.properties b/debug/org.eclipse.cdt.debug.core/plugin.properties
index 2ba538b936f..43660fe2e79 100644
--- a/debug/org.eclipse.cdt.debug.core/plugin.properties
+++ b/debug/org.eclipse.cdt.debug.core/plugin.properties
@@ -1,2 +1,3 @@
-pluginName=CDT Debug Core Plug-in
-providerName=Eclipse.org
+pluginName=CDT Debug Core Plug-in
+providerName=Eclipse.org
+CDTDebugger.name=C/C++ Core Debugger Extension
diff --git a/debug/org.eclipse.cdt.debug.core/plugin.xml b/debug/org.eclipse.cdt.debug.core/plugin.xml
index 943a8628acf..4d330fafa17 100644
--- a/debug/org.eclipse.cdt.debug.core/plugin.xml
+++ b/debug/org.eclipse.cdt.debug.core/plugin.xml
@@ -1,19 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin
- id="org.eclipse.cdt.debug.core"
- name="%pluginName"
- version="1.0.0"
- provider-name="%providerName"
- class="org.eclipse.cdt.debug.core.CDebugCorePlugin">
-
- <runtime>
- <library name="cdebugcore.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.resources"/>
- </requires>
-
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin
+ id="org.eclipse.cdt.debug.core"
+ name="%pluginName"
+ version="1.0.0"
+ provider-name="%providerName"
+ class="org.eclipse.cdt.debug.core.CDebugCorePlugin">
+
+ <runtime>
+ <library name="cdebugcore.jar">
+ <export name="*"/>
+ </library>
+ </runtime>
+ <requires>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.debug.core"/>
+ </requires>
+
+
+ <extension-point id="CDebugger" name="%CDebugger.name"/>
+
+</plugin>
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java
index e4646a388da..cb0eeef5e6f 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugCorePlugin.java
@@ -6,6 +6,7 @@
package org.eclipse.cdt.debug.core;
+import org.eclipse.cdt.debug.internal.core.CDebuggerManager;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPluginDescriptor;
@@ -27,6 +28,8 @@ public class CDebugCorePlugin extends Plugin
//The shared instance.
private static CDebugCorePlugin plugin;
+ private CDebuggerManager debuggerManager;
+
/**
* The constructor.
*/
@@ -104,4 +107,11 @@ public class CDebugCorePlugin extends Plugin
{
getDefault().getLog().log( status );
}
+
+ public ICDebuggerManager getDebuggerManager() {
+ if ( debuggerManager == null ) {
+ debuggerManager = new CDebuggerManager();
+ }
+ return debuggerManager;
+ }
}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java
new file mode 100644
index 00000000000..8fa7326b8e2
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebugger.java
@@ -0,0 +1,16 @@
+/*
+ * (c) Copyright QNX Software System Ltd. 2002.
+ * All Rights Reserved.
+ */
+package org.eclipse.cdt.debug.core;
+
+import org.eclipse.cdt.debug.core.cdi.CDIException;
+import org.eclipse.cdt.debug.core.cdi.ICDISession;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+public interface ICDebugger {
+ public ICDISession createLaunchSession(ILaunchConfiguration config, IFile exe) throws CDIException ;
+ public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException;
+ public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IFile corefile) throws CDIException;
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebuggerInfo.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebuggerInfo.java
new file mode 100644
index 00000000000..3003e65dbaa
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebuggerInfo.java
@@ -0,0 +1,10 @@
+/*
+ * (c) Copyright QNX Software System Ltd. 2002.
+ * All Rights Reserved.
+ */package org.eclipse.cdt.debug.core;
+
+public interface ICDebuggerInfo {
+ String getID();
+ String getName();
+ String[] getSupportedPlatforms();
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebuggerManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebuggerManager.java
new file mode 100644
index 00000000000..2367a6af7a3
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICDebuggerManager.java
@@ -0,0 +1,10 @@
+/*
+ * (c) Copyright QNX Software System Ltd. 2002.
+ * All Rights Reserved.
+ */
+package org.eclipse.cdt.debug.core;
+
+public interface ICDebuggerManager {
+ public ICDebugger createDebugger(String id);
+ public ICDebuggerInfo[] queryDebuggers(String platform_id);
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CDebuggerManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CDebuggerManager.java
new file mode 100644
index 00000000000..a2e5ccafbc3
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CDebuggerManager.java
@@ -0,0 +1,88 @@
+/*
+ * (c) Copyright QNX Software System Ltd. 2002.
+ * All Rights Reserved.
+ */
+package org.eclipse.cdt.debug.internal.core;
+
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.eclipse.cdt.debug.core.CDebugCorePlugin;
+import org.eclipse.cdt.debug.core.ICDebugger;
+import org.eclipse.cdt.debug.core.ICDebuggerManager;
+import org.eclipse.cdt.debug.core.ICDebuggerInfo;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+
+public class CDebuggerManager implements ICDebuggerManager {
+
+ public CDebuggerManager() {
+ }
+
+ public ICDebugger createDebugger(String id) {
+ ICDebugger debugger = null;
+
+ IExtensionPoint extension = CDebugCorePlugin.getDefault().getDescriptor().getExtensionPoint("CDebugger");
+ if (extension != null) {
+ IExtension[] extensions = extension.getExtensions();
+ for(int i = 0; i < extensions.length; i++){
+ if ( id.equals(extensions[i].getUniqueIdentifier()) ) {
+ IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
+ try {
+ debugger = (ICDebugger)configElements[0].createExecutableExtension("class");
+ }
+ catch (CoreException e) {
+ return null;
+ }
+ }
+ }
+ }
+ return debugger;
+ }
+
+ public ICDebuggerInfo[] queryDebuggers(String platform_id) {
+ IExtensionPoint extension = CDebugCorePlugin.getDefault().getDescriptor().getExtensionPoint("CDebugger");
+ if (extension != null) {
+ IExtension[] extensions = extension.getExtensions();
+ CDebuggerInfo dinfo;
+ ArrayList dlist = new ArrayList(extensions.length);
+ for(int i = 0; i < extensions.length; i++){
+ IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
+ String platform = configElements[0].getAttribute("platform");
+ if ( platform == null || platform.equals("*") || platform.indexOf(platform_id) != -1 ) {
+ dlist.add(dinfo = new CDebuggerInfo());
+ dinfo.name = extensions[i].getLabel();
+ dinfo.id = extensions[i].getUniqueIdentifier();
+ dinfo.platforms = platform;
+ }
+ }
+ return (ICDebuggerInfo[]) dlist.toArray(new ICDebuggerInfo[dlist.size()]);
+ }
+ return new ICDebuggerInfo[0];
+ }
+
+ class CDebuggerInfo implements ICDebuggerInfo {
+ String id;
+ String name;
+ String platforms;
+
+ public String getID() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String[] getSupportedPlatforms() {
+ StringTokenizer stoken = new StringTokenizer(platforms, ",");
+ String[] platforms = new String[stoken.countTokens()];
+ for( int i = 0; i < platforms.length; i++ ) {
+ platforms[i] = stoken.nextToken();
+ }
+ return platforms;
+ }
+ }
+}

Back to the top