X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Frun-addr2line-test.sh;h=1079c3e35ba7590c1db3b93daba7190a68b6b6ba;hb=82c3b58b54026d061a4d81ad95f3023d5d883ab2;hp=768006bf150ef8e476e022a19ad94d089f84f9bc;hpb=a286dd013ef8d46edf013efc0908822a59d8ac81;p=platform%2Fupstream%2Felfutils.git diff --git a/tests/run-addr2line-test.sh b/tests/run-addr2line-test.sh index 768006b..1079c3e 100755 --- a/tests/run-addr2line-test.sh +++ b/tests/run-addr2line-test.sh @@ -71,4 +71,46 @@ echo "# stdin without newline symbol, just EOF." echo -n "foo" | testrun ${abs_top_builddir}/src/addr2line -f -e testfile > stdin.nl.out || exit 1 cmp foo.out stdin.nonl.out || exit 1 +tempfiles good.addr.out + +cat > good.addr.out <<\EOF +0x08048468 +foo +/home/drepper/gnu/new-bu/build/ttt/f.c:3 +0x0804845c +bar +/home/drepper/gnu/new-bu/build/ttt/b.c:4 +0x08048468 +foo +/home/drepper/gnu/new-bu/build/ttt/f.c:3 +0x0804845c +bar +/home/drepper/gnu/new-bu/build/ttt/b.c:4 +0x08048468 +foo +/home/drepper/gnu/new-bu/build/ttt/f.c:3 +0x0804845c +bar +/home/drepper/gnu/new-bu/build/ttt/b.c:4 +0x08048468 +foo +/home/drepper/gnu/new-bu/build/ttt/f.c:3 +0x0804845c +bar +/home/drepper/gnu/new-bu/build/ttt/b.c:4 +EOF + +echo "# Everything on the command line with addresses" +cat good.addr.out | testrun_compare ${abs_top_builddir}/src/addr2line -a -f -e testfile 0x08048468 0x0804845c foo bar foo+0x0 bar+0x0 foo-0x0 bar-0x0 + +echo "# Everything from stdin (with newlines) with addresses." +cat stdin.nl | testrun ${abs_top_builddir}/src/addr2line -a -f -e testfile > stdin.nl.out || exit 1 +cmp good.addr.out stdin.nl.out || exit 1 + +echo "# Pretty with functions and addresses." +testrun_compare ${abs_top_builddir}/src/addr2line --pretty -a -f -e testfile 0x08048468 0x0804845c << EOF +0x08048468: foo at /home/drepper/gnu/new-bu/build/ttt/f.c:3 +0x0804845c: bar at /home/drepper/gnu/new-bu/build/ttt/b.c:4 +EOF + exit 0