| 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 // Also print the stop message. Its address is encoded | 1367 out_buffer_pos_ += SNPrintF( |
| 1368 // in the following 4 bytes. | 1368 out_buffer_ + out_buffer_pos_, "\n %p %08x", |
| 1369 out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, | 1369 reinterpret_cast<void*>(instr + Instruction::kInstrSize), |
| 1370 "\n %p %08x stop message: %s", | 1370 *reinterpret_cast<uint32_t*>(instr + Instruction::kInstrSize)); |
| 1371 reinterpret_cast<void*>(instr | |
| 1372 + Instruction::kInstrSize), | |
| 1373 *reinterpret_cast<uint32_t*>(instr | |
| 1374 + Instruction::kInstrSize), | |
| 1375 *reinterpret_cast<char**>(instr | |
| 1376 + Instruction::kInstrSize)); | |
| 1377 // We have decoded 2 * Instruction::kInstrSize bytes. | 1371 // We have decoded 2 * Instruction::kInstrSize bytes. |
| 1378 return 2 * Instruction::kInstrSize; | 1372 return 2 * Instruction::kInstrSize; |
| 1379 } else { | 1373 } else { |
| 1380 Format(instr, "svc'cond 'svc"); | 1374 Format(instr, "svc'cond 'svc"); |
| 1381 } | 1375 } |
| 1382 } else { | 1376 } else { |
| 1383 DecodeTypeVFP(instr); | 1377 DecodeTypeVFP(instr); |
| 1384 } | 1378 } |
| 1385 return Instruction::kInstrSize; | 1379 return Instruction::kInstrSize; |
| 1386 } | 1380 } |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2114 pc += d.InstructionDecode(buffer, pc); | 2108 pc += d.InstructionDecode(buffer, pc); |
| 2115 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), | 2109 v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc), |
| 2116 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 2110 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
| 2117 } | 2111 } |
| 2118 } | 2112 } |
| 2119 | 2113 |
| 2120 | 2114 |
| 2121 } // namespace disasm | 2115 } // namespace disasm |
| 2122 | 2116 |
| 2123 #endif // V8_TARGET_ARCH_ARM | 2117 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |