mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Bug 560186: Resolve API error reported by PDE
Change-Id: I1e813c9104359053ba47005c8eabe5a1b776a01c
This commit is contained in:
parent
36df798323
commit
b03db67d41
3 changed files with 23 additions and 20 deletions
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<component id="org.eclipse.cdt.debug.gdbjtag.core" version="2">
|
||||
<resource path="src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java" type="org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants">
|
||||
<filter id="388194388">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants"/>
|
||||
<message_argument value="DEFAULT_JTAG_DEVICE_ID"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
</component>
|
|
@ -101,13 +101,17 @@ public interface IGDBJtagConstants {
|
|||
public static final String DEFAULT_PC_REGISTER = ""; //$NON-NLS-1$
|
||||
/** @since 7.0 */
|
||||
public static final String DEFAULT_STOP_AT = ""; //$NON-NLS-1$
|
||||
/** @since 9.2 */
|
||||
public static final String DEFAULT_JTAG_DEVICE_ID = "org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"; //$NON-NLS-1$
|
||||
/**
|
||||
* @since 9.2
|
||||
* @deprecated Use a local String if necessary
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String DEFAULT_JTAG_DEVICE_ID = ""; //$NON-NLS-1$
|
||||
/** @since 9.2 */
|
||||
public static final String DEFAULT_JTAG_DEVICE_NAME = ""; //$NON-NLS-1$
|
||||
/**
|
||||
* @since 7.0
|
||||
* @deprecated Use either {@link #DEFAULT_JTAG_DEVICE_ID} or {@link #DEFAULT_JTAG_DEVICE_NAME}
|
||||
* @deprecated Use a local String if necessary
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String DEFAULT_JTAG_DEVICE = ""; //$NON-NLS-1$
|
||||
|
|
|
@ -76,7 +76,8 @@ import org.eclipse.ui.PlatformUI;
|
|||
public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
||||
|
||||
private static final String TAB_NAME = "Debugger";
|
||||
private static final String TAB_ID = "org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.dsf";
|
||||
private static final String TAB_ID = "org.eclipse.cdt.debug.gdbjtag.ui.debuggertab.dsf"; //$NON-NLS-1$
|
||||
private static final String DEFAULT_JTAG_DEVICE_ID = "org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"; //$NON-NLS-1$
|
||||
|
||||
private Text gdbCommand;
|
||||
private Button useRemote;
|
||||
|
@ -428,10 +429,10 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the device id for a given device name or {@link IGDBJtagConstants.DEFAULT_JTAG_DEVICE_ID}
|
||||
* Returns the device id for a given device name or {@link #DEFAULT_JTAG_DEVICE_ID}
|
||||
*
|
||||
* @param jtagDeviceName The device name
|
||||
* @return The device id if found, else {@link IGDBJtagConstants.DEFAULT_JTAG_DEVICE_ID}
|
||||
* @return The device id if found, else {@link #DEFAULT_JTAG_DEVICE_ID}
|
||||
* @since 8.1
|
||||
*/
|
||||
protected String getDeviceIdForDeviceName(String jtagDeviceName) {
|
||||
|
@ -440,7 +441,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
|||
if (device != null) {
|
||||
return device.getDeviceId();
|
||||
}
|
||||
return IGDBJtagConstants.DEFAULT_JTAG_DEVICE_ID;
|
||||
return DEFAULT_JTAG_DEVICE_ID;
|
||||
}
|
||||
|
||||
private GDBJtagDeviceContribution getDeviceContribution(ILaunchConfiguration configuration) throws CoreException {
|
||||
|
@ -481,7 +482,16 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
|||
}
|
||||
|
||||
if (savedJtagDevice.isEmpty()) {
|
||||
jtagDevice.select(0);
|
||||
// saved device not known so use default device attributes
|
||||
String deviceName = getDeviceNameForDeviceId(DEFAULT_JTAG_DEVICE_ID);
|
||||
int index = 0;
|
||||
for (int i = 0; i < jtagDevice.getItemCount(); i++) {
|
||||
if (jtagDevice.getItem(i).equals(deviceName)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
jtagDevice.select(index);
|
||||
} else {
|
||||
String storedAddress = ""; //$NON-NLS-1$
|
||||
int storedPort = 0;
|
||||
|
@ -593,7 +603,7 @@ public class GDBJtagDSFDebuggerTab extends AbstractLaunchConfigurationTab {
|
|||
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET,
|
||||
IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET);
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, IGDBJtagConstants.DEFAULT_JTAG_DEVICE_ID);
|
||||
configuration.setAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, DEFAULT_JTAG_DEVICE_ID);
|
||||
configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
|
||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
|
||||
|
|
Loading…
Add table
Reference in a new issue