OLD | NEW |
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 | 835 |
836 namespace v8i = v8::internal; | 836 namespace v8i = v8::internal; |
837 | 837 |
838 | 838 |
839 static const int kMaxRegisters = 16; | 839 static const int kMaxRegisters = 16; |
840 | 840 |
841 // These register names are defined in a way to match the native disassembler | 841 // These register names are defined in a way to match the native disassembler |
842 // formatting. See for example the command "objdump -d <binary file>". | 842 // formatting. See for example the command "objdump -d <binary file>". |
843 static const char* reg_names[kMaxRegisters] = { | 843 static const char* reg_names[kMaxRegisters] = { |
844 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", | 844 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", |
845 "r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", | 845 "r8", "r9", "r10", "fp", "ip", "sp", "lr", "pc", |
846 }; | 846 }; |
847 | 847 |
848 | 848 |
849 const char* NameConverter::NameOfAddress(byte* addr) const { | 849 const char* NameConverter::NameOfAddress(byte* addr) const { |
850 static v8::internal::EmbeddedVector<char, 32> tmp_buffer; | 850 static v8::internal::EmbeddedVector<char, 32> tmp_buffer; |
851 v8::internal::OS::SNPrintF(tmp_buffer, "%p", addr); | 851 v8::internal::OS::SNPrintF(tmp_buffer, "%p", addr); |
852 return tmp_buffer.start(); | 852 return tmp_buffer.start(); |
853 } | 853 } |
854 | 854 |
855 | 855 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 buffer[0] = '\0'; | 922 buffer[0] = '\0'; |
923 byte* prev_pc = pc; | 923 byte* prev_pc = pc; |
924 pc += d.InstructionDecode(buffer, pc); | 924 pc += d.InstructionDecode(buffer, pc); |
925 fprintf(f, "%p %08x %s\n", | 925 fprintf(f, "%p %08x %s\n", |
926 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 926 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
927 } | 927 } |
928 } | 928 } |
929 | 929 |
930 | 930 |
931 } // namespace disasm | 931 } // namespace disasm |
OLD | NEW |