diff options
author | Jeff Johnston | 2018-05-23 23:15:17 +0000 |
---|---|---|
committer | Jeff Johnston | 2018-05-23 23:15:17 +0000 |
commit | 4c50b40f53125c49ba0567738084808f311ea4c6 (patch) | |
tree | 6b33490a1ddf48adf5e271c7c55dda46a0204b40 /launch/org.eclipse.cdt.docker.launcher | |
parent | d5b2f61dd735f90bf43e63125ae24967f9de784a (diff) | |
download | org.eclipse.cdt-4c50b40f53125c49ba0567738084808f311ea4c6.tar.gz org.eclipse.cdt-4c50b40f53125c49ba0567738084808f311ea4c6.tar.xz org.eclipse.cdt-4c50b40f53125c49ba0567738084808f311ea4c6.zip |
Bug 535014 - cannot debug in a container
- add check for network ports coming back empty for a Container
launch and if so, fall-back to use the ip address of the Container
for the remote host
Change-Id: I83d68a10e2dc92f7d0f27bb9dec304388594b4a3
Diffstat (limited to 'launch/org.eclipse.cdt.docker.launcher')
-rw-r--r-- | launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java index f52cdea7a51..f9a93fec138 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java @@ -392,21 +392,20 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate wc.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE); + Map<String, List<IDockerPortBinding>> hostPorts = new HashMap<>(); if (job.getPorts() != null && isLocalConnection) { - Map<String, List<IDockerPortBinding>> hostPorts = job - .getPorts(); - List<IDockerPortBinding> bindingList = hostPorts - .get(gdbserverPortNumber + "/tcp"); //$NON-NLS-1$ - if (bindingList != null && !bindingList.isEmpty()) { - IDockerPortBinding firstBinding = bindingList - .get(0); - wc.setAttribute( - IGDBLaunchConfigurationConstants.ATTR_HOST, - "localhost"); //$NON-NLS-1$ - wc.setAttribute( - IGDBLaunchConfigurationConstants.ATTR_PORT, - firstBinding.hostPort()); - } + hostPorts = job.getPorts(); + } + List<IDockerPortBinding> bindingList = hostPorts + .get(gdbserverPortNumber + "/tcp"); //$NON-NLS-1$ + if (bindingList != null && !bindingList.isEmpty()) { + IDockerPortBinding firstBinding = bindingList.get(0); + wc.setAttribute( + IGDBLaunchConfigurationConstants.ATTR_HOST, + "localhost"); //$NON-NLS-1$ + wc.setAttribute( + IGDBLaunchConfigurationConstants.ATTR_PORT, + firstBinding.hostPort()); } else { wc.setAttribute( IGDBLaunchConfigurationConstants.ATTR_HOST, |