+2018-07-04 Tom de Vries <tdevries@suse.de>
+
+ * dwarf2read.c (error_check_comp_unit_head): Move dwarf version
+ check ...
+ (read_comp_unit_head): ... here.
+
2018-07-03 Tom Tromey <tom@tromey.com>
* tracepoint.c (process_tracepoint_on_disconnect, start_tracing)
cu_header->offset_size = (bytes_read == 4) ? 4 : 8;
info_ptr += bytes_read;
cu_header->version = read_2_bytes (abfd, info_ptr);
+ if (cu_header->version < 2 || cu_header->version > 5)
+ error (_("Dwarf Error: wrong version in compilation unit header "
+ "(is %d, should be 2, 3, 4 or 5) [in module %s]"),
+ cu_header->version, filename);
info_ptr += 2;
if (cu_header->version < 5)
switch (section_kind)
{
const char *filename = get_section_file_name (section);
- if (header->version < 2 || header->version > 5)
- error (_("Dwarf Error: wrong version in compilation unit header "
- "(is %d, should be 2, 3, 4 or 5) [in module %s]"), header->version,
- filename);
-
if (to_underlying (header->abbrev_sect_off)
>= dwarf2_section_size (dwarf2_per_objfile->objfile, abbrev_section))
error (_("Dwarf Error: bad offset (%s) in compilation unit header "
# First test that reading symbols fails.
gdb_test "file $binfile" \
- {Reading symbols.*Dwarf Error: wrong unit_type in compilation unit header \(is 0, should be 1 or 2\).*} \
+ {Reading symbols.*Dwarf Error: wrong version in compilation unit header \(is 153, should be 2, 3, 4 or 5\).*} \
"file $testfile"
# Now check that we can still break given the minimal symbol.