+2020-03-26 Tom Tromey <tom@tromey.com>
+
+ * dwarf2/section.h (struct dwarf2_section_info)
+ <overload_complaint>: Declare.
+ (dwarf2_section_buffer_overflow_complaint): Don't declare.
+ * dwarf2/section.c (dwarf2_section_info::overflow_complaint):
+ Rename from dwarf2_section_buffer_overflow_complaint.
+ * dwarf2/read.c (skip_one_die, partial_die_info::read)
+ (skip_form_bytes, dwarf_decode_macro_bytes): Update.
+
2020-03-26 Tom Tromey <tom@tromey.com>
* dwarf2/section.h (dwarf2_section_buffer_overflow_complaint):
if (sibling_ptr < info_ptr)
complaint (_("DW_AT_sibling points backwards"));
else if (sibling_ptr > reader->buffer_end)
- dwarf2_section_buffer_overflow_complaint (reader->die_section);
+ reader->die_section->overflow_complaint ();
else
return sibling_ptr;
}
if (sibling_ptr < info_ptr)
complaint (_("DW_AT_sibling points backwards"));
else if (sibling_ptr > reader->buffer_end)
- dwarf2_section_buffer_overflow_complaint (reader->die_section);
+ reader->die_section->overflow_complaint ();
else
sibling = sibling_ptr;
}
bytes = gdb_skip_leb128 (bytes, buffer_end);
if (bytes == NULL)
{
- dwarf2_section_buffer_overflow_complaint (section);
+ section->overflow_complaint ();
return NULL;
}
break;
/* Do we at least have room for a macinfo type byte? */
if (mac_ptr >= mac_end)
{
- dwarf2_section_buffer_overflow_complaint (section);
+ section->overflow_complaint ();
break;
}
/* Do we at least have room for a macinfo type byte? */
if (mac_ptr >= mac_end)
{
- dwarf2_section_buffer_overflow_complaint (section);
+ section->overflow_complaint ();
return;
}
#include "complaints.h"
void
-dwarf2_section_buffer_overflow_complaint (struct dwarf2_section_info *section)
+dwarf2_section_info::overflow_complaint () const
{
complaint (_("debug info runs off end of %s section"
" [in module %s]"),
- section->get_name (),
- section->get_file_name ());
+ get_name (), get_file_name ());
}
struct dwarf2_section_info *
return size;
}
+ /* Issue a complaint that something was outside the bounds of this
+ buffer. */
+ void overflow_complaint () const;
+
union
{
/* If this is a real section, the bfd section. */
bool is_virtual;
};
-extern void dwarf2_section_buffer_overflow_complaint
- (struct dwarf2_section_info *section);
-
#endif /* GDB_DWARF2_SECTION_H */