OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 } | 1285 } |
1286 #endif | 1286 #endif |
1287 default: { | 1287 default: { |
1288 Unknown(instr); | 1288 Unknown(instr); |
1289 break; | 1289 break; |
1290 } | 1290 } |
1291 } | 1291 } |
1292 | 1292 |
1293 return Instruction::kInstrSize; | 1293 return Instruction::kInstrSize; |
1294 } | 1294 } |
1295 } | 1295 } // namespace internal |
1296 } // namespace v8::internal | 1296 } // namespace v8 |
1297 | 1297 |
1298 | 1298 |
1299 //------------------------------------------------------------------------------ | 1299 //------------------------------------------------------------------------------ |
1300 | 1300 |
1301 namespace disasm { | 1301 namespace disasm { |
1302 | 1302 |
1303 | 1303 |
1304 const char* NameConverter::NameOfAddress(byte* addr) const { | 1304 const char* NameConverter::NameOfAddress(byte* addr) const { |
1305 v8::internal::SNPrintF(tmp_buffer_, "%p", addr); | 1305 v8::internal::SNPrintF(tmp_buffer_, "%p", addr); |
1306 return tmp_buffer_.start(); | 1306 return tmp_buffer_.start(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 pc += d.InstructionDecode(buffer, pc); | 1364 pc += d.InstructionDecode(buffer, pc); |
1365 v8::internal::PrintF(f, "%p %08x %s\n", prev_pc, | 1365 v8::internal::PrintF(f, "%p %08x %s\n", prev_pc, |
1366 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1366 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1367 } | 1367 } |
1368 } | 1368 } |
1369 | 1369 |
1370 | 1370 |
1371 } // namespace disasm | 1371 } // namespace disasm |
1372 | 1372 |
1373 #endif // V8_TARGET_ARCH_PPC | 1373 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |