/// there is no program currently running, this just silently succeeds.
void Debugger::killProgram() {
// The destructor takes care of the dirty work.
- delete Process;
+ try {
+ delete Process;
+ } catch (...) {
+ Process = 0;
+ throw;
+ }
Process = 0;
}
try {
Process->stepProgram();
} catch (InferiorProcessDead &IPD) {
- delete Process;
- Process = 0;
+ killProgram();
throw NonErrorException("The program stopped with exit code " +
itostr(IPD.getExitCode()));
+ } catch (...) {
+ killProgram();
+ throw;
}
}
}
} catch (InferiorProcessDead &IPD) {
- delete Process;
- Process = 0;
+ killProgram();
throw NonErrorException("The program stopped with exit code " +
itostr(IPD.getExitCode()));
+ } catch (...) {
+ killProgram();
+ throw;
}
}
try {
Process->finishProgram(Frame);
} catch (InferiorProcessDead &IPD) {
- delete Process;
- Process = 0;
+ killProgram();
throw NonErrorException("The program stopped with exit code " +
itostr(IPD.getExitCode()));
+ } catch (...) {
+ killProgram();
+ throw;
}
}
try {
Process->contProgram();
} catch (InferiorProcessDead &IPD) {
- delete Process;
- Process = 0;
+ killProgram();
throw NonErrorException("The program stopped with exit code " +
itostr(IPD.getExitCode()));
+ } catch (...) {
+ killProgram();
+ throw;
}
}