OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 | 1357 |
1358 void Decoder::DecodeType6(Instruction* instr) { | 1358 void Decoder::DecodeType6(Instruction* instr) { |
1359 DecodeType6CoprocessorIns(instr); | 1359 DecodeType6CoprocessorIns(instr); |
1360 } | 1360 } |
1361 | 1361 |
1362 | 1362 |
1363 int Decoder::DecodeType7(Instruction* instr) { | 1363 int Decoder::DecodeType7(Instruction* instr) { |
1364 if (instr->Bit(24) == 1) { | 1364 if (instr->Bit(24) == 1) { |
1365 if (instr->SvcValue() >= kStopCode) { | 1365 if (instr->SvcValue() >= kStopCode) { |
1366 Format(instr, "stop'cond 'svc"); | 1366 Format(instr, "stop'cond 'svc"); |
1367 out_buffer_pos_ += SNPrintF( | |
1368 out_buffer_ + out_buffer_pos_, "\n %p %08x", | |
1369 reinterpret_cast<void*>(instr + Instruction::kInstrSize), | |
1370 *reinterpret_cast<uint32_t*>(instr + Instruction::kInstrSize)); | |
1371 // We have decoded 2 * Instruction::kInstrSize bytes. | |
1372 return 2 * Instruction::kInstrSize; | |
1373 } else { | 1367 } else { |
1374 Format(instr, "svc'cond 'svc"); | 1368 Format(instr, "svc'cond 'svc"); |
1375 } | 1369 } |
1376 } else { | 1370 } else { |
1377 switch (instr->CoprocessorValue()) { | 1371 switch (instr->CoprocessorValue()) { |
1378 case 10: // Fall through. | 1372 case 10: // Fall through. |
1379 case 11: | 1373 case 11: |
1380 DecodeTypeVFP(instr); | 1374 DecodeTypeVFP(instr); |
1381 break; | 1375 break; |
1382 case 15: | 1376 case 15: |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 pc += d.InstructionDecode(buffer, pc); | 2616 pc += d.InstructionDecode(buffer, pc); |
2623 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), | 2617 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), |
2624 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2618 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
2625 } | 2619 } |
2626 } | 2620 } |
2627 | 2621 |
2628 | 2622 |
2629 } // namespace disasm | 2623 } // namespace disasm |
2630 | 2624 |
2631 #endif // V8_TARGET_ARCH_ARM | 2625 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |