From 83792f71bd6c23a274a652143ae1d86ddfbda302 Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Mon, 3 Jun 2019 14:15:22 -0400 Subject: [PATCH] Bug 547881 - Allow targets to set ATTR_REMOTE_TCP Adds support for this attribute in the ILaunchTarget attributes and then convert it to the boolean attribute on the launch config. Change-Id: Ieefa6892641517ff0fa6a0a04f63a6a8dbc35bf4 --- .../eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java | 9 +++++++-- .../eclipse/cdt/dsf/gdb/service/command/GDBControl.java | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java index d1ce72b90d9..98e43c98481 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_2.java @@ -551,8 +551,13 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 implements IMultiTerminat ILaunchTarget target = ((ITargetedLaunch) launch).getLaunchTarget(); if (target != null) { attributes.putAll(target.getAttributes()); - attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, - target.getTypeId().equals(GDBRemoteTCPLaunchTargetProvider.TYPE_ID)); + String tcp = target.getAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, ""); //$NON-NLS-1$ + if (!tcp.isEmpty()) { + attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, Boolean.parseBoolean(tcp)); + } else { + attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, + target.getTypeId().equals(GDBRemoteTCPLaunchTargetProvider.TYPE_ID)); + } } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java index 590e71bbe4b..16c45b0a9b5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl.java @@ -443,8 +443,13 @@ public class GDBControl extends AbstractMIControl implements IGDBControl { ILaunchTarget target = ((ITargetedLaunch) launch).getLaunchTarget(); if (target != null) { attributes.putAll(target.getAttributes()); - attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, - target.getTypeId().equals(GDBRemoteTCPLaunchTargetProvider.TYPE_ID)); + String tcp = target.getAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, ""); //$NON-NLS-1$ + if (!tcp.isEmpty()) { + attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, Boolean.parseBoolean(tcp)); + } else { + attributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, + target.getTypeId().equals(GDBRemoteTCPLaunchTargetProvider.TYPE_ID)); + } } }