1 //===-- ArmUnwindInfo.h -----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_ArmUnwindInfo_h_
10 #define liblldb_ArmUnwindInfo_h_
12 #include "lldb/Symbol/ObjectFile.h"
13 #include "lldb/Utility/DataExtractor.h"
14 #include "lldb/Utility/RangeMap.h"
15 #include "lldb/lldb-private.h"
19 * Unwind information reader and parser for the ARM exception handling ABI
21 * Implemented based on:
22 * Exception Handling ABI for the ARM Architecture
23 * Document number: ARM IHI 0038A (current through ABI r2.09)
24 * Date of Issue: 25th January 2007, reissued 30th November 2012
25 * http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf
28 namespace lldb_private {
32 ArmUnwindInfo(ObjectFile &objfile, lldb::SectionSP &arm_exidx,
33 lldb::SectionSP &arm_extab);
37 bool GetUnwindPlan(Target &target, const Address &addr,
38 UnwindPlan &unwind_plan);
41 struct ArmExidxEntry {
42 ArmExidxEntry(uint32_t f, lldb::addr_t a, uint32_t d);
44 bool operator<(const ArmExidxEntry &other) const;
46 uint32_t file_address;
51 const uint8_t *GetExceptionHandlingTableEntry(const Address &addr);
53 uint8_t GetByteAtOffset(const uint32_t *data, uint16_t offset) const;
55 uint64_t GetULEB128(const uint32_t *data, uint16_t &offset,
56 uint16_t max_offset) const;
58 const lldb::ByteOrder m_byte_order;
59 lldb::SectionSP m_arm_exidx_sp; // .ARM.exidx section
60 lldb::SectionSP m_arm_extab_sp; // .ARM.extab section
61 DataExtractor m_arm_exidx_data; // .ARM.exidx section data
62 DataExtractor m_arm_extab_data; // .ARM.extab section data
63 std::vector<ArmExidxEntry> m_exidx_entries;
66 } // namespace lldb_private
68 #endif // liblldb_ArmUnwindInfo_h_