From 2dc7f7b33b425c6c19078f29e4e8c9e0ddca41e6 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 20 Apr 2010 17:33:14 +0000 Subject: * dwarf2-frame.c (decode_frame_entry_1): Handle CIE version 4. (struct dwarf2_cie) : New field. * dwarf2read.c (partial_read_comp_unit_head): Accept DWARF 4. (skip_one_die): Handle DW_FORM_flag_present, DW_FORM_sec_offset, DW_FORM_exprloc. (read_attribute_value): Handle DW_FORM_flag_present, DW_FORM_sec_offset, DW_FORM_exprloc. (dump_die_shallow): Likewise. (attr_form_is_section_offset): Handle DW_FORM_sec_offset. (dwarf2_const_value): Handle DW_FORM_exprloc. (attr_form_is_block): Likewise. (struct line_header) : New field. (dwarf_decode_line_header): Set new field. (dwarf_decode_lines): Handle new field. --- gdb/dwarf2-frame.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gdb/dwarf2-frame.c') diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 47a2cf1..33d001c 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -85,6 +85,9 @@ struct dwarf2_cie /* The version recorded in the CIE. */ unsigned char version; + + /* The segment size. */ + unsigned char segment_size; }; struct dwarf2_cie_table @@ -1714,7 +1717,7 @@ decode_frame_entry_1 (struct comp_unit *unit, gdb_byte *start, int eh_frame_p, /* Check version number. */ cie_version = read_1_byte (unit->abfd, buf); - if (cie_version != 1 && cie_version != 3) + if (cie_version != 1 && cie_version != 3 && cie_version != 4) return NULL; cie->version = cie_version; buf += 1; @@ -1738,6 +1741,20 @@ decode_frame_entry_1 (struct comp_unit *unit, gdb_byte *start, int eh_frame_p, augmentation += 2; } + if (cie->version >= 4) + { + /* FIXME: check that this is the same as from the CU header. */ + cie->addr_size = read_1_byte (unit->abfd, buf); + ++buf; + cie->segment_size = read_1_byte (unit->abfd, buf); + ++buf; + } + else + { + cie->addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT; + cie->segment_size = 0; + } + cie->code_alignment_factor = read_unsigned_leb128 (unit->abfd, buf, &bytes_read); buf += bytes_read; -- cgit v1.1