auto it = getOrAllocBp(pc);
- auto e_it = it->second->events.begin();
- while (e_it != it->second->events.end()) {
+ std::shared_ptr<BpInfo::EventList> events = it->second->events;
+ auto e_it = events->begin();
+ while (e_it != events->end()) {
PCEvent *e = *e_it;
// Advance e_it here since e might remove itself from the list.
e_it++;
ThreadContext::schedule(PCEvent *e)
{
auto it = getOrAllocBp(e->pc());
- it->second->events.push_back(e);
+ it->second->events->push_back(e);
if (_instId != iris::IRIS_UINT64_MAX && !it->second->validId())
installBp(it);
ThreadContext::remove(PCEvent *e)
{
auto it = getOrAllocBp(e->pc());
- it->second->events.remove(e);
+ it->second->events->remove(e);
if (it->second->empty())
delBp(it);
{
Addr pc;
BpId id;
- std::list<PCEvent *> events;
+ using EventList = std::list<PCEvent *>;
+ std::shared_ptr<EventList> events;
- BpInfo(Addr _pc) : pc(_pc), id(iris::IRIS_UINT64_MAX) {}
+ BpInfo(Addr _pc) : pc(_pc), id(iris::IRIS_UINT64_MAX),
+ events(new EventList)
+ {}
- bool empty() const { return events.empty(); }
+ bool empty() const { return events->empty(); }
bool validId() const { return id != iris::IRIS_UINT64_MAX; }
void clearId() { id = iris::IRIS_UINT64_MAX; }
};