mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
Allows launch config to override launch target connection type (#625)
When launching a GDB debug session using the Launch Bar and a Launch Target, now the launch takes into account a REMOTE_TCP value in the launch configuration before considering the type of the Launch Target. Improves the change submitted in: Bug 547881 - Allow targets to set ATTR_REMOTE_TCP Fixes issue #622
This commit is contained in:
parent
93c136de3c
commit
959c02755c
2 changed files with 9 additions and 6 deletions
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb;singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb;singleton:=true
|
||||||
Bundle-Version: 7.1.200.qualifier
|
Bundle-Version: 7.1.300.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.dsf.gdb.internal.GdbPlugin
|
Bundle-Activator: org.eclipse.cdt.dsf.gdb.internal.GdbPlugin
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
Require-Bundle: org.eclipse.core.runtime,
|
Require-Bundle: org.eclipse.core.runtime,
|
||||||
|
|
|
@ -439,16 +439,19 @@ public class GDBControl extends AbstractMIControl implements IGDBControl {
|
||||||
}
|
}
|
||||||
|
|
||||||
// And optionally the target
|
// And optionally the target
|
||||||
if (launch instanceof ITargetedLaunch) {
|
if (launch instanceof ITargetedLaunch targettedLaunch) {
|
||||||
ILaunchTarget target = ((ITargetedLaunch) launch).getLaunchTarget();
|
ILaunchTarget target = targettedLaunch.getLaunchTarget();
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
attributes.putAll(target.getAttributes());
|
attributes.putAll(target.getAttributes());
|
||||||
String tcp = target.getAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, ""); //$NON-NLS-1$
|
String tcp = target.getAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, ""); //$NON-NLS-1$
|
||||||
if (!tcp.isEmpty()) {
|
if (!tcp.isEmpty()) {
|
||||||
attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, Boolean.parseBoolean(tcp));
|
attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, Boolean.parseBoolean(tcp));
|
||||||
} else {
|
} else {
|
||||||
attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP,
|
// If the launch config attrs don't contain a REMOTE_TCP value then check the launch target attrs
|
||||||
target.getTypeId().equals(GDBRemoteTCPLaunchTargetProvider.TYPE_ID));
|
if (!attributes.containsKey(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP)) {
|
||||||
|
attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP,
|
||||||
|
target.getTypeId().equals(GDBRemoteTCPLaunchTargetProvider.TYPE_ID));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -689,7 +692,7 @@ public class GDBControl extends AbstractMIControl implements IGDBControl {
|
||||||
getSession().addServiceEventListener(GDBControl.this, null);
|
getSession().addServiceEventListener(GDBControl.this, null);
|
||||||
register(new String[] { ICommandControl.class.getName(), ICommandControlService.class.getName(),
|
register(new String[] { ICommandControl.class.getName(), ICommandControlService.class.getName(),
|
||||||
IMICommandControl.class.getName(), AbstractMIControl.class.getName(), IGDBControl.class.getName() },
|
IMICommandControl.class.getName(), AbstractMIControl.class.getName(), IGDBControl.class.getName() },
|
||||||
new Hashtable<String, String>());
|
new Hashtable<>());
|
||||||
getSession().dispatchEvent(new GDBControlInitializedDMEvent(getContext()), getProperties());
|
getSession().dispatchEvent(new GDBControlInitializedDMEvent(getContext()), getProperties());
|
||||||
requestMonitor.done();
|
requestMonitor.done();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue