LLDB  mainline
ArmUnwindInfo.h
Go to the documentation of this file.
1 //===-- ArmUnwindInfo.h -----------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SYMBOL_ARMUNWINDINFO_H
10 #define LLDB_SYMBOL_ARMUNWINDINFO_H
11 
12 #include "lldb/Symbol/ObjectFile.h"
14 #include "lldb/Utility/RangeMap.h"
15 #include "lldb/lldb-private.h"
16 #include <vector>
17 
18 /*
19  * Unwind information reader and parser for the ARM exception handling ABI
20  *
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
26  */
27 
28 namespace lldb_private {
29 
31 public:
32  ArmUnwindInfo(ObjectFile &objfile, lldb::SectionSP &arm_exidx,
33  lldb::SectionSP &arm_extab);
34 
36 
37  bool GetUnwindPlan(Target &target, const Address &addr,
38  UnwindPlan &unwind_plan);
39 
40 private:
41  struct ArmExidxEntry {
43 
44  bool operator<(const ArmExidxEntry &other) const;
45 
49  };
50 
51  const uint8_t *GetExceptionHandlingTableEntry(const Address &addr);
52 
53  uint8_t GetByteAtOffset(const uint32_t *data, uint16_t offset) const;
54 
55  uint64_t GetULEB128(const uint32_t *data, uint16_t &offset,
56  uint16_t max_offset) const;
57 
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;
64 };
65 
66 } // namespace lldb_private
67 
68 #endif // LLDB_SYMBOL_ARMUNWINDINFO_H
lldb_private::ArmUnwindInfo::m_arm_exidx_sp
lldb::SectionSP m_arm_exidx_sp
Definition: ArmUnwindInfo.h:59
lldb_private::ArmUnwindInfo::ArmUnwindInfo
ArmUnwindInfo(ObjectFile &objfile, lldb::SectionSP &arm_exidx, lldb::SectionSP &arm_extab)
Definition: ArmUnwindInfo.cpp:48
lldb_private::ArmUnwindInfo::GetULEB128
uint64_t GetULEB128(const uint32_t *data, uint16_t &offset, uint16_t max_offset) const
Definition: ArmUnwindInfo.cpp:85
lldb_private::ArmUnwindInfo
Definition: ArmUnwindInfo.h:30
lldb_private::ArmUnwindInfo::GetUnwindPlan
bool GetUnwindPlan(Target &target, const Address &addr, UnwindPlan &unwind_plan)
Definition: ArmUnwindInfo.cpp:99
lldb_private::ArmUnwindInfo::m_exidx_entries
std::vector< ArmExidxEntry > m_exidx_entries
Definition: ArmUnwindInfo.h:63
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
RangeMap.h
lldb_private::Target
Definition: Target.h:451
lldb_private::ArmUnwindInfo::m_arm_extab_data
DataExtractor m_arm_extab_data
Definition: ArmUnwindInfo.h:62
lldb_private::ArmUnwindInfo::~ArmUnwindInfo
~ArmUnwindInfo()
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::ArmUnwindInfo::ArmExidxEntry::address
lldb::addr_t address
Definition: ArmUnwindInfo.h:47
lldb_private::ArmUnwindInfo::GetByteAtOffset
uint8_t GetByteAtOffset(const uint32_t *data, uint16_t offset) const
Definition: ArmUnwindInfo.cpp:77
ObjectFile.h
lldb-private.h
lldb_private::ArmUnwindInfo::ArmExidxEntry::file_address
uint32_t file_address
Definition: ArmUnwindInfo.h:46
uint32_t
lldb_private::ArmUnwindInfo::m_arm_extab_sp
lldb::SectionSP m_arm_extab_sp
Definition: ArmUnwindInfo.h:60
lldb_private::Address
Definition: Address.h:59
uint16_t
lldb_private::ArmUnwindInfo::GetExceptionHandlingTableEntry
const uint8_t * GetExceptionHandlingTableEntry(const Address &addr)
Definition: ArmUnwindInfo.cpp:354
DataExtractor.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ArmUnwindInfo::m_byte_order
const lldb::ByteOrder m_byte_order
Definition: ArmUnwindInfo.h:58
lldb_private::ArmUnwindInfo::m_arm_exidx_data
DataExtractor m_arm_exidx_data
Definition: ArmUnwindInfo.h:61
lldb_private::ArmUnwindInfo::ArmExidxEntry::ArmExidxEntry
ArmExidxEntry(uint32_t f, lldb::addr_t a, uint32_t d)
Definition: ArmUnwindInfo.cpp:40
lldb_private::UnwindPlan
Definition: UnwindPlan.h:53
lldb_private::ArmUnwindInfo::ArmExidxEntry::data
uint32_t data
Definition: ArmUnwindInfo.h:48
lldb_private::ArmUnwindInfo::ArmExidxEntry::operator<
bool operator<(const ArmExidxEntry &other) const
Definition: ArmUnwindInfo.cpp:44
lldb_private::ArmUnwindInfo::ArmExidxEntry
Definition: ArmUnwindInfo.h:41
lldb_private::ObjectFile
Definition: ObjectFile.h:58
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138