ArmUnwindInfo.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #ifndef LLDB_SYMBOL_ARMUNWINDINFO_H
  9. #define LLDB_SYMBOL_ARMUNWINDINFO_H
  10. #include "lldb/Symbol/ObjectFile.h"
  11. #include "lldb/Utility/DataExtractor.h"
  12. #include "lldb/Utility/RangeMap.h"
  13. #include "lldb/lldb-private.h"
  14. #include <vector>
  15. /*
  16. * Unwind information reader and parser for the ARM exception handling ABI
  17. *
  18. * Implemented based on:
  19. * Exception Handling ABI for the ARM Architecture
  20. * Document number: ARM IHI 0038A (current through ABI r2.09)
  21. * Date of Issue: 25th January 2007, reissued 30th November 2012
  22. * http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf
  23. */
  24. namespace lldb_private {
  25. class ArmUnwindInfo {
  26. public:
  27. ArmUnwindInfo(ObjectFile &objfile, lldb::SectionSP &arm_exidx,
  28. lldb::SectionSP &arm_extab);
  29. ~ArmUnwindInfo();
  30. bool GetUnwindPlan(Target &target, const Address &addr,
  31. UnwindPlan &unwind_plan);
  32. private:
  33. struct ArmExidxEntry {
  34. ArmExidxEntry(uint32_t f, lldb::addr_t a, uint32_t d);
  35. bool operator<(const ArmExidxEntry &other) const;
  36. uint32_t file_address;
  37. lldb::addr_t address;
  38. uint32_t data;
  39. };
  40. const uint8_t *GetExceptionHandlingTableEntry(const Address &addr);
  41. uint8_t GetByteAtOffset(const uint32_t *data, uint16_t offset) const;
  42. uint64_t GetULEB128(const uint32_t *data, uint16_t &offset,
  43. uint16_t max_offset) const;
  44. const lldb::ByteOrder m_byte_order;
  45. lldb::SectionSP m_arm_exidx_sp; // .ARM.exidx section
  46. lldb::SectionSP m_arm_extab_sp; // .ARM.extab section
  47. DataExtractor m_arm_exidx_data; // .ARM.exidx section data
  48. DataExtractor m_arm_extab_data; // .ARM.extab section data
  49. std::vector<ArmExidxEntry> m_exidx_entries;
  50. };
  51. } // namespace lldb_private
  52. #endif // LLDB_SYMBOL_ARMUNWINDINFO_H