| 75 | } |
| 76 | |
| 77 | void DwarfParser::parse(const char* eh_frame_hdr) { |
| 78 | u8 version = eh_frame_hdr[0]; |
| 79 | u8 eh_frame_ptr_enc = eh_frame_hdr[1]; |
| 80 | u8 fde_count_enc = eh_frame_hdr[2]; |
| 81 | u8 table_enc = eh_frame_hdr[3]; |
| 82 | |
| 83 | if (version != 1 || (eh_frame_ptr_enc & 0x7) != 0x3 || (fde_count_enc & 0x7) != 0x3 || (table_enc & 0xf7) != 0x33) { |
| 84 | Log::warn("Unsupported .eh_frame_hdr [%02x%02x%02x%02x] in %s", |
| 85 | version, eh_frame_ptr_enc, fde_count_enc, table_enc, _name); |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | int fde_count = *(int*)(eh_frame_hdr + 8); |
| 90 | int* table = (int*)(eh_frame_hdr + 16); |
| 91 | for (int i = 0; i < fde_count; i++) { |
| 92 | _ptr = eh_frame_hdr + table[i * 2]; |
| 93 | parseFde(); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | void DwarfParser::parseCie() { |
| 98 | u32 cie_len = get32(); |
no outgoing calls
no test coverage detected