]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdw: dwarf_getsrclines mark highest address as end_sequence.
authorMark Wielaard <mjw@redhat.com>
Mon, 25 Mar 2013 16:07:21 +0000 (17:07 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 26 Mar 2013 09:07:32 +0000 (10:07 +0100)
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>
libdw/ChangeLog
libdw/dwarf_getsrclines.c

index 16acf5cd3ce3eff006431722e9a04023f06d9d5e..12df9bbe176f50e4b774fab4ce6c94e2d62cb5d0 100644 (file)
@@ -1,3 +1,8 @@
+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.
index c24aebb59252368f4782337c9eb40e04e562c8d0..5a58b783188aa620b0fbd8d90d466034cf3cce93 100644 (file)
@@ -712,6 +712,11 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
          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;
     }