mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[108331] - applied patch for extending jtag devices
This commit is contained in:
parent
fe6577cf5a
commit
b10d7e7586
2 changed files with 12 additions and 1 deletions
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.gdbjtag.core.jtagdevice;
|
|||
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.Activator;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
|
||||
|
@ -22,6 +23,7 @@ public class GDBJtagDeviceContribution {
|
|||
private String deviceName;
|
||||
private String deviceClassName;
|
||||
private IGDBJtagDevice device;
|
||||
private String deviceClassBundleName;
|
||||
|
||||
/**
|
||||
* @return the deviceId
|
||||
|
@ -64,13 +66,21 @@ public class GDBJtagDeviceContribution {
|
|||
public void setDeviceClassName(String deviceClassName) {
|
||||
this.deviceClassName = deviceClassName;
|
||||
}
|
||||
|
||||
public String getDeviceClassBundleName() {
|
||||
return deviceClassBundleName;
|
||||
}
|
||||
|
||||
public void setDeviceClassBundleName(String deviceClassBundleName) {
|
||||
this.deviceClassBundleName = deviceClassBundleName;
|
||||
}
|
||||
|
||||
public IGDBJtagDevice getDevice() throws NullPointerException {
|
||||
if (device != null)
|
||||
return device;
|
||||
Object o = null;
|
||||
try {
|
||||
o = Class.forName(getDeviceClassName()).newInstance();
|
||||
o = Platform.getBundle(deviceClassBundleName).loadClass(deviceClassName).newInstance();
|
||||
} catch (InstantiationException e) {
|
||||
Activator.log(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(),
|
||||
DebugPlugin.INTERNAL_ERROR, "Error instantiating "
|
||||
|
|
|
@ -55,6 +55,7 @@ public class GDBJtagDeviceContributionFactory {
|
|||
adapter.setDeviceId(id);
|
||||
adapter.setDeviceName(name);
|
||||
adapter.setDeviceClassName(className);
|
||||
adapter.setDeviceClassBundleName(configurationElement.getContributor().getName());
|
||||
addContribution(adapter);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue