SimCon interface update: save returns a boolean, now (+ redundant virtual keywords removed).
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1724 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -108,8 +108,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Save simulator state.
|
* Save simulator state.
|
||||||
* @param path Location to store state information
|
* @param path Location to store state information
|
||||||
|
* @return \c true if the state has been successfully saved, \c false otherwise
|
||||||
*/
|
*/
|
||||||
virtual void save(const std::string& path) = 0;
|
virtual bool save(const std::string& path) = 0;
|
||||||
/**
|
/**
|
||||||
* Restore simulator state. Implicitly discards all previously
|
* Restore simulator state. Implicitly discards all previously
|
||||||
* registered listeners.
|
* registered listeners.
|
||||||
|
|||||||
@ -159,20 +159,23 @@ void BochsController::onIOPort(unsigned char data, unsigned port, bool out) {
|
|||||||
m_LstList.triggerActiveListeners();
|
m_LstList.triggerActiveListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BochsController::save(const std::string& path)
|
bool BochsController::save(const std::string& path)
|
||||||
{
|
{
|
||||||
int stat;
|
int stat;
|
||||||
|
|
||||||
stat = mkdir(path.c_str(), 0777);
|
stat = mkdir(path.c_str(), 0777);
|
||||||
if (!(stat == 0 || errno == EEXIST))
|
if (!(stat == 0 || errno == EEXIST)) {
|
||||||
std::cout << "[FAIL] Can not create target-directory to save!" << std::endl;
|
return false;
|
||||||
|
// std::cout << "[FAIL] Can not create target-directory to save!" << std::endl;
|
||||||
// TODO: (Non-)Verbose-Mode? Log-level? Maybe better: use return value to indicate failure?
|
// TODO: (Non-)Verbose-Mode? Log-level? Maybe better: use return value to indicate failure?
|
||||||
|
}
|
||||||
|
|
||||||
save_bochs_request = true;
|
save_bochs_request = true;
|
||||||
BX_CPU(0)->async_event |= 1;
|
BX_CPU(0)->async_event |= 1;
|
||||||
sr_path = path;
|
sr_path = path;
|
||||||
m_CurrFlow = m_Flows.getCurrent();
|
m_CurrFlow = m_Flows.getCurrent();
|
||||||
m_Flows.resume();
|
m_Flows.resume();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BochsController::saveDone()
|
void BochsController::saveDone()
|
||||||
|
|||||||
@ -87,8 +87,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Save simulator state.
|
* Save simulator state.
|
||||||
* @param path Location to store state information
|
* @param path Location to store state information
|
||||||
|
* @return \c true if the state has been successfully saved, \c false otherwise
|
||||||
*/
|
*/
|
||||||
void save(const std::string& path);
|
bool save(const std::string& path);
|
||||||
/**
|
/**
|
||||||
* Save finished: Callback from Simulator
|
* Save finished: Callback from Simulator
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
namespace fail {
|
namespace fail {
|
||||||
|
|
||||||
void Gem5Controller::save(const std::string &path)
|
bool Gem5Controller::save(const std::string &path)
|
||||||
{
|
{
|
||||||
// Takes a snapshot in the m5out dir
|
// Takes a snapshot in the m5out dir
|
||||||
Tick when = curTick() + 1;
|
Tick when = curTick() + 1;
|
||||||
@ -22,6 +22,7 @@ void Gem5Controller::save(const std::string &path)
|
|||||||
std::ofstream file(path.c_str());
|
std::ofstream file(path.c_str());
|
||||||
root->serialize(file);
|
root->serialize(file);
|
||||||
file.close();*/
|
file.close();*/
|
||||||
|
return false; // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gem5Controller::restore(const std::string &path)
|
void Gem5Controller::restore(const std::string &path)
|
||||||
|
|||||||
@ -11,9 +11,9 @@ class Gem5Controller : public SimulatorController {
|
|||||||
public:
|
public:
|
||||||
void onBreakpoint(address_t instrPtr, address_t address_space);
|
void onBreakpoint(address_t instrPtr, address_t address_space);
|
||||||
|
|
||||||
virtual void save(const std::string &path);
|
bool save(const std::string &path);
|
||||||
virtual void restore(const std::string &path);
|
void restore(const std::string &path);
|
||||||
virtual void reboot();
|
void reboot();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end-of-namespace: fail
|
} // end-of-namespace: fail
|
||||||
|
|||||||
@ -109,10 +109,11 @@ void OVPController::onInstrPtrChanged(address_t instrPtr)
|
|||||||
m_EvList.fireActiveListeners();
|
m_EvList.fireActiveListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OVPController::save(const string& path)
|
bool OVPController::save(const string& path)
|
||||||
{
|
{
|
||||||
// TODO!
|
// TODO!
|
||||||
ovpplatform.save(path);
|
ovpplatform.save(path);
|
||||||
|
return false; // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void OVPController::restore(const string& path)
|
void OVPController::restore(const string& path)
|
||||||
|
|||||||
@ -35,22 +35,23 @@ public:
|
|||||||
* Initialize the controller.
|
* Initialize the controller.
|
||||||
*/
|
*/
|
||||||
OVPController();
|
OVPController();
|
||||||
virtual ~OVPController();
|
~OVPController();
|
||||||
virtual void onInstrPtrChanged(address_t instrPtr);
|
void onInstrPtrChanged(address_t instrPtr);
|
||||||
/**
|
/**
|
||||||
* Save simulator state.
|
* Save simulator state.
|
||||||
* @param path Location to store state information
|
* @param path Location to store state information
|
||||||
|
* @return \c true if the state has been successfully saved, \c false otherwise
|
||||||
*/
|
*/
|
||||||
virtual void save(const std::string& path);
|
bool save(const std::string& path);
|
||||||
/**
|
/**
|
||||||
* Restore simulator state.
|
* Restore simulator state.
|
||||||
* @param path Location to previously saved state information
|
* @param path Location to previously saved state information
|
||||||
*/
|
*/
|
||||||
virtual void restore(const std::string& path);
|
void restore(const std::string& path);
|
||||||
/**
|
/**
|
||||||
* Reboot simulator.
|
* Reboot simulator.
|
||||||
*/
|
*/
|
||||||
virtual void reboot();
|
void reboot();
|
||||||
/**
|
/**
|
||||||
* Returns the current instruction pointer.
|
* Returns the current instruction pointer.
|
||||||
* @return the current eip
|
* @return the current eip
|
||||||
|
|||||||
@ -47,8 +47,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Save simulator state. TODO.
|
* Save simulator state. TODO.
|
||||||
* @param path Location to store state information
|
* @param path Location to store state information
|
||||||
|
* @return \c true if the state has been successfully saved, \c false otherwise
|
||||||
*/
|
*/
|
||||||
void save(const std::string& path) {}
|
bool save(const std::string& path) { return false; }
|
||||||
/**
|
/**
|
||||||
* Restore simulator state. Clears all Listeners. TODO.
|
* Restore simulator state. Clears all Listeners. TODO.
|
||||||
* @param path Location to previously saved state information
|
* @param path Location to previously saved state information
|
||||||
|
|||||||
Reference in New Issue
Block a user