mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Catching CLI "detach"
This commit is contained in:
parent
3f0453ac43
commit
b856a2e412
1 changed files with 16 additions and 0 deletions
|
@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.mi.core;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
|
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIBreakpointChangedEvent;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MIRunningEvent;
|
||||||
import org.eclipse.cdt.debug.mi.core.event.MISignalChangedEvent;
|
import org.eclipse.cdt.debug.mi.core.event.MISignalChangedEvent;
|
||||||
|
@ -53,7 +54,13 @@ public class CLIProcessor {
|
||||||
// So the easiest way is to let the top layer handle it.
|
// So the easiest way is to let the top layer handle it.
|
||||||
session.fireEvent(new MIBreakpointChangedEvent(0));
|
session.fireEvent(new MIBreakpointChangedEvent(0));
|
||||||
} else if (isSettingSignal(operation)) {
|
} else if (isSettingSignal(operation)) {
|
||||||
|
// We do no know which signal let the upper layer find it.
|
||||||
session.fireEvent(new MISignalChangedEvent(""));
|
session.fireEvent(new MISignalChangedEvent(""));
|
||||||
|
} else if (isDetach(operation)) {
|
||||||
|
// if it was a "detach" command change the state.
|
||||||
|
session.getMIInferior().setDisconnected();
|
||||||
|
MIEvent event = new MIDetachedEvent(cmd.getToken());
|
||||||
|
session.fireEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,4 +151,13 @@ public class CLIProcessor {
|
||||||
return isChange;
|
return isChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param operation
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isDetach(String operation) {
|
||||||
|
return (operation.startsWith("det") && "detach".indexOf(operation) != -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue