Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:51

0001 //===-- ArmUnwindInfo.h -----------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_SYMBOL_ARMUNWINDINFO_H
0010 #define LLDB_SYMBOL_ARMUNWINDINFO_H
0011 
0012 #include "lldb/Symbol/ObjectFile.h"
0013 #include "lldb/Utility/DataExtractor.h"
0014 #include "lldb/Utility/RangeMap.h"
0015 #include "lldb/lldb-private.h"
0016 #include <vector>
0017 
0018 /*
0019  * Unwind information reader and parser for the ARM exception handling ABI
0020  *
0021  * Implemented based on:
0022  *     Exception Handling ABI for the ARM Architecture
0023  *     Document number: ARM IHI 0038A (current through ABI r2.09)
0024  *     Date of Issue: 25th January 2007, reissued 30th November 2012
0025  *     http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf
0026  */
0027 
0028 namespace lldb_private {
0029 
0030 class ArmUnwindInfo {
0031 public:
0032   ArmUnwindInfo(ObjectFile &objfile, lldb::SectionSP &arm_exidx,
0033                 lldb::SectionSP &arm_extab);
0034 
0035   ~ArmUnwindInfo();
0036 
0037   bool GetUnwindPlan(Target &target, const Address &addr,
0038                      UnwindPlan &unwind_plan);
0039 
0040 private:
0041   struct ArmExidxEntry {
0042     ArmExidxEntry(uint32_t f, lldb::addr_t a, uint32_t d);
0043 
0044     bool operator<(const ArmExidxEntry &other) const;
0045 
0046     uint32_t file_address;
0047     lldb::addr_t address;
0048     uint32_t data;
0049   };
0050 
0051   const uint8_t *GetExceptionHandlingTableEntry(const Address &addr);
0052 
0053   uint8_t GetByteAtOffset(const uint32_t *data, uint16_t offset) const;
0054 
0055   uint64_t GetULEB128(const uint32_t *data, uint16_t &offset,
0056                       uint16_t max_offset) const;
0057 
0058   const lldb::ByteOrder m_byte_order;
0059   lldb::SectionSP m_arm_exidx_sp; // .ARM.exidx section
0060   lldb::SectionSP m_arm_extab_sp; // .ARM.extab section
0061   DataExtractor m_arm_exidx_data; // .ARM.exidx section data
0062   DataExtractor m_arm_extab_data; // .ARM.extab section data
0063   std::vector<ArmExidxEntry> m_exidx_entries;
0064 };
0065 
0066 } // namespace lldb_private
0067 
0068 #endif // LLDB_SYMBOL_ARMUNWINDINFO_H