Simulator specific listener are now implemented using aspects instead of an additional inheritance level

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1706 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
friemel
2012-10-02 11:42:18 +00:00
parent 4d5bab72b6
commit 7d49b6f063
20 changed files with 176 additions and 296 deletions

View File

@ -35,18 +35,21 @@ void Gem5Controller::reboot()
void Gem5Controller::onBreakpoint(address_t instrPtr, address_t address_space)
{
bool do_fire = false;
BPEvent tmp(instrPtr, address_space);
// Check for active breakpoint-events:
for (ListenerManager::iterator it = m_LstList.begin(); it != m_LstList.end(); it++) {
ListenerManager::iterator it = m_LstList.begin();
BPEvent tmp(instrPtr, address_space);
while (it != m_LstList.end()) {
BaseListener* pLi = *it;
BPListener* pBreakpt = dynamic_cast<BPListener*>(pLi);
if(pBreakpt != NULL && pBreakpt->isMatching(&tmp)) {
if (pBreakpt != NULL && pBreakpt->isMatching(&tmp)) {
pBreakpt->setTriggerInstructionPointer(instrPtr);
it = m_LstList.makeActive(it);
do_fire = true;
// "it" has already been set to the next element (by calling makeActive()):
// "it" has already been set to the next element (by calling
// makeActive()):
continue; // -> skip iterator increment
}
it++;
}
if (do_fire)
m_LstList.triggerActiveListeners();