OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A Disassembler object is used to disassemble a block of code instruction by | 5 // A Disassembler object is used to disassemble a block of code instruction by |
6 // instruction. The default implementation of the NameConverter object can be | 6 // instruction. The default implementation of the NameConverter object can be |
7 // overriden to modify register names or to do symbol lookup on addresses. | 7 // overriden to modify register names or to do symbol lookup on addresses. |
8 // | 8 // |
9 // The example below will disassemble a block of code and print it to stdout. | 9 // The example below will disassemble a block of code and print it to stdout. |
10 // | 10 // |
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 } | 1314 } |
1315 default: { | 1315 default: { |
1316 Format(instr, "UNSUPPORTED"); | 1316 Format(instr, "UNSUPPORTED"); |
1317 UNSUPPORTED_MIPS(); | 1317 UNSUPPORTED_MIPS(); |
1318 } | 1318 } |
1319 } | 1319 } |
1320 return Instruction::kInstrSize; | 1320 return Instruction::kInstrSize; |
1321 } | 1321 } |
1322 | 1322 |
1323 | 1323 |
1324 } } // namespace v8::internal | 1324 } // namespace internal |
1325 | 1325 } // namespace v8 |
1326 | 1326 |
1327 | 1327 |
1328 //------------------------------------------------------------------------------ | 1328 //------------------------------------------------------------------------------ |
1329 | 1329 |
1330 namespace disasm { | 1330 namespace disasm { |
1331 | 1331 |
1332 const char* NameConverter::NameOfAddress(byte* addr) const { | 1332 const char* NameConverter::NameOfAddress(byte* addr) const { |
1333 v8::internal::SNPrintF(tmp_buffer_, "%p", addr); | 1333 v8::internal::SNPrintF(tmp_buffer_, "%p", addr); |
1334 return tmp_buffer_.start(); | 1334 return tmp_buffer_.start(); |
1335 } | 1335 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1397 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1398 } | 1398 } |
1399 } | 1399 } |
1400 | 1400 |
1401 | 1401 |
1402 #undef UNSUPPORTED | 1402 #undef UNSUPPORTED |
1403 | 1403 |
1404 } // namespace disasm | 1404 } // namespace disasm |
1405 | 1405 |
1406 #endif // V8_TARGET_ARCH_MIPS | 1406 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |