mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Do not try to get the exit value if the session is terminated.
This commit is contained in:
parent
d5fbd8f312
commit
d6695357c3
1 changed files with 11 additions and 9 deletions
|
@ -118,15 +118,17 @@ public class MIInferior extends Process {
|
|||
* @see java.lang.Process#exitValue()
|
||||
*/
|
||||
public int exitValue() {
|
||||
if (isTerminated() && !session.isTerminated()) {
|
||||
CommandFactory factory = session.getCommandFactory();
|
||||
MIGDBShowExitCode code = factory.createMIGDBShowExitCode();
|
||||
try {
|
||||
session.postCommand(code);
|
||||
MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo();
|
||||
return info.getCode();
|
||||
} catch (MIException e) {
|
||||
return 0;
|
||||
if (isTerminated()) {
|
||||
if (!session.isTerminated()) {
|
||||
CommandFactory factory = session.getCommandFactory();
|
||||
MIGDBShowExitCode code = factory.createMIGDBShowExitCode();
|
||||
try {
|
||||
session.postCommand(code);
|
||||
MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo();
|
||||
return info.getCode();
|
||||
} catch (MIException e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new IllegalThreadStateException();
|
||||
|
|
Loading…
Add table
Reference in a new issue