Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
CW Issue #2790: Fix various issues with debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eharris369 committed Apr 29, 2020
1 parent a12671f commit e775808
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ public void clearDebugger() {
Logger.logError("An error occurred while disconnecting the debugger for project: " + name, e); //$NON-NLS-1$
}
}
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
launchManager.removeLaunch(launch);
ILaunchConfiguration launchConfig = launch.getLaunchConfiguration();
if (launchConfig != null) {
try {
launchConfig.delete();
} catch (CoreException e) {
Logger.logError("An error occurred while deleting the launch configuration for project: " + name, e); //$NON-NLS-1$
}
}
}
setLaunch(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ public static void endPortForward(CodewindApplication app, PortForwardInfo pfInf
if (!pfInfo.launch.isTerminated()) {
pfInfo.launch.terminate();
}
DebugPlugin.getDefault().getLaunchManager().removeLaunch(pfInfo.launch);
ILaunchConfiguration launchConfig = pfInfo.launch.getLaunchConfiguration();
if (launchConfig != null) {
launchConfig.delete();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ public void clearDebugger() {

private void cleanupPortForwarding() {
if (debugPFInfo != null) {
Logger.log("Ending port forwarding for the " + name + " application: " + debugPFInfo.localPort + ":" + debugPFInfo.remotePort); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

// Clear out the port forwarding info to indicate that it was ended internally
PortForwardInfo info = debugPFInfo;
debugPFInfo = null;
try {
Logger.log("Ending port forwarding for the " + name + " application: " + debugPFInfo.localPort + ":" + debugPFInfo.remotePort); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
KubeUtil.endPortForward(this, info);
} catch (Exception e) {
Logger.logError("An error occurred trying to terminate the debug port forward for: " + name, e); //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ private void launchInner(ILaunchConfiguration config, String launchMode, ILaunch
if (debugTarget != null) {
Logger.log("Debugger connect success. Application should go into Debugging state soon."); //$NON-NLS-1$
launch.addDebugTarget(debugTarget);
}
else {
} else if (!monitor.isCanceled()) {
Logger.logError("Debugger connect failure"); //$NON-NLS-1$

CoreUtil.openDialog(true,
Messages.DebuggerConnectFailureDialogTitle,
Messages.DebuggerConnectFailureDialogMsg);
Expand Down

0 comments on commit e775808

Please sign in to comment.