2 # Copyright (C) 2014, 2015 Red Hat, Inc.
3 # This file is part of elfutils.
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # elfutils is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 if test -n "$ELFUTILS_DISABLE_DEMANGLE"; then
19 echo "demangler unsupported"
23 . $srcdir/backtrace-subr.sh
25 child=testfile-backtrace-demangle
26 testfiles $child{,.core}
27 tempfiles $child.{bt,err}
29 # Disable valgrind while dumping because of a bug unmapping libc.so.
30 # https://bugs.kde.org/show_bug.cgi?id=327427
31 SAVED_VALGRIND_CMD="$VALGRIND_CMD"
34 # There can be more than 3 frames, but depending on the system/installed
35 # glibc we might not be able to unwind fully till the end.
36 # cxxfunc -> f -> main
37 # Expect to see the top two and a warning that there are more frames
39 testrun ${abs_top_builddir}/src/stack -n 2 -e $child --core $child.core >$child.bt 2>$child.err || exitcode=$?
42 if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
43 VALGRIND_CMD="$SAVED_VALGRIND_CMD"
47 if test $exitcode != 1 || ! grep "shown max number of frames" $child.err; then
48 echo >&2 $2: expected more than 2 frames
51 if ! grep -w f $child.bt; then
55 if ! grep ' cxxfunc(int)' $child.bt; then
56 echo >&2 $2: no cxxfunc