Iris::ThreadContext::setCCRegFlat(idx, val);
}
-iris::MemorySpaceId
-CortexA76TC::getBpSpaceId(Addr pc) const
+const std::vector<iris::MemorySpaceId> &
+CortexA76TC::getBpSpaceIds() const
{
- if (bpSpaceId == iris::IRIS_UINT64_MAX) {
+ if (bpSpaceIds.empty()) {
for (auto &space: memorySpaces) {
- if (space.canonicalMsn == Iris::CurrentMsn) {
- bpSpaceId = space.spaceId;
- break;
+ auto cmsn = space.canonicalMsn;
+ if (cmsn == Iris::SecureMonitorMsn ||
+ cmsn == Iris::GuestMsn ||
+ cmsn == Iris::NsHypMsn ||
+ cmsn == Iris::HypAppMsn) {
+ bpSpaceIds.push_back(space.spaceId);
}
}
- panic_if(bpSpaceId == iris::IRIS_UINT64_MAX,
- "Unable to find address space for breakpoints.");
+ panic_if(bpSpaceIds.empty(),
+ "Unable to find address space(s) for breakpoints.");
}
- return bpSpaceId;
+ return bpSpaceIds;
}
Iris::ThreadContext::IdxNameMap CortexA76TC::miscRegIdxNameMap({
{ 28, "V28" }, { 29, "V29" }, { 30, "V30" }, { 31, "V31" }
});
-iris::MemorySpaceId CortexA76TC::bpSpaceId = iris::IRIS_UINT64_MAX;
+std::vector<iris::MemorySpaceId> CortexA76TC::bpSpaceIds;
} // namespace FastModel
static IdxNameMap flattenedIntIdxNameMap;
static IdxNameMap ccRegIdxNameMap;
static IdxNameMap vecRegIdxNameMap;
- static iris::MemorySpaceId bpSpaceId;
+ static std::vector<iris::MemorySpaceId> bpSpaceIds;
public:
CortexA76TC(::BaseCPU *cpu, int id, System *system,
RegVal readCCRegFlat(RegIndex idx) const override;
void setCCRegFlat(RegIndex idx, RegVal val) override;
- iris::MemorySpaceId getBpSpaceId(Addr pc) const override;
+ const std::vector<iris::MemorySpaceId> &getBpSpaceIds() const override;
};
} // namespace FastModel
void
ThreadContext::installBp(BpInfoIt it)
{
- BpId id;
Addr pc = it->second->pc;
- auto space_id = getBpSpaceId(pc);
- call().breakpoint_set_code(_instId, id, pc, space_id, 0, true);
- it->second->id = id;
+ const auto &space_ids = getBpSpaceIds();
+ for (auto sid: space_ids) {
+ BpId id;
+ call().breakpoint_set_code(_instId, id, pc, sid, 0, true);
+ it->second->ids.push_back(id);
+ }
}
void
ThreadContext::uninstallBp(BpInfoIt it)
{
- call().breakpoint_delete(_instId, it->second->id);
- it->second->clearId();
+ for (auto id: it->second->ids)
+ call().breakpoint_delete(_instId, id);
+ it->second->clearIds();
}
void
panic_if(!it->second->empty(),
"BP info still had events associated with it.");
- if (it->second->validId())
+ if (it->second->validIds())
uninstallBp(it);
bps.erase(it);
auto it = getOrAllocBp(e->pc());
it->second->events->push_back(e);
- if (_instId != iris::IRIS_UINT64_MAX && !it->second->validId())
+ if (_instId != iris::IRIS_UINT64_MAX && !it->second->validIds())
installBp(it);
return true;
struct BpInfo
{
Addr pc;
- BpId id;
+ std::vector<BpId> ids;
using EventList = std::list<PCEvent *>;
std::shared_ptr<EventList> events;
- BpInfo(Addr _pc) : pc(_pc), id(iris::IRIS_UINT64_MAX),
- events(new EventList)
- {}
+ BpInfo(Addr _pc) : pc(_pc), events(new EventList) {}
bool empty() const { return events->empty(); }
- bool validId() const { return id != iris::IRIS_UINT64_MAX; }
- void clearId() { id = iris::IRIS_UINT64_MAX; }
+ bool validIds() const { return !ids.empty(); }
+ void clearIds() { ids.clear(); }
};
using BpInfoPtr = std::unique_ptr<BpInfo>;
void uninstallBp(BpInfoIt it);
void delBp(BpInfoIt it);
- virtual iris::MemorySpaceId getBpSpaceId(Addr pc) const = 0;
+ virtual const std::vector<iris::MemorySpaceId> &getBpSpaceIds() const = 0;
iris::IrisErrorCode instanceRegistryChanged(