| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium 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 #ifndef COURGETTE_DISASSEMBLER_ELF_32_ARM_H_ | 5 #ifndef COURGETTE_DISASSEMBLER_ELF_32_ARM_H_ |
| 6 #define COURGETTE_DISASSEMBLER_ELF_32_ARM_H_ | 6 #define COURGETTE_DISASSEMBLER_ELF_32_ARM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 enum ARM_RVA { | 21 enum ARM_RVA { |
| 22 ARM_OFF8, | 22 ARM_OFF8, |
| 23 ARM_OFF11, | 23 ARM_OFF11, |
| 24 ARM_OFF24, | 24 ARM_OFF24, |
| 25 ARM_OFF25, | 25 ARM_OFF25, |
| 26 ARM_OFF21, | 26 ARM_OFF21, |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 class DisassemblerElf32ARM : public DisassemblerElf32 { | 29 class DisassemblerElf32ARM : public DisassemblerElf32 { |
| 30 public: | 30 public: |
| 31 static bool QuickDetects(const void* start, size_t length) { |
| 32 return DisassemblerElf32::QuickDetects( |
| 33 reinterpret_cast<const uint8_t*>(start), length, EM_ARM); |
| 34 } |
| 35 |
| 31 class TypedRVAARM : public TypedRVA { | 36 class TypedRVAARM : public TypedRVA { |
| 32 public: | 37 public: |
| 33 TypedRVAARM(ARM_RVA type, RVA rva) : TypedRVA(rva), type_(type) { } | 38 TypedRVAARM(ARM_RVA type, RVA rva) : TypedRVA(rva), type_(type) { } |
| 34 ~TypedRVAARM() override { } | 39 ~TypedRVAARM() override { } |
| 35 | 40 |
| 36 // TypedRVA interfaces. | 41 // TypedRVA interfaces. |
| 37 CheckBool ComputeRelativeTarget(const uint8_t* op_pointer) override; | 42 CheckBool ComputeRelativeTarget(const uint8_t* op_pointer) override; |
| 38 CheckBool EmitInstruction(AssemblyProgram* program, | 43 CheckBool EmitInstruction(AssemblyProgram* program, |
| 39 Label* label) override; | 44 Label* label) override; |
| 40 uint16_t op_size() const override; | 45 uint16_t op_size() const override; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 #if COURGETTE_HISTOGRAM_TARGETS | 94 #if COURGETTE_HISTOGRAM_TARGETS |
| 90 std::map<RVA, int> rel32_target_rvas_; | 95 std::map<RVA, int> rel32_target_rvas_; |
| 91 #endif | 96 #endif |
| 92 | 97 |
| 93 DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32ARM); | 98 DISALLOW_COPY_AND_ASSIGN(DisassemblerElf32ARM); |
| 94 }; | 99 }; |
| 95 | 100 |
| 96 } // namespace courgette | 101 } // namespace courgette |
| 97 | 102 |
| 98 #endif // COURGETTE_DISASSEMBLER_ELF_32_ARM_H_ | 103 #endif // COURGETTE_DISASSEMBLER_ELF_32_ARM_H_ |
| OLD | NEW |