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 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1897 default: { | 1897 default: { |
1898 // The type field is 3-bits in the ARM encoding. | 1898 // The type field is 3-bits in the ARM encoding. |
1899 UNREACHABLE(); | 1899 UNREACHABLE(); |
1900 break; | 1900 break; |
1901 } | 1901 } |
1902 } | 1902 } |
1903 return Instruction::kInstrSize; | 1903 return Instruction::kInstrSize; |
1904 } | 1904 } |
1905 | 1905 |
1906 | 1906 |
1907 } } // namespace v8::internal | 1907 } // namespace internal |
1908 | 1908 } // namespace v8 |
1909 | 1909 |
1910 | 1910 |
1911 //------------------------------------------------------------------------------ | 1911 //------------------------------------------------------------------------------ |
1912 | 1912 |
1913 namespace disasm { | 1913 namespace disasm { |
1914 | 1914 |
1915 | 1915 |
1916 const char* NameConverter::NameOfAddress(byte* addr) const { | 1916 const char* NameConverter::NameOfAddress(byte* addr) const { |
1917 v8::internal::SNPrintF(tmp_buffer_, "%p", addr); | 1917 v8::internal::SNPrintF(tmp_buffer_, "%p", addr); |
1918 return tmp_buffer_.start(); | 1918 return tmp_buffer_.start(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1980 v8::internal::PrintF( | 1980 v8::internal::PrintF( |
1981 f, "%p %08x %s\n", | 1981 f, "%p %08x %s\n", |
1982 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1982 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1983 } | 1983 } |
1984 } | 1984 } |
1985 | 1985 |
1986 | 1986 |
1987 } // namespace disasm | 1987 } // namespace disasm |
1988 | 1988 |
1989 #endif // V8_TARGET_ARCH_ARM | 1989 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |