OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_DISASSEMBLER_H_ | 5 #ifndef VM_DISASSEMBLER_H_ |
6 #define VM_DISASSEMBLER_H_ | 6 #define VM_DISASSEMBLER_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 DisassemblyFormatter() { } | 21 DisassemblyFormatter() { } |
22 virtual ~DisassemblyFormatter() { } | 22 virtual ~DisassemblyFormatter() { } |
23 | 23 |
24 // Consume the decoded instruction at the given pc. | 24 // Consume the decoded instruction at the given pc. |
25 virtual void ConsumeInstruction(char* hex_buffer, | 25 virtual void ConsumeInstruction(char* hex_buffer, |
26 intptr_t hex_size, | 26 intptr_t hex_size, |
27 char* human_buffer, | 27 char* human_buffer, |
28 intptr_t human_size, | 28 intptr_t human_size, |
29 uword pc) = 0; | 29 uword pc) = 0; |
30 | 30 |
31 // TODO(regis): Remove Print function once we have a real x64 disassembler. | |
32 // Print a formatted message. | 31 // Print a formatted message. |
33 virtual void Print(const char* format, ...) = 0; | 32 virtual void Print(const char* format, ...) = 0; |
34 }; | 33 }; |
35 | 34 |
36 | 35 |
37 // Basic disassembly formatter that outputs the disassembled instruction | 36 // Basic disassembly formatter that outputs the disassembled instruction |
38 // to stdout. | 37 // to stdout. |
39 class DisassembleToStdout : public DisassemblyFormatter { | 38 class DisassembleToStdout : public DisassemblyFormatter { |
40 public: | 39 public: |
41 DisassembleToStdout() : DisassemblyFormatter() { } | 40 DisassembleToStdout() : DisassemblyFormatter() { } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 uword pc); | 105 uword pc); |
107 | 106 |
108 private: | 107 private: |
109 static const int kHexadecimalBufferSize = 32; | 108 static const int kHexadecimalBufferSize = 32; |
110 static const int kUserReadableBufferSize = 256; | 109 static const int kUserReadableBufferSize = 256; |
111 }; | 110 }; |
112 | 111 |
113 } // namespace dart | 112 } // namespace dart |
114 | 113 |
115 #endif // VM_DISASSEMBLER_H_ | 114 #endif // VM_DISASSEMBLER_H_ |
OLD | NEW |