Blame tests/run-linkmap-cut.sh

Packit Service 97d2fb
#! /usr/bin/env bash
Packit Service 97d2fb
# Copyright (C) 2014 Red Hat, Inc.
Packit Service 97d2fb
# This file is part of elfutils.
Packit Service 97d2fb
#
Packit Service 97d2fb
# This file is free software; you can redistribute it and/or modify
Packit Service 97d2fb
# it under the terms of the GNU General Public License as published by
Packit Service 97d2fb
# the Free Software Foundation; either version 3 of the License, or
Packit Service 97d2fb
# (at your option) any later version.
Packit Service 97d2fb
#
Packit Service 97d2fb
# elfutils is distributed in the hope that it will be useful, but
Packit Service 97d2fb
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 97d2fb
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 97d2fb
# GNU General Public License for more details.
Packit Service 97d2fb
#
Packit Service 97d2fb
# You should have received a copy of the GNU General Public License
Packit Service 97d2fb
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 97d2fb
Packit Service 97d2fb
. $srcdir/test-subr.sh
Packit Service 97d2fb
Packit Service 97d2fb
# The core file has patched:
Packit Service 97d2fb
# * _r_debug.r_map.l_next.l_next (vma 0x3fdf621718, offset 0x7718) = NULL,
Packit Service 97d2fb
#   therefore all libraries after the main executable and vDSO are removed.
Packit Service 97d2fb
# * NT_FILE absolute filenames are relativized to: ./////basename
Packit Service 97d2fb
Packit Service 97d2fb
testfiles linkmap-cut-lib.so linkmap-cut linkmap-cut.core
Packit Service 97d2fb
tempfiles bt
Packit Service 97d2fb
# It may have non-zero exit code with:
Packit Service 97d2fb
# .../elfutils/src/stack: dwfl_thread_getframes tid 3130 at 0x3fdf821d64 in /usr/lib64/libc-2.18.so: no matching address range
Packit Service 97d2fb
testrun ${abs_top_builddir}/src/stack --core=linkmap-cut.core -e linkmap-cut -m >bt || true
Packit Service 97d2fb
cat bt
Packit Service 97d2fb
grep -q '^#0  0x00007f08bc24d681 libfunc - .////////////////////////////////////linkmap-cut-lib\.so$' bt
Packit Service 97d2fb
grep -q '^#1  0x00000000004006b4 main - linkmap-cut$' bt