1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

sync 10 secs to gdb to SIGINT the inferior.

This commit is contained in:
Alain Magloire 2003-04-02 21:18:32 +00:00
parent eb6a564511
commit f4e1d9d593

View file

@ -474,10 +474,20 @@ public class Target implements ICDITarget {
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#suspend()
*/
public void suspend() throws CDIException {
// send a noop to see if we get an aswer.
// Send the interrupt an sync for 10 seconds.
// for an answer. The waiting time is arbitrary.
MISession mi = session.getMISession();
try {
mi.getMIInferior().interrupt();
for (int i = 0; isRunning() && i < 5; i++) {
try {
java.lang.Thread.sleep(2000);
} catch (InterruptedException e) {
}
}
if (isRunning()) {
throw new CDIException("Failed to suspend");
}
} catch (MIException e) {
throw new MI2CDIException(e);
}