This is the mail archive of the
mailing list for the elfutils project.
[PATCH] libdw: dwarf_getsrclines mark highest address as end_sequence.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 25 Mar 2013 17:11:05 +0100
- Subject: [PATCH] libdw: dwarf_getsrclines mark highest address as end_sequence.
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 <email@example.com>
libdw/ChangeLog | 5 +++++
libdw/dwarf_getsrclines.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 16acf5c..12df9bb 100644
@@ -1,3 +1,8 @@
+2013-03-25 Mark Wielaard <firstname.lastname@example.org>
+ * dwarf_getsrclines.c (dwarf_getsrclines): Mark highest address as
2013-03-12 Mark Wielaard <email@example.com>
* dwarf_getsrcfiles.c (dwarf_getsrcfiles): Allow DW_TAG_partial_unit.
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
index c24aebb..5a58b78 100644
@@ -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;