Blame tests/run-next-files.sh

Packit 032894
#! /bin/sh
Packit 032894
# Variant of run-get-files that uses dwarf_next_lines.
Packit 032894
# Copyright (C) 2018 Red Hat, Inc.
Packit 032894
# This file is part of elfutils.
Packit 032894
#
Packit 032894
# This file is free software; you can redistribute it and/or modify
Packit 032894
# it under the terms of the GNU General Public License as published by
Packit 032894
# the Free Software Foundation; either version 3 of the License, or
Packit 032894
# (at your option) any later version.
Packit 032894
#
Packit 032894
# elfutils is distributed in the hope that it will be useful, but
Packit 032894
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 032894
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 032894
# GNU General Public License for more details.
Packit 032894
#
Packit 032894
# You should have received a copy of the GNU General Public License
Packit 032894
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 032894
Packit 032894
. $srcdir/test-subr.sh
Packit 032894
Packit 032894
testfiles testfile testfile2
Packit 032894
Packit 032894
testrun_compare ${abs_builddir}/next-files testfile testfile2 <<\EOF
Packit 032894
off = 0
Packit 032894
 dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/home/drepper/gnu/new-bu/build/ttt/m.c"
Packit 032894
off = 75
Packit 032894
 dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/home/drepper/gnu/new-bu/build/ttt/b.c"
Packit 032894
 file[2] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h"
Packit 032894
 file[3] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h"
Packit 032894
 file[4] = "/usr/include/bits/types.h"
Packit 032894
 file[5] = "/usr/include/bits/sched.h"
Packit 032894
 file[6] = "/usr/include/bits/pthreadtypes.h"
Packit 032894
 file[7] = "/usr/include/stdio.h"
Packit 032894
 file[8] = "/usr/include/libio.h"
Packit 032894
 file[9] = "/usr/include/wchar.h"
Packit 032894
 file[10] = "/usr/include/_G_config.h"
Packit 032894
 file[11] = "/usr/include/gconv.h"
Packit 032894
off = 480
Packit 032894
 dirs[0] = "/home/drepper/gnu/new-bu/build/ttt"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/home/drepper/gnu/new-bu/build/ttt/f.c"
Packit 032894
off = 0
Packit 032894
 dirs[0] = "/shoggoth/drepper"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/shoggoth/drepper/b.c"
Packit 032894
 file[2] = "/home/geoffk/objs/laurel-000912-branch/lib/gcc-lib/powerpc-unknown-linux-gnu/2.96-laurel-000912/include/stddef.h"
Packit 032894
 file[3] = "/home/geoffk/objs/laurel-000912-branch/lib/gcc-lib/powerpc-unknown-linux-gnu/2.96-laurel-000912/include/stdarg.h"
Packit 032894
 file[4] = "/shoggoth/drepper/<built-in>"
Packit 032894
 file[5] = "/usr/include/bits/types.h"
Packit 032894
 file[6] = "/usr/include/stdio.h"
Packit 032894
 file[7] = "/usr/include/libio.h"
Packit 032894
 file[8] = "/usr/include/_G_config.h"
Packit 032894
off = 418
Packit 032894
 dirs[0] = "/shoggoth/drepper"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/shoggoth/drepper/f.c"
Packit 032894
off = 485
Packit 032894
 dirs[0] = "/shoggoth/drepper"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/shoggoth/drepper/m.c"
Packit 032894
EOF
Packit 032894
Packit 032894
# see tests/testfile-dwarf-45.source
Packit 032894
testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
Packit 032894
testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
Packit 032894
Packit 032894
testrun_compare ${abs_builddir}/next-files testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo <<\EOF
Packit 032894
off = 0
Packit 032894
 dirs[0] = "/home/mark/src/elfutils/tests"
Packit 032894
 dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/home/mark/src/elfutils/tests/hello.c"
Packit 032894
 file[2] = "/home/mark/src/elfutils/tests/hello.h"
Packit 032894
 file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
Packit 032894
off = 612
Packit 032894
 dirs[0] = "/home/mark/src/elfutils/tests"
Packit 032894
 dirs[1] = "/usr/include"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/home/mark/src/elfutils/tests/world.c"
Packit 032894
 file[2] = "/home/mark/src/elfutils/tests/hello.h"
Packit 032894
 file[3] = "/usr/include/stdlib.h"
Packit 032894
off = 0
Packit 032894
 dirs[0] = "/home/mark/src/elfutils/tests"
Packit 032894
 dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/home/mark/src/elfutils/tests/hello.c"
Packit 032894
 file[2] = "/home/mark/src/elfutils/tests/hello.h"
Packit 032894
 file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
Packit 032894
off = 0
Packit 032894
 dirs[0] = "/home/mark/src/elfutils/tests"
Packit 032894
 dirs[1] = "/usr/include"
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "/home/mark/src/elfutils/tests/world.c"
Packit 032894
 file[2] = "/home/mark/src/elfutils/tests/hello.h"
Packit 032894
 file[3] = "/usr/include/stdlib.h"
Packit 032894
EOF
Packit 032894
Packit 032894
# No problem with dirs[0] for DWARF5 line tables.
Packit 032894
testrun_compare ${abs_builddir}/next-files testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo <<\EOF
Packit 032894
off = 0
Packit 032894
 dirs[0] = "/home/mark/src/elfutils/tests"
Packit 032894
 dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
Packit 032894
 file[0] = "/home/mark/src/elfutils/tests/hello.c"
Packit 032894
 file[1] = "/home/mark/src/elfutils/tests/hello.c"
Packit 032894
 file[2] = "/home/mark/src/elfutils/tests/hello.h"
Packit 032894
 file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
Packit 032894
off = 655
Packit 032894
 dirs[0] = "/home/mark/src/elfutils/tests"
Packit 032894
 dirs[1] = "/usr/include"
Packit 032894
 file[0] = "/home/mark/src/elfutils/tests/world.c"
Packit 032894
 file[1] = "/home/mark/src/elfutils/tests/world.c"
Packit 032894
 file[2] = "/home/mark/src/elfutils/tests/hello.h"
Packit 032894
 file[3] = "/usr/include/stdlib.h"
Packit 032894
off = 0
Packit 032894
 dirs[0] = "/home/mark/src/elfutils/tests"
Packit 032894
 dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include"
Packit 032894
 file[0] = "/home/mark/src/elfutils/tests/hello.c"
Packit 032894
 file[1] = "/home/mark/src/elfutils/tests/hello.c"
Packit 032894
 file[2] = "/home/mark/src/elfutils/tests/hello.h"
Packit 032894
 file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h"
Packit 032894
off = 0
Packit 032894
 dirs[0] = "/home/mark/src/elfutils/tests"
Packit 032894
 dirs[1] = "/usr/include"
Packit 032894
 file[0] = "/home/mark/src/elfutils/tests/world.c"
Packit 032894
 file[1] = "/home/mark/src/elfutils/tests/world.c"
Packit 032894
 file[2] = "/home/mark/src/elfutils/tests/hello.h"
Packit 032894
 file[3] = "/usr/include/stdlib.h"
Packit 032894
EOF
Packit 032894
Packit 032894
# Created from testfile using
Packit 032894
# cp testfile testfile-only-debug-line
Packit 032894
# eu-strip -g --keep-section .debug_line
Packit 032894
#
Packit 032894
# Note how the comp dir cannot be retrieved and some files become relative.
Packit 032894
testfiles testfile-only-debug-line
Packit 032894
testrun_compare ${abs_builddir}/next-files testfile-only-debug-line <<\EOF
Packit 032894
off = 0
Packit 032894
 dirs[0] = (null)
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "m.c"
Packit 032894
off = 75
Packit 032894
 dirs[0] = (null)
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "b.c"
Packit 032894
 file[2] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h"
Packit 032894
 file[3] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h"
Packit 032894
 file[4] = "/usr/include/bits/types.h"
Packit 032894
 file[5] = "/usr/include/bits/sched.h"
Packit 032894
 file[6] = "/usr/include/bits/pthreadtypes.h"
Packit 032894
 file[7] = "/usr/include/stdio.h"
Packit 032894
 file[8] = "/usr/include/libio.h"
Packit 032894
 file[9] = "/usr/include/wchar.h"
Packit 032894
 file[10] = "/usr/include/_G_config.h"
Packit 032894
 file[11] = "/usr/include/gconv.h"
Packit 032894
off = 480
Packit 032894
 dirs[0] = (null)
Packit 032894
 file[0] = "???"
Packit 032894
 file[1] = "f.c"
Packit 032894
EOF
Packit 032894
Packit 032894
exit 0