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 10 matching lines...) Expand all Loading... |
21 // The Disassembler class also has a convenience method to disassemble a block | 21 // The Disassembler class also has a convenience method to disassemble a block |
22 // of code into a FILE*, meaning that the above functionality could also be | 22 // of code into a FILE*, meaning that the above functionality could also be |
23 // achieved by just calling Disassembler::Disassemble(stdout, begin, end); | 23 // achieved by just calling Disassembler::Disassemble(stdout, begin, end); |
24 | 24 |
25 | 25 |
26 #include <assert.h> | 26 #include <assert.h> |
27 #include <stdarg.h> | 27 #include <stdarg.h> |
28 #include <stdio.h> | 28 #include <stdio.h> |
29 #include <string.h> | 29 #include <string.h> |
30 | 30 |
31 #include "src/v8.h" | |
32 | |
33 #if V8_TARGET_ARCH_PPC | 31 #if V8_TARGET_ARCH_PPC |
34 | 32 |
35 #include "src/base/platform/platform.h" | 33 #include "src/base/platform/platform.h" |
36 #include "src/disasm.h" | 34 #include "src/disasm.h" |
37 #include "src/macro-assembler.h" | 35 #include "src/macro-assembler.h" |
38 #include "src/ppc/constants-ppc.h" | 36 #include "src/ppc/constants-ppc.h" |
39 | 37 |
40 | 38 |
41 namespace v8 { | 39 namespace v8 { |
42 namespace internal { | 40 namespace internal { |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 pc += d.InstructionDecode(buffer, pc); | 1400 pc += d.InstructionDecode(buffer, pc); |
1403 v8::internal::PrintF(f, "%p %08x %s\n", prev_pc, | 1401 v8::internal::PrintF(f, "%p %08x %s\n", prev_pc, |
1404 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1402 *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1405 } | 1403 } |
1406 } | 1404 } |
1407 | 1405 |
1408 | 1406 |
1409 } // namespace disasm | 1407 } // namespace disasm |
1410 | 1408 |
1411 #endif // V8_TARGET_ARCH_PPC | 1409 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |