1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

- fixed API errors

This commit is contained in:
Alena Laskavaia 2010-04-22 17:52:00 +00:00
parent 4c2c31028a
commit e8775e724f
6 changed files with 62 additions and 46 deletions

View file

@ -59,6 +59,9 @@ public class Activator extends Plugin {
return PLUGIN_ID;
}
/**
* @since 6.0
*/
public static BundleContext getBundleContext() {
return getDefault().getBundle().getBundleContext();
}

View file

@ -65,6 +65,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
* It adds Jtag hardware debugging specific steps to initialize remote target
* and start the remote Jtag debugging.
* <p>
* @since 6.0
*/
public class GDBJtagDSFFinalLaunchSequence extends Sequence {

View file

@ -33,6 +33,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
* It extends the standard DSF/GDB launch delegate <code>GdbLaunchDelegate</code>
* but overrides the <code>getFinalLaunchSequence</code> method to return the Jtag
* hardware debugging specific launch sequence.
* @since 6.0
*/
@ThreadSafe
public class GDBJtagDSFLaunchConfigurationDelegate extends GdbLaunchDelegate {

View file

@ -12,6 +12,9 @@ package org.eclipse.cdt.debug.gdbjtag.ui;
import org.eclipse.cdt.launch.ui.CMainTab;
/**
* @since 6.0
*/
public class GDBJtagCDICMainTab extends CMainTab {
public GDBJtagCDICMainTab() {

View file

@ -17,6 +17,9 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchDelegate;
/**
* @since 6.0
*/
public class GDBJtagDSFCMainTab extends CMainTab {
public GDBJtagDSFCMainTab() {

View file

@ -46,6 +46,9 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
/**
* @since 6.0
*/
public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
private static final String TAB_NAME = "Debugger";
@ -58,7 +61,6 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
private Combo jtagDevice;
private String savedJtagDevice;
public String getName() {
return TAB_NAME;
}
@ -94,16 +96,13 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
dialog.setText(title);
String str = text.getText().trim();
int lastSeparatorIndex = str.lastIndexOf(File.separator);
if (lastSeparatorIndex != -1)
dialog.setFilterPath(str.substring(0, lastSeparatorIndex));
if (lastSeparatorIndex != -1) dialog.setFilterPath(str.substring(0, lastSeparatorIndex));
str = dialog.open();
if (str != null)
text.setText(str);
if (str != null) text.setText(str);
}
private void variablesButtonSelected(Text text) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(
getShell());
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
if (dialog.open() == StringVariableSelectionDialog.OK) {
text.append(dialog.getVariableExpression());
}
@ -177,8 +176,8 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
jtagDevice = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN);
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.
getInstance().getGDBJtagDeviceContribution();
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
.getGDBJtagDeviceContribution();
for (int i = 0; i < availableDevices.length; i++) {
jtagDevice.add(availableDevices[i].getDeviceName());
}
@ -225,9 +224,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
* @param text
*/
protected void updateDeviceIpPort(String selectedDeviceName) {
if (selectedDeviceName.equals(savedJtagDevice)) {
return;
}
if (selectedDeviceName.equals(savedJtagDevice)) { return; }
GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance()
.getGDBJtagDeviceContribution();
IGDBJtagDevice selectedDevice = null;
@ -256,17 +253,21 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
public void initializeFrom(ILaunchConfiguration configuration) {
try {
String gdbCommandAttr = configuration.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
String gdbCommandAttr = configuration.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME,
IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
gdbCommand.setText(gdbCommandAttr);
boolean useRemoteAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
boolean useRemoteAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET,
IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
useRemote.setSelection(useRemoteAttr);
useRemoteChanged();
String ipAddressAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS);
String ipAddressAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS,
IGDBJtagConstants.DEFAULT_IP_ADDRESS);
ipAddress.setText(ipAddressAttr);
int portNumberAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER);
int portNumberAttr = configuration.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER,
IGDBJtagConstants.DEFAULT_PORT_NUMBER);
portNumber.setText(String.valueOf(portNumberAttr));
savedJtagDevice = configuration.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, "");
@ -297,20 +298,24 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, useRemote.getSelection());
configuration.setAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, ipAddress.getText().trim());
try {
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, Integer.parseInt(portNumber.getText().trim()));
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, Integer
.parseInt(portNumber.getText().trim()));
} catch (NumberFormatException e) {
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, 0);
}
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME,
IMILaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
CommandFactoryManager cfManager = MIPlugin.getDefault().getCommandFactoryManager();
CommandFactoryDescriptor defDesc = cfManager.getDefaultDescriptor(IGDBJtagConstants.DEBUGGER_ID);
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_COMMAND_FACTORY, defDesc.getName());
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, defDesc.getMIVersions()[0]);
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE, IMILaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT);
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
configuration.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_VERBOSE_MODE,
IMILaunchConfigurationConstants.DEBUGGER_VERBOSE_MODE_DEFAULT);
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET,
IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
configuration.setAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS);
configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER);
}