mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +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:
parent
76b5dde840
commit
6e5f32684a
2 changed files with 12 additions and 4 deletions
|
@ -152,6 +152,7 @@ public class GDBRunControl extends MIRunControl {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
if (getData()) {
|
if (getData()) {
|
||||||
|
int interruptTimeout = getInterruptTimeout();
|
||||||
// A local Windows attach session requires us to interrupt
|
// A local Windows attach session requires us to interrupt
|
||||||
// the inferior instead of gdb. This deficiency was fixed
|
// the inferior instead of gdb. This deficiency was fixed
|
||||||
// in gdb 7.0. Note that there's a GDBRunControl_7_0,
|
// 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);
|
IMIProcessDMContext processDmc = DMContexts.getAncestorOfType(context, IMIProcessDMContext.class);
|
||||||
String inferiorPid = processDmc.getProcId();
|
String inferiorPid = processDmc.getProcId();
|
||||||
if (inferiorPid != null) {
|
if (inferiorPid != null) {
|
||||||
fGdb.interruptInferiorAndWait(Long.parseLong(inferiorPid), IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT, rm);
|
fGdb.interruptInferiorAndWait(Long.parseLong(inferiorPid), interruptTimeout, rm);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert false : "why don't we have the inferior's pid?"; //$NON-NLS-1$
|
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 {
|
else {
|
||||||
fGdb.interruptAndWait(IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT, rm);
|
fGdb.interruptAndWait(interruptTimeout, rm);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Context cannot be suspended.", null)); //$NON-NLS-1$
|
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);
|
super.eventDispatched(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 4.2
|
||||||
|
*/
|
||||||
|
protected int getInterruptTimeout() {
|
||||||
|
return IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class GDBRunControl_7_0 extends GDBRunControl implements IReverseRunContr
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
if (getData()) {
|
if (getData()) {
|
||||||
fGdb.interruptAndWait(IGDBBackend.INTERRUPT_TIMEOUT_DEFAULT, rm);
|
fGdb.interruptAndWait(getInterruptTimeout(), rm);
|
||||||
} else {
|
} else {
|
||||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Context cannot be suspended.", null)); //$NON-NLS-1$
|
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_STATE, "Context cannot be suspended.", null)); //$NON-NLS-1$
|
||||||
rm.done();
|
rm.done();
|
||||||
|
|
Loading…
Add table
Reference in a new issue