diff options
8 files changed, 269 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/.classpath b/debug/org.eclipse.cdt.debug.mi.ui/.classpath new file mode 100644 index 00000000000..8b37395920f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.ui/.classpath @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src/"/> + <classpathentry kind="src" path="/org.eclipse.core.resources"/> + <classpathentry kind="src" path="/org.eclipse.ui"/> + <classpathentry kind="src" path="/org.eclipse.cdt.debug.mi.core"/> + <classpathentry kind="src" path="/org.eclipse.cdt.debug.ui"/> + <classpathentry kind="src" path="/org.eclipse.cdt.debug.core"/> + <classpathentry kind="src" path="/org.eclipse.cdt.launch"/> + <classpathentry kind="src" path="/org.eclipse.cdt.ui"/> + <classpathentry kind="src" path="/org.eclipse.debug.core"/> + <classpathentry kind="src" path="/org.eclipse.debug.ui"/> + <classpathentry kind="src" path="/org.eclipse.core.runtime"/> + <classpathentry kind="src" path="/org.eclipse.core.boot"/> + <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/debug/org.eclipse.cdt.debug.mi.ui/.cvsignore b/debug/org.eclipse.cdt.debug.mi.ui/.cvsignore new file mode 100644 index 00000000000..ba077a4031a --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.ui/.cvsignore @@ -0,0 +1 @@ +bin diff --git a/debug/org.eclipse.cdt.debug.mi.ui/.project b/debug/org.eclipse.cdt.debug.mi.ui/.project new file mode 100644 index 00000000000..97bee48cc25 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.ui/.project @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.cdt.debug.mi.ui</name> + <comment></comment> + <projects> + <project>org.eclipse.cdt.debug.core</project> + <project>org.eclipse.cdt.debug.mi.core</project> + <project>org.eclipse.cdt.debug.ui</project> + <project>org.eclipse.cdt.launch</project> + <project>org.eclipse.cdt.ui</project> + <project>org.eclipse.core.boot</project> + <project>org.eclipse.core.resources</project> + <project>org.eclipse.core.runtime</project> + <project>org.eclipse.debug.core</project> + <project>org.eclipse.debug.ui</project> + <project>org.eclipse.ui</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + </natures> +</projectDescription> diff --git a/debug/org.eclipse.cdt.debug.mi.ui/build.properties b/debug/org.eclipse.cdt.debug.mi.ui/build.properties new file mode 100644 index 00000000000..25432e6cf94 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.ui/build.properties @@ -0,0 +1 @@ +source.miui.jar = src/ diff --git a/debug/org.eclipse.cdt.debug.mi.ui/plugin.properties b/debug/org.eclipse.cdt.debug.mi.ui/plugin.properties new file mode 100644 index 00000000000..04492609a8b --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.ui/plugin.properties @@ -0,0 +1,2 @@ +pluginName=GDB/MI CDI Debugger UI +providerName=Eclipse.org diff --git a/debug/org.eclipse.cdt.debug.mi.ui/plugin.xml b/debug/org.eclipse.cdt.debug.mi.ui/plugin.xml new file mode 100644 index 00000000000..50689f0e0f9 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.ui/plugin.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plugin + id="org.eclipse.cdt.debug.mi.ui" + name="%pluginName" + version="1.0.0" + provider-name="%providerName" + class="org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin"> + + <runtime> + <library name="miui.jar"> + <export name="*"/> + </library> + </runtime> + <requires> + <import plugin="org.eclipse.core.resources"/> + <import plugin="org.eclipse.ui"/> + <import plugin="org.eclipse.cdt.debug.mi.core"/> + <import plugin="org.eclipse.cdt.debug.ui"/> + <import plugin="org.eclipse.cdt.debug.core"/> + <import plugin="org.eclipse.cdt.launch"/> + <import plugin="org.eclipse.cdt.ui"/> + <import plugin="org.eclipse.debug.core"/> + <import plugin="org.eclipse.debug.ui"/> + </requires> + + + <extension + point="org.eclipse.cdt.debug.ui.CDebuggerPage"> + <debugPage + class="org.eclipse.cdt.debug.mi.internal.ui.CDebuggerPage" + id="org.eclipse.cdt.debug.mi.CDebuggerPage" + debuggerID="org.eclipse.cdt.debug.mi.core.CDebugger"> + </debugPage> + </extension> + +</plugin> diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/CDebuggerPage.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/CDebuggerPage.java new file mode 100644 index 00000000000..54e4b647629 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/CDebuggerPage.java @@ -0,0 +1,110 @@ +/* + * (c) Copyright QNX Software System Ltd. 2002. + * All Rights Reserved. + */ +package org.eclipse.cdt.debug.mi.internal.ui; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.cdt.debug.core.ICDebugConfiguration; +import org.eclipse.cdt.launch.ICDTLaunchConfigurationConstants; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +public class CDebuggerPage extends AbstractLaunchConfigurationTab { + protected Text fDebuggerCommandText; + + protected static final Map EMPTY_MAP = new HashMap(1); + + public void createControl(Composite parent) { + Composite comp = new Composite(parent, SWT.NONE); + GridLayout topLayout = new GridLayout(); + comp.setLayout(topLayout); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + comp.setLayoutData(gd); + + createVerticalSpacer(comp, 2); + + Label debugCommandLabel= new Label(comp, SWT.NONE); + debugCommandLabel.setText("Debugger executable:"); + + fDebuggerCommandText= new Text(comp, SWT.SINGLE | SWT.BORDER); + gd = new GridData(GridData.FILL_HORIZONTAL); + fDebuggerCommandText.setLayoutData(gd); + fDebuggerCommandText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent evt) { + updateLaunchConfigurationDialog(); + } + }); + fDebuggerCommandText.setText(getCommand()); + + setControl(comp); + } + + public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { + Map attributeMap = new HashMap(1); +// attributeMap.put(ATTR_DEBUGGER_COMMAND, getCommand()); + configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, attributeMap); + } + + private String getCommand() { + return "gdb"; + } + + /** + * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration) + */ + public boolean isValid(ILaunchConfiguration launchConfig) { + boolean valid= fDebuggerCommandText.getText().length() != 0; + if (valid) { + setErrorMessage(null); + setMessage(null); + } else { + setErrorMessage("Debugger executable must be specified"); + setMessage(null); + } + return valid; + } + + public void initializeFrom(ILaunchConfiguration configuration) { + String debuggerCommand= null; + try { + Map attributeMap = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, EMPTY_MAP); + if (attributeMap != null) { +// debuggerCommand = (String) attributeMap.get(IJavaLaunchConfigurationConstants.ATTR_JAVA_COMMAND); + if (debuggerCommand == null) { + debuggerCommand = getCommand(); + } + } + } catch(CoreException ce) { +// JDIDebugUIPlugin.log(ce); + } + fDebuggerCommandText.setText(debuggerCommand); + } + + public void performApply(ILaunchConfigurationWorkingCopy configuration) { + String debuggerCommand = fDebuggerCommandText.getText(); + Map attributeMap = new HashMap(1); +// attributeMap.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAPVA_COMMAND, debuggerCommand); + configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, attributeMap); + + } + + public String getName() { + return "GDB/MI Debugger Options"; + } +} diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIPlugin.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIPlugin.java new file mode 100644 index 00000000000..4a3138cb168 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/MIUIPlugin.java @@ -0,0 +1,63 @@ +package org.eclipse.cdt.debug.mi.internal.ui; + +import org.eclipse.ui.plugin.*; +import org.eclipse.core.runtime.*; +import org.eclipse.core.resources.*; +import java.util.*; + +/** + * The main plugin class to be used in the desktop. + */ +public class MIUIPlugin extends AbstractUIPlugin { + //The shared instance. + private static MIUIPlugin plugin; + //Resource bundle. + private ResourceBundle resourceBundle; + + /** + * The constructor. + */ + public MIUIPlugin(IPluginDescriptor descriptor) { + super(descriptor); + plugin = this; + try { + resourceBundle= ResourceBundle.getBundle("org.eclipse.cdt.debug.mi.ui.UiPluginResources"); + } catch (MissingResourceException x) { + resourceBundle = null; + } + } + + /** + * Returns the shared instance. + */ + public static MIUIPlugin getDefault() { + return plugin; + } + + /** + * Returns the workspace instance. + */ + public static IWorkspace getWorkspace() { + return ResourcesPlugin.getWorkspace(); + } + + /** + * Returns the string from the plugin's resource bundle, + * or 'key' if not found. + */ + public static String getResourceString(String key) { + ResourceBundle bundle= MIUIPlugin.getDefault().getResourceBundle(); + try { + return bundle.getString(key); + } catch (MissingResourceException e) { + return key; + } + } + + /** + * Returns the plugin's resource bundle, + */ + public ResourceBundle getResourceBundle() { + return resourceBundle; + } +} |