Home | History | Annotate | Download | only in tests
      1 #! /bin/sh
      2 # Copyright (C) 2007, 2008 Red Hat, Inc.
      3 # This file is part of Red Hat elfutils.
      4 #
      5 # Red Hat elfutils is free software; you can redistribute it and/or modify
      6 # it under the terms of the GNU General Public License as published by the
      7 # Free Software Foundation; version 2 of the License.
      8 #
      9 # Red Hat elfutils is distributed in the hope that it will be useful, but
     10 # WITHOUT ANY WARRANTY; without even the implied warranty of
     11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12 # General Public License for more details.
     13 #
     14 # You should have received a copy of the GNU General Public License along
     15 # with Red Hat elfutils; if not, write to the Free Software Foundation,
     16 # Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
     17 #
     18 # Red Hat elfutils is an included package of the Open Invention Network.
     19 # An included package of the Open Invention Network is a package for which
     20 # Open Invention Network licensees cross-license their patents.  No patent
     21 # license is granted, either expressly or impliedly, by designation as an
     22 # included package.  Should you wish to participate in the Open Invention
     23 # Network licensing program, please visit www.openinventionnetwork.com
     24 # <http://www.openinventionnetwork.com>.
     25 
     26 . $srcdir/test-subr.sh
     27 
     28 testfiles testfile34 testfile38 testfile41 testfile49
     29 
     30 testrun_compare ../src/addr2line -f -e testfile34 \
     31 				 0x08048074 0x08048075 0x08048076 \
     32 				 0x08049078 0x08048080 0x08049080 <<\EOF
     33 foo
     34 ??:0
     35 bar
     36 ??:0
     37 _etext
     38 ??:0
     39 data1
     40 ??:0
     41 ??
     42 ??:0
     43 _end
     44 ??:0
     45 EOF
     46 
     47 testrun_compare ../src/addr2line -S -e testfile38 0x02 0x10a 0x211 0x31a <<\EOF
     48 t1_global_outer+0x2
     49 ??:0
     50 t2_global_symbol+0x2
     51 ??:0
     52 t3_global_after_0+0x1
     53 ??:0
     54 (.text)+0x31a
     55 ??:0
     56 EOF
     57 
     58 testrun_compare ../src/addr2line -S -e testfile41 0x1 0x104 <<\EOF
     59 small_global_at_large_global+0x1
     60 ??:0
     61 small_global_first_at_large_global+0x1
     62 ??:0
     63 EOF
     64 
     65 testfiles testfile12 testfile14
     66 tempfiles testmaps
     67 
     68 cat > testmaps <<EOF
     69 00400000-00401000 r-xp 00000000 fd:01 4006812                            `pwd`/testfile14
     70 00500000-00501000 rw-p 00000000 fd:01 4006812                            `pwd`/testfile14
     71 01000000-01001000 r-xp 00000000 fd:01 1234567				 `pwd`/testfile12
     72 01100000-01011000 rw-p 00000000 fd:01 1234567				 `pwd`/testfile12
     73 2aaaaaaab000-2aaaaaaad000 rw-p 2aaaaaaab000 00:00 0 
     74 2aaaaaae2000-2aaaaaae3000 rw-p 2aaaaaae2000 00:00 0 
     75 7fff61068000-7fff6107d000 rw-p 7ffffffea000 00:00 0                      [stack]
     76 7fff611fe000-7fff61200000 r-xp 7fff611fe000 00:00 0                      [vdso]
     77 ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
     78 EOF
     79 
     80 testrun_compare ../src/addr2line -S -M testmaps 0x40047c 0x10009db <<\EOF
     81 caller+0x14
     82 /home/drepper/local/elfutils-build/20050425/v.c:11
     83 foo+0xb
     84 /home/drepper/local/elfutils-build/20030710/u.c:5
     85 EOF
     86 
     87 #	.section .text
     88 #	nop #0
     89 #sizeless_foo:
     90 #	nop #1
     91 #	nop #2
     92 #sized_bar:
     93 #	nop #3
     94 #	nop #4
     95 #sizeless_baz:
     96 #	nop #5
     97 #	nop #6
     98 #	.size sized_bar, . - sized_bar
     99 #	nop #7
    100 #	nop #8
    101 #sizeless_x:
    102 #	nop #9
    103 #	.org 0x100
    104 #	nop #0
    105 #	.globl global_outer
    106 #global_outer:
    107 #	nop #1
    108 #	nop #2
    109 #	.globl global_in_global
    110 #global_in_global:
    111 #	nop #3
    112 #	nop #4
    113 #	.size global_in_global, . - global_in_global
    114 #local_in_global:
    115 #	nop #5 
    116 #	nop #6 
    117 #	.size local_in_global, . - local_in_global
    118 #	nop #7
    119 #	nop #8
    120 #.Lsizeless1:
    121 #	nop #9
    122 #	nop #10
    123 #	.size global_outer, . - global_outer
    124 #	nop #11
    125 #	.org 0x200
    126 #	nop #0
    127 #local_outer:
    128 #	nop #1
    129 #	nop #2
    130 #	.globl global_in_local
    131 #global_in_local:
    132 #	nop #3
    133 #	nop #4
    134 #	.size global_in_local, . - global_in_local
    135 #local_in_local:
    136 #	nop #5 
    137 #	nop #6 
    138 #	.size local_in_local, . - local_in_local
    139 #	nop #7
    140 #	nop #8
    141 #.Lsizeless2:
    142 #	nop #9
    143 #	nop #10
    144 #	.size local_outer, . - local_outer
    145 #	nop #11
    146 testrun_compare ../src/addr2line -S -e testfile49 \
    147     		0 1 2 3 4 5 6 7 8 9 \
    148 		0x100 0x101 0x102 0x103 0x104 0x105 \
    149 		0x106 0x107 0x108 0x109 0x10a 0x10b \
    150 		0x200 0x201 0x202 0x203 0x204 0x205 \
    151 		0x206 0x207 0x208 0x209 0x20a 0x20b <<\EOF
    152 (.text)+0
    153 ??:0
    154 sizeless_foo
    155 ??:0
    156 sizeless_foo+0x1
    157 ??:0
    158 sized_bar
    159 ??:0
    160 sized_bar+0x1
    161 ??:0
    162 sized_bar+0x2
    163 ??:0
    164 sized_bar+0x3
    165 ??:0
    166 (.text)+0x7
    167 ??:0
    168 (.text)+0x8
    169 ??:0
    170 sizeless_x
    171 ??:0
    172 sizeless_x+0xf7
    173 ??:0
    174 global_outer
    175 ??:0
    176 global_outer+0x1
    177 ??:0
    178 global_in_global
    179 ??:0
    180 global_in_global+0x1
    181 ??:0
    182 global_outer+0x4
    183 ??:0
    184 global_outer+0x5
    185 ??:0
    186 global_outer+0x6
    187 ??:0
    188 global_outer+0x7
    189 ??:0
    190 global_outer+0x8
    191 ??:0
    192 global_outer+0x9
    193 ??:0
    194 (.text)+0x10b
    195 ??:0
    196 (.text)+0x200
    197 ??:0
    198 local_outer
    199 ??:0
    200 local_outer+0x1
    201 ??:0
    202 global_in_local
    203 ??:0
    204 global_in_local+0x1
    205 ??:0
    206 local_in_local
    207 ??:0
    208 local_in_local+0x1
    209 ??:0
    210 local_outer+0x6
    211 ??:0
    212 local_outer+0x7
    213 ??:0
    214 local_outer+0x8
    215 ??:0
    216 local_outer+0x9
    217 ??:0
    218 (.text)+0x20b
    219 ??:0
    220 EOF
    221 
    222 exit 0
    223