1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

Bug 405899 - Allow to customize the interrupt timeout

Change-Id: I4cc34d8404285ea468fff0aff8240e327b8bdb4f
Reviewed-on: https://git.eclipse.org/r/11987
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
IP-Clean: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
Tested-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
This commit is contained in:
Mikhail Khodjaiants 2013-04-17 12:19:36 -04:00
parent 76b5dde840
commit 6e5f32684a
2 changed files with 12 additions and 4 deletions

View file

@ -152,6 +152,7 @@ public class GDBRunControl extends MIRunControl {
@Override
protected void handleSuccess() {
if (getData()) {
int interruptTimeout = getInterruptTimeout();
// A local Windows attach session requires us to interrupt
// the inferior instead of gdb. This deficiency was fixed
// in gdb 7.0. Note that there's a GDBRunControl_7_0,
@ -164,15 +165,15 @@ public class GDBRunControl extends MIRunControl {
IMIProcessDMContext processDmc = DMContexts.getAncestorOfType(context, IMIProcessDMContext.class);
String inferiorPid = processDmc.getProcId();
if (inferiorPid != null) {
fGdb.interruptInferiorAndWait(Long.parseLong(inferiorPid), IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT, rm);
fGdb.interruptInferiorAndWait(Long.parseLong(inferiorPid), interruptTimeout, rm);
}
else {
assert false : "why don't we have the inferior's pid?"; //$NON-NLS-1$
fGdb.interruptAndWait(IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT, rm);
fGdb.interruptAndWait(interruptTimeout, rm);
}
}
else {
fGdb.interruptAndWait(IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT, rm);
fGdb.interruptAndWait(interruptTimeout, rm);
}
} else {
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Context cannot be suspended.", null)); //$NON-NLS-1$
@ -428,4 +429,11 @@ public class GDBRunControl extends MIRunControl {
super.eventDispatched(e);
}
/**
* @since 4.2
*/
protected int getInterruptTimeout() {
return IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT;
}
}

View file

@ -138,7 +138,7 @@ public class GDBRunControl_7_0 extends GDBRunControl implements IReverseRunContr
@Override
protected void handleSuccess() {
if (getData()) {
fGdb.interruptAndWait(IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT, rm);
fGdb.interruptAndWait(getInterruptTimeout(), rm);
} else {
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Context cannot be suspended.", null)); //$NON-NLS-1$
rm.done();