|
28 | 28 |
|
29 | 29 | #if defined(TARGET_AMD64)
|
30 | 30 | using libunwind::Registers_x86_64;
|
| 31 | +using libunwind::CompactUnwinder_x86_64; |
31 | 32 | #elif defined(TARGET_ARM)
|
32 | 33 | using libunwind::Registers_arm;
|
33 | 34 | #elif defined(TARGET_ARM64)
|
34 | 35 | using libunwind::Registers_arm64;
|
| 36 | +using libunwind::CompactUnwinder_arm64; |
35 | 37 | #elif defined(TARGET_X86)
|
36 | 38 | using libunwind::Registers_x86;
|
37 | 39 | #else
|
@@ -501,6 +503,8 @@ struct Registers_REGDISPLAY : REGDISPLAY
|
501 | 503 | uint64_t getIP() const { return IP;}
|
502 | 504 | void setIP(uint64_t value, uint64_t location)
|
503 | 505 | { IP = value; pIP = (PTR_UIntNative)location; }
|
| 506 | + uint64_t getFP() const { return *pFP;} |
| 507 | + void setFP(uint64_t value, uint64_t location) { pFP = (PTR_UIntNative)location;} |
504 | 508 | };
|
505 | 509 |
|
506 | 510 | inline bool Registers_REGDISPLAY::validRegister(int num) const {
|
@@ -772,7 +776,37 @@ bool DoTheStep(uintptr_t pc, UnwindInfoSections uwInfoSections, REGDISPLAY *regs
|
772 | 776 | #endif
|
773 | 777 |
|
774 | 778 | #if _LIBUNWIND_SUPPORT_DWARF_UNWIND
|
775 |
| - bool retVal = uc.getInfoFromDwarfSection(pc, uwInfoSections, 0 /* fdeSectionOffsetHint */); |
| 779 | + uint32_t dwarfOffsetHint = 0; |
| 780 | + |
| 781 | +#if _LIBUNWIND_SUPPORT_COMPACT_UNWIND |
| 782 | + // If there is a compact unwind encoding table, look there first. |
| 783 | + if (uwInfoSections.compact_unwind_section != 0 && uc.getInfoFromCompactEncodingSection(pc, uwInfoSections)) { |
| 784 | + unw_proc_info_t procInfo; |
| 785 | + uc.getInfo(&procInfo); |
| 786 | + |
| 787 | +#if defined(TARGET_ARM64) |
| 788 | + if ((procInfo.format & UNWIND_ARM64_MODE_MASK) != UNWIND_ARM64_MODE_DWARF) { |
| 789 | + CompactUnwinder_arm64<LocalAddressSpace, Registers_REGDISPLAY> compactInst; |
| 790 | + int stepRet = compactInst.stepWithCompactEncoding(procInfo.format, pc, _addressSpace, *(Registers_REGDISPLAY*)regs); |
| 791 | + return stepRet == UNW_STEP_SUCCESS; |
| 792 | + } else { |
| 793 | + dwarfOffsetHint = procInfo.format & UNWIND_ARM64_DWARF_SECTION_OFFSET; |
| 794 | + } |
| 795 | +#elif defined(TARGET_AMD64) |
| 796 | + if ((procInfo.format & UNWIND_X86_64_MODE_MASK) != UNWIND_X86_64_MODE_DWARF) { |
| 797 | + CompactUnwinder_x86_64<LocalAddressSpace, Registers_REGDISPLAY> compactInst; |
| 798 | + int stepRet = compactInst.stepWithCompactEncoding(procInfo.format, pc, _addressSpace, *(Registers_REGDISPLAY*)regs); |
| 799 | + return stepRet == UNW_STEP_SUCCESS; |
| 800 | + } else { |
| 801 | + dwarfOffsetHint = procInfo.format & UNWIND_X86_64_DWARF_SECTION_OFFSET; |
| 802 | + } |
| 803 | +#else |
| 804 | + PORTABILITY_ASSERT("DoTheStep"); |
| 805 | +#endif |
| 806 | + } |
| 807 | +#endif |
| 808 | + |
| 809 | + bool retVal = uc.getInfoFromDwarfSection(pc, uwInfoSections, dwarfOffsetHint); |
776 | 810 | if (!retVal)
|
777 | 811 | {
|
778 | 812 | return false;
|
|
0 commit comments