/** Fall-through virtual address. A block's fall-through address is the virtual address that follows the last byte of the * block's last instruction. The block must have instructions (e.g., it cannot be a strict data block). */ rose_addr_t SgAsmBlock::get_fallthrough_va() { ROSE_ASSERT(!get_statementList().empty()); SgAsmInstruction *last = isSgAsmInstruction(get_statementList().back()); ROSE_ASSERT(last!=NULL); return last->get_address() + last->get_size(); }
SgAsmInstruction* InstructionProvider::operator[](rose_addr_t va) const { SgAsmInstruction *insn = NULL; if (!insnMap_.getOptional(va).assignTo(insn)) { if (useDisassembler_ && memMap_.at(va).require(MemoryMap::EXECUTABLE).exists()) { try { insn = disassembler_->disassembleOne(&memMap_, va); } catch (const Disassembler::Exception &e) { insn = disassembler_->make_unknown_instruction(e); ASSERT_not_null(insn); uint8_t byte; if (1==memMap_.at(va).limit(1).require(MemoryMap::EXECUTABLE).read(&byte).size()) insn->set_raw_bytes(SgUnsignedCharList(1, byte)); ASSERT_require(insn->get_address()==va); ASSERT_require(insn->get_size()==1); } } insnMap_.insert(va, insn); } return insn; }