mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 16:56:04 +02:00
[305178] Wait for MIStoppedEven instead of the more specific MISignalEvent
This commit is contained in:
parent
396d8a4ffd
commit
c45cc7f9c1
1 changed files with 20 additions and 12 deletions
|
@ -36,7 +36,7 @@ import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||||
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
|
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.command.GDBControl.InitializationShutdownStep;
|
import org.eclipse.cdt.dsf.gdb.service.command.GDBControl.InitializationShutdownStep;
|
||||||
import org.eclipse.cdt.dsf.mi.service.IMIBackend;
|
import org.eclipse.cdt.dsf.mi.service.IMIBackend;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.events.MISignalEvent;
|
import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent;
|
||||||
import org.eclipse.cdt.dsf.service.AbstractDsfService;
|
import org.eclipse.cdt.dsf.service.AbstractDsfService;
|
||||||
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
||||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||||
|
@ -674,7 +674,7 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend {
|
||||||
private final RequestMonitor fRequestMonitor;
|
private final RequestMonitor fRequestMonitor;
|
||||||
|
|
||||||
public MonitorInterruptJob(int timeout, RequestMonitor rm) {
|
public MonitorInterruptJob(int timeout, RequestMonitor rm) {
|
||||||
super("Interrupt monitor job.");
|
super("Interrupt monitor job."); //$NON-NLS-1$
|
||||||
setSystem(true);
|
setSystem(true);
|
||||||
fRequestMonitor = rm;
|
fRequestMonitor = rm;
|
||||||
|
|
||||||
|
@ -698,18 +698,26 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
public RequestMonitor getRequestMonitor() { return fRequestMonitor; }
|
public RequestMonitor getRequestMonitor() { return fRequestMonitor; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* We must listen for an MI event and not a higher-level ISuspendedEvent.
|
* We use this handler to determine if the SIGINT we sent to GDB has been
|
||||||
* The reason is that some ISuspendedEvent are not sent when the target stops,
|
* effective. We must listen for an MI event and not a higher-level
|
||||||
* in cases where we don't want to views to update.
|
* ISuspendedEvent. The reason is that some ISuspendedEvent are not sent
|
||||||
* For example, if we want to interrupt the target to set a breakpoint,
|
* when the target stops, in cases where we don't want to views to update.
|
||||||
* this interruption is done silently; we will receive the MI event though.
|
* For example, if we want to interrupt the target to set a breakpoint, this
|
||||||
*/
|
* interruption is done silently; we will receive the MI event though.
|
||||||
/** @since 3.0 */
|
*
|
||||||
|
* <p>
|
||||||
|
* Though we send a SIGINT, we may not specifically get an MISignalEvent.
|
||||||
|
* Typically we will, but not always, so wait for an MIStoppedEvent. See
|
||||||
|
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=305178#c21
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
*
|
||||||
|
*/
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(final MISignalEvent e) {
|
public void eventDispatched(final MIStoppedEvent e) {
|
||||||
if (fInterruptFailedJob != null) {
|
if (fInterruptFailedJob != null) {
|
||||||
if (fInterruptFailedJob.cancel()) {
|
if (fInterruptFailedJob.cancel()) {
|
||||||
fInterruptFailedJob.getRequestMonitor().done();
|
fInterruptFailedJob.getRequestMonitor().done();
|
||||||
|
|
Loading…
Add table
Reference in a new issue