using vixl::aarch32::MemOperand; using vixl::aarch32::PrintDisassembler; using vixl::aarch32::pc;
staticconst vixl::aarch32::Register tr(TR);
class DisassemblerArm::CustomDisassembler final : public PrintDisassembler { class CustomDisassemblerStream final : public DisassemblerStream { public:
CustomDisassemblerStream(std::ostream& os, const CustomDisassembler* disasm, const DisassemblerOptions* options)
: DisassemblerStream(os), disasm_(disasm), options_(options) {}
DisassemblerStream& operator<<(const MemOperand& operand) override { // VIXL must use a PrintLabel object whenever the base register is PC; // the following check verifies this invariant, and guards against bugs.
DCHECK(!operand.GetBaseRegister().Is(pc));
DisassemblerStream::operator<<(operand);
DisassemblerStream& operator<<(const vixl::aarch32::AlignedMemOperand& operand) override { // VIXL must use a PrintLabel object whenever the base register is PC; // the following check verifies this invariant, and guards against bugs.
DCHECK(!operand.GetBaseRegister().Is(pc)); return DisassemblerStream::operator<<(operand);
}
void DisassemblerArm::CustomDisassembler::CustomDisassemblerStream::PrintLiteral(LocationType type,
int32_t offset) { // Literal offsets are not required to be aligned, so we may need unaligned access. using unaligned_int16_t __attribute__((__aligned__(1))) = const int16_t; using unaligned_uint16_t __attribute__((__aligned__(1))) = const uint16_t; using unaligned_int32_t __attribute__((__aligned__(1))) = const int32_t; using unaligned_int64_t __attribute__((__aligned__(1))) = const int64_t; using unaligned_float __attribute__((__aligned__(1))) = constfloat; using unaligned_double __attribute__((__aligned__(1))) = constdouble;
// Zeros are used for the LocationType values this function does not care about. const size_t literal_size[kVst4Location + 1] = { 0, 0, 0, 0, sizeof(uint8_t), sizeof(unaligned_uint16_t), sizeof(unaligned_int32_t), sizeof(unaligned_int64_t), sizeof(int8_t), sizeof(unaligned_int16_t), sizeof(unaligned_float), sizeof(unaligned_double)}; const uintptr_t begin = reinterpret_cast<uintptr_t>(options_->base_address_); const uintptr_t end = reinterpret_cast<uintptr_t>(options_->end_address_);
uintptr_t literal_addr =
RoundDown(disasm_->GetCodeAddress(), vixl::aarch32::kRegSizeInBytes) + offset;
literal_addr += disasm_->GetIsT32() ? vixl::aarch32::kT32PcDelta : vixl::aarch32::kA32PcDelta;
if (!options_->absolute_addresses_) {
literal_addr += begin;
}
os() << " ; ";
// Bail out if not within expected buffer range to avoid trying to fetch invalid literals // (we can encounter them when interpreting raw data as instructions). if (literal_addr < begin || literal_addr > end - literal_size[type]) {
os() << "(?)";
} else { switch (type) { case kLoadByteLocation:
os() << *reinterpret_cast<const uint8_t*>(literal_addr); break; case kLoadHalfWordLocation:
os() << *reinterpret_cast<unaligned_uint16_t*>(literal_addr); break; case kLoadWordLocation: { const int32_t value = *reinterpret_cast<unaligned_int32_t*>(literal_addr);
os() << "0x" << std::hex << std::setw(8) << std::setfill('0') << value; break;
} case kLoadDoubleWordLocation: { const int64_t value = *reinterpret_cast<unaligned_int64_t*>(literal_addr);
os() << "0x" << std::hex << std::setw(16) << std::setfill('0') << value; break;
} case kLoadSignedByteLocation:
os() << *reinterpret_cast<const int8_t*>(literal_addr); break; case kLoadSignedHalfWordLocation:
os() << *reinterpret_cast<unaligned_int16_t*>(literal_addr); break; case kLoadSinglePrecisionLocation:
os() << *reinterpret_cast<unaligned_float*>(literal_addr); break; case kLoadDoublePrecisionLocation:
os() << *reinterpret_cast<unaligned_double*>(literal_addr); break; default:
UNIMPLEMENTED(FATAL) << "Unexpected literal type: " << type;
}
}
}
size_t DisassemblerArm::Dump(std::ostream& os, const uint8_t* begin) {
uintptr_t next; // Remove the Thumb specifier bit; no effect if begin does not point to T32 code. const uintptr_t instr_ptr = reinterpret_cast<uintptr_t>(begin) & ~1;
if (is_t32) { // The Thumb specifier bits cancel each other.
disasm_->DisassembleT32Buffer(reinterpret_cast<const uint16_t*>(base), end - begin);
} else {
disasm_->DisassembleA32Buffer(reinterpret_cast<const uint32_t*>(base), end - begin);
}
os << output_.str();
output_.str(std::string());
}
} // namespace arm
} // namespace art
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.