mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
2004-11-24 Alain Magloire
Make the terminate() more responsive when gdb is shuting down. See long discussion part of the 77435 fixes and 40087. * cdi/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java * mi/org/eclipse/cdt/debug/core/MIInferior.java
This commit is contained in:
parent
317776f413
commit
c4a7c7ac9d
3 changed files with 40 additions and 15 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-11-24 Alain Magloire
|
||||
Make the terminate() more responsive when gdb is shuting down.
|
||||
See long discussion part of the 77435 fixes and 40087.
|
||||
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/ExpressionManager.java
|
||||
* mi/org/eclipse/cdt/debug/core/MIInferior.java
|
||||
|
||||
2004-11-23 Alain Magloire
|
||||
Tentative fix for 77435
|
||||
* cdi/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java
|
||||
|
|
|
@ -120,15 +120,24 @@ public class ExpressionManager extends Manager {
|
|||
String varName = variable.getMIVar().getVarName();
|
||||
MIVarChange[] changes = noChanges;
|
||||
MIVarUpdate update = factory.createMIVarUpdate(varName);
|
||||
MIVarUpdateInfo info = null;
|
||||
try {
|
||||
mi.postCommand(update);
|
||||
MIVarUpdateInfo info = update.getMIVarUpdateInfo();
|
||||
} catch (MIException e) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
boolean timedout = false;
|
||||
try {
|
||||
info = update.getMIVarUpdateInfo();
|
||||
if (info == null) {
|
||||
timedout = true;
|
||||
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
|
||||
}
|
||||
changes = info.getMIVarChanges();
|
||||
} catch (MIException e) {
|
||||
//throw new MI2CDIException(e);
|
||||
if (timedout) {
|
||||
throw new MI2CDIException(e);
|
||||
}
|
||||
eventList.add(new MIVarDeletedEvent(mi, varName));
|
||||
}
|
||||
for (int j = 0; j < changes.length; j++) {
|
||||
|
|
|
@ -35,6 +35,7 @@ public class MIInferior extends Process {
|
|||
|
||||
boolean connected = false;
|
||||
|
||||
boolean exitCodeKnown = false;
|
||||
int exitCode = 0;
|
||||
int state = 0;
|
||||
|
||||
|
@ -132,14 +133,17 @@ public class MIInferior extends Process {
|
|||
public int exitValue() {
|
||||
if (isTerminated()) {
|
||||
if (!session.isTerminated()) {
|
||||
CommandFactory factory = session.getCommandFactory();
|
||||
MIGDBShowExitCode code = factory.createMIGDBShowExitCode();
|
||||
try {
|
||||
session.postCommand(code);
|
||||
MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo();
|
||||
exitCode = info.getCode();
|
||||
} catch (MIException e) {
|
||||
// no rethrown.
|
||||
if (!exitCodeKnown) {
|
||||
CommandFactory factory = session.getCommandFactory();
|
||||
MIGDBShowExitCode code = factory.createMIGDBShowExitCode();
|
||||
try {
|
||||
session.postCommand(code);
|
||||
MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo();
|
||||
exitCode = info.getCode();
|
||||
} catch (MIException e) {
|
||||
// no rethrown.
|
||||
}
|
||||
exitCodeKnown = true;
|
||||
}
|
||||
}
|
||||
return exitCode;
|
||||
|
@ -174,11 +178,16 @@ public class MIInferior extends Process {
|
|||
}
|
||||
int token = 0;
|
||||
if (isSuspended()) {
|
||||
CommandFactory factory = session.getCommandFactory();
|
||||
MIExecAbort abort = factory.createMIExecAbort();
|
||||
session.postCommand0(abort, session.getCommandTimeout());
|
||||
abort.getMIInfo();
|
||||
token = abort.getToken();
|
||||
try {
|
||||
CommandFactory factory = session.getCommandFactory();
|
||||
MIExecAbort abort = factory.createMIExecAbort();
|
||||
session.postCommand0(abort, -1);
|
||||
// do not wait for the answer.
|
||||
//abort.getMIInfo();
|
||||
token = abort.getToken();
|
||||
} catch (MIException e) {
|
||||
// ignore the error
|
||||
}
|
||||
}
|
||||
setTerminated(token, true);
|
||||
} else if (session.isCoreSession() && !isTerminated()){
|
||||
|
|
Loading…
Add table
Reference in a new issue