| 173 | } |
| 174 | |
| 175 | const ExecBlock *ExecBlockManager::getExecBlock(rword address, |
| 176 | CPUMode cpumode) const { |
| 177 | QBDI_DEBUG("Looking up address {:x} ({})", address, cpumode); |
| 178 | |
| 179 | size_t r = searchRegion(address); |
| 180 | |
| 181 | if (r < regions.size() && regions[r].covered.contains(address)) { |
| 182 | const ExecRegion ®ion = regions[r]; |
| 183 | |
| 184 | // Attempting instCache resolution |
| 185 | const auto instLoc = |
| 186 | region.instCache.find(getExecRegionKey(address, cpumode)); |
| 187 | if (instLoc != region.instCache.end()) { |
| 188 | QBDI_DEBUG("Found address 0x{:x} ({}) in ExecBlock 0x{:x}", address, |
| 189 | cpumode, |
| 190 | reinterpret_cast<uintptr_t>( |
| 191 | region.blocks[instLoc->second.blockIdx].get())); |
| 192 | return region.blocks[instLoc->second.blockIdx].get(); |
| 193 | } |
| 194 | } |
| 195 | QBDI_DEBUG("Cache miss for address 0x{:x} ({})", address, cpumode); |
| 196 | return nullptr; |
| 197 | } |
| 198 | |
| 199 | size_t |
| 200 | ExecBlockManager::preWriteBasicBlock(const std::vector<Patch> &basicBlock) { |
no test coverage detected