1#!/usr/local/bin/bash
2# Copyright (C) 2011, 2018 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
18. $srcdir/test-subr.sh
19
20testfiles testfile14
21
22testrun >/dev/null ${abs_top_builddir}/src/readelf -w testfile14 testfile14
23
24testrun_compare ${abs_top_builddir}/src/readelf --debug-dump=loc testfile14 testfile14 << EOF
25
26testfile14:
27
28
29DWARF section [33] '.debug_loc' at offset 0xca9:
30
31 CU [     b] base: 0x0000000000400468 <caller>
32 [     0] range 34, 35
33          0x000000000040049c <main>..
34          0x000000000040049c <main>
35           [ 0] breg7 -8
36          range 35, 46
37          0x000000000040049d <main+0x1>..
38          0x00000000004004ad <main+0x11>
39           [ 0] breg7 0
40          range 46, 47
41          0x00000000004004ae <main+0x12>..
42          0x00000000004004ae <main+0x12>
43           [ 0] breg7 -8
44
45testfile14:
46
47
48DWARF section [33] '.debug_loc' at offset 0xca9:
49
50 CU [     b] base: 0x0000000000400468 <caller>
51 [     0] range 34, 35
52          0x000000000040049c <main>..
53          0x000000000040049c <main>
54           [ 0] breg7 -8
55          range 35, 46
56          0x000000000040049d <main+0x1>..
57          0x00000000004004ad <main+0x11>
58           [ 0] breg7 0
59          range 46, 47
60          0x00000000004004ae <main+0x12>..
61          0x00000000004004ae <main+0x12>
62           [ 0] breg7 -8
63EOF
64
65exit 0
66