diff options
author | David Srbecky <dsrbecky@google.com> | 2015-04-06 18:42:26 +0100 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2015-04-06 18:45:58 +0100 |
commit | d2c80c419f1e16875f556de371e10257bcb59075 (patch) | |
tree | 4005dceed1de90663568bee06f154521b9befba6 /disassembler | |
parent | 9d231cc422b7b32d00bd43ca6993b2dd7e9989ea (diff) | |
download | art-d2c80c419f1e16875f556de371e10257bcb59075.zip art-d2c80c419f1e16875f556de371e10257bcb59075.tar.gz art-d2c80c419f1e16875f556de371e10257bcb59075.tar.bz2 |
Fix address formatting in Mips64 disassembler.
Use FormatInstructionPointer like all the other disassemblers.
This ensures that the 'absolute_addresses' option is honoured.
Change-Id: I5580319cc4fad40e00f3fbbde25b142f7c689390
Diffstat (limited to 'disassembler')
-rw-r--r-- | disassembler/disassembler_mips64.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/disassembler/disassembler_mips64.cc b/disassembler/disassembler_mips64.cc index 7b289d0..ae0fc26 100644 --- a/disassembler/disassembler_mips64.cc +++ b/disassembler/disassembler_mips64.cc @@ -185,7 +185,7 @@ static uint32_t ReadU32(const uint8_t* ptr) { return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24); } -static void DumpMips64(std::ostream& os, const uint8_t* instr_ptr) { +size_t DisassemblerMips64::Dump(std::ostream& os, const uint8_t* instr_ptr) { uint32_t instruction = ReadU32(instr_ptr); uint32_t rs = (instruction >> 21) & 0x1f; // I-type, R-type. @@ -273,19 +273,16 @@ static void DumpMips64(std::ostream& os, const uint8_t* instr_ptr) { } } - os << StringPrintf("%p: %08x\t%-7s ", instr_ptr, instruction, opcode.c_str()) + os << FormatInstructionPointer(instr_ptr) + << StringPrintf(": %08x\t%-7s ", instruction, opcode.c_str()) << args.str() << '\n'; -} - -size_t DisassemblerMips64::Dump(std::ostream& os, const uint8_t* begin) { - DumpMips64(os, begin); return 4; } void DisassemblerMips64::Dump(std::ostream& os, const uint8_t* begin, const uint8_t* end) { for (const uint8_t* cur = begin; cur < end; cur += 4) { - DumpMips64(os, cur); + Dump(os, cur); } } |