| Index: runtime/vm/disassembler_ia32.cc
|
| ===================================================================
|
| --- runtime/vm/disassembler_ia32.cc (revision 1950)
|
| +++ runtime/vm/disassembler_ia32.cc (working copy)
|
| @@ -1525,6 +1525,60 @@
|
| return (cpu_regs[reg]);
|
| }
|
|
|
| +
|
| +void Disassembler::Disassemble(uword start,
|
| + uword end,
|
| + DisassemblyFormatter* formatter) {
|
| + ASSERT(formatter != NULL);
|
| + char hex_buffer[kHexadecimalBufferSize]; // Instruction in hexadecimal form.
|
| + char human_buffer[kUserReadableBufferSize]; // Human-readable instruction.
|
| + uword pc = start;
|
| + while (pc < end) {
|
| + int instruction_length = DecodeInstruction(hex_buffer,
|
| + sizeof(hex_buffer),
|
| + human_buffer,
|
| + sizeof(human_buffer),
|
| + pc);
|
| + formatter->ConsumeInstruction(hex_buffer,
|
| + sizeof(hex_buffer),
|
| + human_buffer,
|
| + sizeof(human_buffer),
|
| + pc);
|
| + pc += instruction_length;
|
| + }
|
| +}
|
| +
|
| +
|
| +void Disassembler::DisassembleMemoryRegionRange(
|
| + const MemoryRegion& instructions,
|
| + uword from,
|
| + uword to,
|
| + DisassemblyFormatter *formatter) {
|
| + ASSERT(formatter != NULL);
|
| + char hex_buffer[kHexadecimalBufferSize]; // Instruction in hexadecimal form.
|
| + char human_buffer[kUserReadableBufferSize]; // Human-readable instruction.
|
| + uword start = instructions.start();
|
| + uword end = instructions.end();
|
| + ASSERT((from >= start) && (to <= end) && (from <= to));
|
| + uword pc = start;
|
| + uword stop = Utils::Minimum(end, to);
|
| + while (pc < stop) {
|
| + int instruction_length = DecodeInstruction(hex_buffer,
|
| + sizeof(hex_buffer),
|
| + human_buffer,
|
| + sizeof(human_buffer),
|
| + pc);
|
| + if (pc >= from) {
|
| + formatter->ConsumeInstruction(hex_buffer,
|
| + sizeof(hex_buffer),
|
| + human_buffer,
|
| + sizeof(human_buffer),
|
| + pc);
|
| + }
|
| + pc += instruction_length;
|
| + }
|
| +}
|
| +
|
| } // namespace dart
|
|
|
| #endif // defined TARGET_ARCH_IA32
|
|
|