1#!/usr/local/bin/bash
2# Copyright (C) 2015 Red Hat, Inc.
3# This file is part of elfutils.
4#
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.
9#
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.
14#
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/>.
17
18if test -n "$ELFUTILS_DISABLE_DEMANGLE"; then
19  echo "demangler unsupported"
20  exit 77
21fi
22
23. $srcdir/test-subr.sh
24
25# See run-addr2line-i-test.sh for how to generate test files.
26testfiles testfile-inlines
27
28# All together now plus (demangled) function names.
29testrun_compare ${abs_top_builddir}/src/addr2line -C -f -i -e testfile-inlines 0x00000000000005a0 0x00000000000005a1 0x00000000000005b0 0x00000000000005b1 0x00000000000005c0 0x00000000000005d0 0x00000000000005e0 0x00000000000005e1 0x00000000000005f0 0x00000000000005f1 0x00000000000005f2 <<\EOF
30foobar
31/tmp/x.cpp:5
32foobar
33/tmp/x.cpp:6
34fubar
35/tmp/x.cpp:10
36fubar
37/tmp/x.cpp:11
38foobar inlined at /tmp/x.cpp:15 in bar()
39/tmp/x.cpp:5
40bar
41/tmp/x.cpp:15
42fubar inlined at /tmp/x.cpp:20 in baz()
43/tmp/x.cpp:10
44baz
45/tmp/x.cpp:20
46foobar inlined at /tmp/x.cpp:15 in foo()
47/tmp/x.cpp:5
48bar
49/tmp/x.cpp:15
50foo()
51/tmp/x.cpp:25
52fubar inlined at /tmp/x.cpp:20 in foo()
53/tmp/x.cpp:10
54baz
55/tmp/x.cpp:20
56foo()
57/tmp/x.cpp:26
58fu()
59/tmp/x.cpp:31
60fubar inlined at /tmp/x.cpp:32 in fu()
61/tmp/x.cpp:10
62fu()
63/tmp/x.cpp:32
64foobar inlined at /tmp/x.cpp:33 in fu()
65/tmp/x.cpp:5
66fu()
67/tmp/x.cpp:33
68EOF
69
70exit 0
71