core/sal: allow repeating BochsController::save

BochsController::save() now can in principle be called multiple times
in a row.  Not that this would really make sense, but the results are
consistent now.

Change-Id: Ib4c6eb571a364b0f7ea6142c8cfec004a12f98b3
This commit is contained in:
Horst Schirmeier
2015-02-27 11:42:37 +01:00
parent d2899e8db7
commit bd5802e5d7

View File

@ -19,13 +19,14 @@ aspect SaveState {
advice execution (cpuLoop()) : order ("SaveState", "Breakpoints");
advice execution (cpuLoop()) : after () {
if (!fail::save_bochs_request)
return;
assert(fail::sr_path.size() > 0 && "FATAL ERROR: tried to save state without valid path");
SIM->save_state(fail::sr_path.c_str());
std::cout << "[FAIL] Save finished" << std::endl;
// TODO: Log-Level?
fail::simulator.saveDone();
// loop allows to call save() multiple times in a row
while (fail::save_bochs_request) {
assert(fail::sr_path.size() > 0 && "FATAL ERROR: tried to save state without valid path");
SIM->save_state(fail::sr_path.c_str());
std::cout << "[FAIL] Save finished" << std::endl;
// TODO: Log-Level?
fail::simulator.saveDone();
}
}
};