1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-16 13:18:12 +01:00

dwarf: Allow DWARF version both 3 and 4 (#56)

This commit is contained in:
Yichao Yu 2017-10-31 11:55:07 -04:00 committed by Dave Watson
parent 9e81e9efee
commit 1870b26a00
2 changed files with 6 additions and 4 deletions

View file

@ -135,7 +135,8 @@ typedef enum
}
dwarf_expr_op_t;
#define DWARF_CIE_VERSION 3 /* GCC emits version 1??? */
#define DWARF_CIE_VERSION 3
#define DWARF_CIE_VERSION_MAX 4
#define DWARF_CFA_OPCODE_MASK 0xc0
#define DWARF_CFA_OPERAND_MASK 0x3f

View file

@ -116,10 +116,11 @@ parse_cie (unw_addr_space_t as, unw_accessors_t *a, unw_word_t addr,
if ((ret = dwarf_readu8 (as, a, &addr, &version, arg)) < 0)
return ret;
if (version != 1 && version != DWARF_CIE_VERSION)
/* GCC emits version 1??? */
if (version != 1 && (version < DWARF_CIE_VERSION || version > DWARF_CIE_VERSION_MAX))
{
Debug (1, "Got CIE version %u, expected version 1 or "
STR (DWARF_CIE_VERSION) "\n", version);
Debug (1, "Got CIE version %u, expected version 1 or between "
STR (DWARF_CIE_VERSION) " and " STR (DWARF_CIE_VERSION_MAX) "\n", version);
return -UNW_EBADVERSION;
}