1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56: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() * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#suspend()
*/ */
public void suspend() throws CDIException { 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(); MISession mi = session.getMISession();
try { try {
mi.getMIInferior().interrupt(); 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) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
} }