1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

Bug 576884: Ignore unsuitable adapter when the UI layer isn't running

When the UI layer is running the correct terminate adapter is returned,
when the UI layer is not running, the Launch.terminate code is a valid
fallback, and the org.eclipse.debug.internal.core.commands.TerminateCommand
is not an appropriate adapter to use.

Change-Id: I3c4c273b78b4e5bc9fe521b4a24ef5443852d3c0
This commit is contained in:
Jonah Graham 2021-10-25 16:14:43 -04:00
parent 994ea12856
commit e60ef74ebb

View file

@ -303,6 +303,17 @@ public class GdbLaunch extends DsfLaunch implements ITracedLaunch, ITargetedLaun
return; return;
} }
if (handler instanceof org.eclipse.debug.internal.core.commands.TerminateCommand) {
// The org.eclipse.debug.internal.core.commands.TerminateCommand adapter
// calls Launch#terminate (asynchronously) so don't use that adapter.
// This special case code is needed because of behaviour changes
// introduced in Platform. See Bug 576622 and Bug 576024. CDT, when running
// tests, was relying on the undocumented behaviour that meant getAdapter
// was returning null here.
super.terminate();
return;
}
LaunchCommandRequest req = new LaunchCommandRequest(new Object[] { this }); LaunchCommandRequest req = new LaunchCommandRequest(new Object[] { this });
handler.execute(req); handler.execute(req);
} }