Make sure the highest address for the CU is marked as end_sequence.
This is required by the DWARF spec, but some compilers forget and
dwfl_module_getsrc depends on it. We could reject it as bad DWARF
but the DWARF .debug_lines spec is much stricter than what compilers
seem to output in practice.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
+2013-03-25 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_getsrclines.c (dwarf_getsrclines): Mark highest address as
+ end_sequence.
+
2013-03-12 Mark Wielaard <mjw@redhat.com>
* dwarf_getsrcfiles.c (dwarf_getsrcfiles): Allow DW_TAG_partial_unit.
cu->lines->info[i].files = files;
}
+ /* Make sure the highest address for the CU is marked as end_sequence.
+ This is required by the DWARF spec, but some compilers forget and
+ dwfl_module_getsrc depends on it. */
+ cu->lines->info[nlinelist - 1].end_sequence = 1;
+
/* Success. */
res = 0;
}