fast-watchpoints: implementation finished (and tested).

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1900 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2012-11-08 13:36:08 +00:00
parent ddbab2e903
commit bbf7731aa2
5 changed files with 205 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#include "WatchpointBuffer.hpp"
#include "../Listener.hpp"
#include "../Event.hpp"
#include "../SALInst.hpp"
namespace fail {
// FIXME: Can not be inlined this way!
ResultSet& PerfVectorWatchpoints::gather(MemAccessEvent* pData)
{
static ResultSet res;
res.clear(); // FIXME: This should not free the memory of the underlying std::vector.
// Search for all indices of matching listener objects:
for(std::vector<index_t>::iterator it = m_BufList.begin(); it != m_BufList.end(); ++it) {
MemAccessListener* pmal = static_cast<MemAccessListener*>(simulator.dereference(*it));
if (pmal->isMatching(pData)) {
// Update trigger data:
pmal->setTriggerInstructionPointer(pData->getTriggerInstructionPointer());
pmal->setTriggerAddress(pData->getTriggerAddress());
pmal->setTriggerWidth(pData->getTriggerWidth());
pmal->setTriggerAccessType(pData->getTriggerAccessType());
res.add(*it);
}
}
return res;
}
} // end-of-namespace: fail