From 9affad3d2314de1bacbabae453a7261cc02feac4 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 3 May 2013 11:28:49 +0200 Subject: libdw: dwarf_getsrclines don't set end_sequence when there are no lines. Some CUs might only have a file list, but no actual source lines in their statement list. Only set end_sequence at the end of the source lines list if there are actually lines. Signed-off-by: Mark Wielaard --- tests/ChangeLog | 6 ++++++ tests/Makefile.am | 3 ++- tests/run-get-lines.sh | 31 +++++++++++++++++++++++++++++-- tests/testfilenolines.bz2 | Bin 0 -> 2855 bytes 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100755 tests/testfilenolines.bz2 (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index 4003851f..6df580a7 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2013-05-03 Mark Wielaard + + * testfilenolines.bz2: New test file. + * Makefile.am (EXTRA_DIST): Add testfilenolines.bz2. + * run-get-lines.sh: Run testrun_compare on testfilenolines. + 2013-04-30 Jan Kratochvil * dwfl-report-elf-align.c: Use false add_p_vaddr for dwfl_report_elf. diff --git a/tests/Makefile.am b/tests/Makefile.am index 4b577035..6327edbb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -198,7 +198,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile69.core.bz2 testfile69.so.bz2 \ testfile70.core.bz2 testfile70.exec.bz2 \ run-dwfllines.sh run-dwfl-report-elf-align.sh \ - testfile-dwfl-report-elf-align-shlib.so.bz2 + testfile-dwfl-report-elf-align-shlib.so.bz2 \ + testfilenolines if USE_VALGRIND valgrind_cmd='valgrind -q --trace-children=yes --error-exitcode=1 --run-libc-freeres=no' diff --git a/tests/run-get-lines.sh b/tests/run-get-lines.sh index 5a220cab..fb48c77d 100755 --- a/tests/run-get-lines.sh +++ b/tests/run-get-lines.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2002, 2004, 2005 Red Hat, Inc. +# Copyright (C) 1999, 2000, 2002, 2004, 2005, 2013 Red Hat, Inc. # This file is part of elfutils. # Written by Ulrich Drepper , 1999. # @@ -18,7 +18,7 @@ . $srcdir/test-subr.sh -testfiles testfile testfile2 +testfiles testfile testfile2 testfilenolines testrun_compare ${abs_builddir}/get-lines testfile testfile2 <<\EOF cuhl = 11, o = 0, asz = 4, osz = 4, ncu = 191 @@ -61,4 +61,31 @@ cuhl = 11, o = 267, asz = 4, osz = 4, ncu = 2680 10000514: /shoggoth/drepper/m.c:8:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no EOF +# - lines.c +# int ft; +# +# int +# main (int argc, char **argv) +# { +# return ft - 42; +# } +# +# - nolines.c +# int ft = 42; +# +# gcc -g -c lines.c +# gcc -g -c nolines.c +# gcc -g -o testfilenolines lines.o nolines.o + +testrun_compare ${abs_builddir}/get-lines testfilenolines <<\EOF +cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 169 + 4 lines +400474: /home/mark/src/tests/lines.c:5:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no +40047f: /home/mark/src/tests/lines.c:6:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no +400488: /home/mark/src/tests/lines.c:7:0: is_stmt:yes, end_seq:no, bb:no, prologue:no, epilogue:no +40048a: /home/mark/src/tests/lines.c:7:0: is_stmt:yes, end_seq:yes, bb:no, prologue:no, epilogue:no +cuhl = 11, o = 125, asz = 8, osz = 4, ncu = 243 + 0 lines +EOF + exit 0 diff --git a/tests/testfilenolines.bz2 b/tests/testfilenolines.bz2 new file mode 100755 index 00000000..23cd7223 Binary files /dev/null and b/tests/testfilenolines.bz2 differ -- cgit v1.2.3