X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fdwarf2-frame.c;h=0f2502b4c6830ecbbbaee0add10d69ace21b285c;hb=14b456f2a011b28d8136a64022f2a418391054e3;hp=a24235ab84fa2c7d284207ae217fc6a328a13242;hpb=230d2906b9d1d009b22fd526181bf43e1084ed59;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index a24235ab84..0f2502b4c6 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -290,7 +290,7 @@ class dwarf_expr_executor : public dwarf_expr_context CORE_ADDR get_addr_index (unsigned int index) override { - invalid ("DW_OP_GNU_addr_index"); + invalid ("DW_OP_addrx or DW_OP_GNU_addr_index"); } private: @@ -1076,7 +1076,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache) return cache; } - throw_exception (ex); + throw; } /* Initialize the register state. */ @@ -1463,7 +1463,9 @@ dwarf2_frame_cfa (struct frame_info *this_frame) return get_frame_base (this_frame); } -const struct objfile_data *dwarf2_frame_objfile_data; +const struct objfile_key> + dwarf2_frame_objfile_data; static unsigned int read_1_byte (bfd *abfd, const gdb_byte *buf) @@ -1487,7 +1489,7 @@ static ULONGEST read_initial_length (bfd *abfd, const gdb_byte *buf, unsigned int *bytes_read_ptr) { - LONGEST result; + ULONGEST result; result = bfd_get_32 (abfd, buf); if (result == 0xffffffff) @@ -1708,13 +1710,11 @@ dwarf2_frame_find_fde (CORE_ADDR *pc, CORE_ADDR *out_offset) CORE_ADDR offset; CORE_ADDR seek_pc; - fde_table = ((struct dwarf2_fde_table *) - objfile_data (objfile, dwarf2_frame_objfile_data)); + fde_table = dwarf2_frame_objfile_data.get (objfile); if (fde_table == NULL) { dwarf2_build_frame_info (objfile); - fde_table = ((struct dwarf2_fde_table *) - objfile_data (objfile, dwarf2_frame_objfile_data)); + fde_table = dwarf2_frame_objfile_data.get (objfile); } gdb_assert (fde_table != NULL); @@ -1788,7 +1788,7 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start, { struct gdbarch *gdbarch = get_objfile_arch (unit->objfile); const gdb_byte *buf, *end; - LONGEST length; + ULONGEST length; unsigned int bytes_read; int dwarf64_p; ULONGEST cie_id; @@ -1799,15 +1799,15 @@ decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start, buf = start; length = read_initial_length (unit->abfd, buf, &bytes_read); buf += bytes_read; - end = buf + length; - - /* Are we still within the section? */ - if (end > unit->dwarf_frame_buffer + unit->dwarf_frame_size) - return NULL; + end = buf + (size_t) length; if (length == 0) return end; + /* Are we still within the section? */ + if (end <= buf || end > unit->dwarf_frame_buffer + unit->dwarf_frame_size) + return NULL; + /* Distinguish between 32 and 64-bit encoded frame info. */ dwarf64_p = (bytes_read == 12); @@ -2397,7 +2397,7 @@ dwarf2_build_frame_info (struct objfile *objfile) xfree (fde_table.entries); } - set_objfile_data (objfile, dwarf2_frame_objfile_data, fde_table2); + dwarf2_frame_objfile_data.set (objfile, fde_table2); } /* Handle 'maintenance show dwarf unwinders'. */ @@ -2416,7 +2416,6 @@ void _initialize_dwarf2_frame (void) { dwarf2_frame_data = gdbarch_data_register_pre_init (dwarf2_frame_init); - dwarf2_frame_objfile_data = register_objfile_data (); add_setshow_boolean_cmd ("unwinders", class_obscure, &dwarf2_frame_unwinders_enabled_p , _("\