1
0
mirror of https://github.com/ioacademy-jikim/debugging synced 2026-08-31 09:49:38 +00:00

first commit

This commit is contained in:
jikim
2015-12-13 22:34:58 +09:00
commit 0b589c7986
9455 changed files with 4350134 additions and 0 deletions
@@ -0,0 +1 @@
# dummy
@@ -0,0 +1,165 @@
getoff_x86_linux-getoff.o: getoff.c /usr/include/stdc-predef.h \
../config.h /usr/include/assert.h /usr/include/features.h \
/usr/include/i386-linux-gnu/sys/cdefs.h \
/usr/include/i386-linux-gnu/bits/wordsize.h \
/usr/include/i386-linux-gnu/gnu/stubs.h \
/usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/errno.h \
/usr/include/i386-linux-gnu/bits/errno.h /usr/include/linux/errno.h \
/usr/include/i386-linux-gnu/asm/errno.h /usr/include/asm-generic/errno.h \
/usr/include/asm-generic/errno-base.h /usr/include/stdlib.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stddef.h \
/usr/include/i386-linux-gnu/bits/waitflags.h \
/usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
/usr/include/i386-linux-gnu/bits/endian.h \
/usr/include/i386-linux-gnu/bits/byteswap.h \
/usr/include/i386-linux-gnu/bits/types.h \
/usr/include/i386-linux-gnu/bits/typesizes.h \
/usr/include/i386-linux-gnu/bits/byteswap-16.h /usr/include/xlocale.h \
/usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \
/usr/include/i386-linux-gnu/sys/select.h \
/usr/include/i386-linux-gnu/bits/select.h \
/usr/include/i386-linux-gnu/bits/sigset.h \
/usr/include/i386-linux-gnu/bits/time.h \
/usr/include/i386-linux-gnu/bits/select2.h \
/usr/include/i386-linux-gnu/sys/sysmacros.h \
/usr/include/i386-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h \
/usr/include/i386-linux-gnu/bits/stdlib-float.h \
/usr/include/i386-linux-gnu/bits/stdlib.h /usr/include/stdio.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h \
/usr/include/i386-linux-gnu/bits/stdio_lim.h \
/usr/include/i386-linux-gnu/bits/sys_errlist.h \
/usr/include/i386-linux-gnu/bits/stdio.h \
/usr/include/i386-linux-gnu/bits/stdio2.h /usr/include/string.h \
/usr/include/i386-linux-gnu/bits/string.h \
/usr/include/i386-linux-gnu/bits/string2.h \
/usr/include/i386-linux-gnu/bits/string3.h /usr/include/link.h \
/usr/include/elf.h /usr/lib/gcc/i686-linux-gnu/5/include/stdint.h \
/usr/include/stdint.h /usr/include/i386-linux-gnu/bits/wchar.h \
/usr/include/i386-linux-gnu/bits/auxv.h /usr/include/dlfcn.h \
/usr/include/i386-linux-gnu/bits/dlfcn.h \
/usr/include/i386-linux-gnu/bits/elfclass.h \
/usr/include/i386-linux-gnu/bits/link.h
/usr/include/stdc-predef.h:
../config.h:
/usr/include/assert.h:
/usr/include/features.h:
/usr/include/i386-linux-gnu/sys/cdefs.h:
/usr/include/i386-linux-gnu/bits/wordsize.h:
/usr/include/i386-linux-gnu/gnu/stubs.h:
/usr/include/i386-linux-gnu/gnu/stubs-32.h:
/usr/include/errno.h:
/usr/include/i386-linux-gnu/bits/errno.h:
/usr/include/linux/errno.h:
/usr/include/i386-linux-gnu/asm/errno.h:
/usr/include/asm-generic/errno.h:
/usr/include/asm-generic/errno-base.h:
/usr/include/stdlib.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stddef.h:
/usr/include/i386-linux-gnu/bits/waitflags.h:
/usr/include/i386-linux-gnu/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/i386-linux-gnu/bits/endian.h:
/usr/include/i386-linux-gnu/bits/byteswap.h:
/usr/include/i386-linux-gnu/bits/types.h:
/usr/include/i386-linux-gnu/bits/typesizes.h:
/usr/include/i386-linux-gnu/bits/byteswap-16.h:
/usr/include/xlocale.h:
/usr/include/i386-linux-gnu/sys/types.h:
/usr/include/time.h:
/usr/include/i386-linux-gnu/sys/select.h:
/usr/include/i386-linux-gnu/bits/select.h:
/usr/include/i386-linux-gnu/bits/sigset.h:
/usr/include/i386-linux-gnu/bits/time.h:
/usr/include/i386-linux-gnu/bits/select2.h:
/usr/include/i386-linux-gnu/sys/sysmacros.h:
/usr/include/i386-linux-gnu/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:
/usr/include/i386-linux-gnu/bits/stdlib-float.h:
/usr/include/i386-linux-gnu/bits/stdlib.h:
/usr/include/stdio.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h:
/usr/include/i386-linux-gnu/bits/stdio_lim.h:
/usr/include/i386-linux-gnu/bits/sys_errlist.h:
/usr/include/i386-linux-gnu/bits/stdio.h:
/usr/include/i386-linux-gnu/bits/stdio2.h:
/usr/include/string.h:
/usr/include/i386-linux-gnu/bits/string.h:
/usr/include/i386-linux-gnu/bits/string2.h:
/usr/include/i386-linux-gnu/bits/string3.h:
/usr/include/link.h:
/usr/include/elf.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdint.h:
/usr/include/stdint.h:
/usr/include/i386-linux-gnu/bits/wchar.h:
/usr/include/i386-linux-gnu/bits/auxv.h:
/usr/include/dlfcn.h:
/usr/include/i386-linux-gnu/bits/dlfcn.h:
/usr/include/i386-linux-gnu/bits/elfclass.h:
/usr/include/i386-linux-gnu/bits/link.h:
@@ -0,0 +1,328 @@
valgrind_di_server-valgrind-di-server.o: valgrind-di-server.c \
/usr/include/stdc-predef.h ../coregrind/pub_core_basics.h \
../include/pub_tool_basics.h ../VEX/pub/libvex_basictypes.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h \
../coregrind/pub_core_libcassert.h ../include/pub_tool_libcassert.h \
../include/pub_tool_basics.h ../coregrind/pub_core_basics.h \
../coregrind/pub_core_vki.h ../include/pub_tool_vki.h \
../include/vki/vki-linux.h ../include/vki/vki-posixtypes-x86-linux.h \
../include/vki/vki-x86-linux.h ../include/vki/vki-linux-drm.h \
../include/vki/vki-xen.h ../include/vki/vki-xen-x86.h \
../include/vki/vki-xen-domctl.h ../include/vki/vki-xen-sysctl.h \
../include/vki/vki-xen-mmuext.h ../include/vki/vki-xen-schedop.h \
../include/vki/vki-xen-memory.h ../include/vki/vki-xen-evtchn.h \
../include/vki/vki-xen-gnttab.h ../include/vki/vki-xen-version.h \
../include/vki/vki-xen-hvm.h ../include/vki/vki-xen-tmem.h \
../include/vki/vki-xen-xsm.h ../include/vki/vki-xen-physdev.h \
../coregrind/pub_core_libcfile.h ../include/pub_tool_libcfile.h \
../include/pub_tool_vki.h /usr/include/stdio.h /usr/include/features.h \
/usr/include/i386-linux-gnu/sys/cdefs.h \
/usr/include/i386-linux-gnu/bits/wordsize.h \
/usr/include/i386-linux-gnu/gnu/stubs.h \
/usr/include/i386-linux-gnu/gnu/stubs-32.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stddef.h \
/usr/include/i386-linux-gnu/bits/types.h \
/usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/i386-linux-gnu/bits/stdio_lim.h \
/usr/include/i386-linux-gnu/bits/sys_errlist.h \
/usr/include/i386-linux-gnu/bits/stdio.h \
/usr/include/i386-linux-gnu/bits/stdio2.h /usr/include/unistd.h \
/usr/include/i386-linux-gnu/bits/posix_opt.h \
/usr/include/i386-linux-gnu/bits/environments.h \
/usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \
/usr/include/i386-linux-gnu/bits/unistd.h /usr/include/string.h \
/usr/include/i386-linux-gnu/bits/string.h \
/usr/include/i386-linux-gnu/bits/string2.h /usr/include/endian.h \
/usr/include/i386-linux-gnu/bits/endian.h \
/usr/include/i386-linux-gnu/bits/string3.h /usr/include/time.h \
/usr/include/i386-linux-gnu/bits/time.h /usr/include/fcntl.h \
/usr/include/i386-linux-gnu/bits/fcntl.h \
/usr/include/i386-linux-gnu/bits/fcntl-linux.h \
/usr/include/i386-linux-gnu/bits/stat.h \
/usr/include/i386-linux-gnu/bits/fcntl2.h /usr/include/stdlib.h \
/usr/include/i386-linux-gnu/bits/waitflags.h \
/usr/include/i386-linux-gnu/bits/waitstatus.h \
/usr/include/i386-linux-gnu/sys/types.h \
/usr/include/i386-linux-gnu/bits/pthreadtypes.h \
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h \
/usr/include/i386-linux-gnu/bits/stdlib-float.h \
/usr/include/i386-linux-gnu/bits/stdlib.h /usr/include/signal.h \
/usr/include/i386-linux-gnu/bits/sigset.h \
/usr/include/i386-linux-gnu/bits/signum.h \
/usr/include/i386-linux-gnu/bits/siginfo.h \
/usr/include/i386-linux-gnu/bits/sigaction.h \
/usr/include/i386-linux-gnu/bits/sigstack.h \
/usr/include/i386-linux-gnu/sys/ucontext.h \
/usr/include/i386-linux-gnu/bits/sigcontext.h \
/usr/include/i386-linux-gnu/bits/sigthread.h \
/usr/include/i386-linux-gnu/sys/poll.h \
/usr/include/i386-linux-gnu/bits/poll.h \
/usr/include/i386-linux-gnu/bits/poll2.h \
/usr/include/i386-linux-gnu/sys/socket.h \
/usr/include/i386-linux-gnu/sys/uio.h \
/usr/include/i386-linux-gnu/bits/uio.h \
/usr/include/i386-linux-gnu/bits/socket.h \
/usr/include/i386-linux-gnu/bits/socket_type.h \
/usr/include/i386-linux-gnu/bits/sockaddr.h \
/usr/include/i386-linux-gnu/asm/socket.h \
/usr/include/asm-generic/socket.h \
/usr/include/i386-linux-gnu/asm/sockios.h \
/usr/include/asm-generic/sockios.h \
/usr/include/i386-linux-gnu/bits/socket2.h /usr/include/netinet/in.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stdint.h /usr/include/stdint.h \
/usr/include/i386-linux-gnu/bits/wchar.h \
/usr/include/i386-linux-gnu/bits/in.h \
/usr/include/i386-linux-gnu/bits/byteswap.h \
/usr/include/i386-linux-gnu/bits/byteswap-16.h \
/usr/include/i386-linux-gnu/sys/stat.h /usr/include/netinet/tcp.h \
../coregrind/m_debuginfo/minilzo.h ../coregrind/m_debuginfo/lzoconf.h \
/usr/lib/gcc/i686-linux-gnu/5/include-fixed/limits.h \
/usr/lib/gcc/i686-linux-gnu/5/include-fixed/syslimits.h \
/usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \
/usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \
/usr/include/i386-linux-gnu/bits/posix2_lim.h \
/usr/include/i386-linux-gnu/bits/xopen_lim.h \
../coregrind/m_debuginfo/lzodefs.h \
../coregrind/m_debuginfo/minilzo-inl.c \
../coregrind/m_debuginfo/minilzo.h
/usr/include/stdc-predef.h:
../coregrind/pub_core_basics.h:
../include/pub_tool_basics.h:
../VEX/pub/libvex_basictypes.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h:
../coregrind/pub_core_libcassert.h:
../include/pub_tool_libcassert.h:
../include/pub_tool_basics.h:
../coregrind/pub_core_basics.h:
../coregrind/pub_core_vki.h:
../include/pub_tool_vki.h:
../include/vki/vki-linux.h:
../include/vki/vki-posixtypes-x86-linux.h:
../include/vki/vki-x86-linux.h:
../include/vki/vki-linux-drm.h:
../include/vki/vki-xen.h:
../include/vki/vki-xen-x86.h:
../include/vki/vki-xen-domctl.h:
../include/vki/vki-xen-sysctl.h:
../include/vki/vki-xen-mmuext.h:
../include/vki/vki-xen-schedop.h:
../include/vki/vki-xen-memory.h:
../include/vki/vki-xen-evtchn.h:
../include/vki/vki-xen-gnttab.h:
../include/vki/vki-xen-version.h:
../include/vki/vki-xen-hvm.h:
../include/vki/vki-xen-tmem.h:
../include/vki/vki-xen-xsm.h:
../include/vki/vki-xen-physdev.h:
../coregrind/pub_core_libcfile.h:
../include/pub_tool_libcfile.h:
../include/pub_tool_vki.h:
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/i386-linux-gnu/sys/cdefs.h:
/usr/include/i386-linux-gnu/bits/wordsize.h:
/usr/include/i386-linux-gnu/gnu/stubs.h:
/usr/include/i386-linux-gnu/gnu/stubs-32.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stddef.h:
/usr/include/i386-linux-gnu/bits/types.h:
/usr/include/i386-linux-gnu/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/include/i386-linux-gnu/bits/stdio_lim.h:
/usr/include/i386-linux-gnu/bits/sys_errlist.h:
/usr/include/i386-linux-gnu/bits/stdio.h:
/usr/include/i386-linux-gnu/bits/stdio2.h:
/usr/include/unistd.h:
/usr/include/i386-linux-gnu/bits/posix_opt.h:
/usr/include/i386-linux-gnu/bits/environments.h:
/usr/include/i386-linux-gnu/bits/confname.h:
/usr/include/getopt.h:
/usr/include/i386-linux-gnu/bits/unistd.h:
/usr/include/string.h:
/usr/include/i386-linux-gnu/bits/string.h:
/usr/include/i386-linux-gnu/bits/string2.h:
/usr/include/endian.h:
/usr/include/i386-linux-gnu/bits/endian.h:
/usr/include/i386-linux-gnu/bits/string3.h:
/usr/include/time.h:
/usr/include/i386-linux-gnu/bits/time.h:
/usr/include/fcntl.h:
/usr/include/i386-linux-gnu/bits/fcntl.h:
/usr/include/i386-linux-gnu/bits/fcntl-linux.h:
/usr/include/i386-linux-gnu/bits/stat.h:
/usr/include/i386-linux-gnu/bits/fcntl2.h:
/usr/include/stdlib.h:
/usr/include/i386-linux-gnu/bits/waitflags.h:
/usr/include/i386-linux-gnu/bits/waitstatus.h:
/usr/include/i386-linux-gnu/sys/types.h:
/usr/include/i386-linux-gnu/bits/pthreadtypes.h:
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:
/usr/include/i386-linux-gnu/bits/stdlib-float.h:
/usr/include/i386-linux-gnu/bits/stdlib.h:
/usr/include/signal.h:
/usr/include/i386-linux-gnu/bits/sigset.h:
/usr/include/i386-linux-gnu/bits/signum.h:
/usr/include/i386-linux-gnu/bits/siginfo.h:
/usr/include/i386-linux-gnu/bits/sigaction.h:
/usr/include/i386-linux-gnu/bits/sigstack.h:
/usr/include/i386-linux-gnu/sys/ucontext.h:
/usr/include/i386-linux-gnu/bits/sigcontext.h:
/usr/include/i386-linux-gnu/bits/sigthread.h:
/usr/include/i386-linux-gnu/sys/poll.h:
/usr/include/i386-linux-gnu/bits/poll.h:
/usr/include/i386-linux-gnu/bits/poll2.h:
/usr/include/i386-linux-gnu/sys/socket.h:
/usr/include/i386-linux-gnu/sys/uio.h:
/usr/include/i386-linux-gnu/bits/uio.h:
/usr/include/i386-linux-gnu/bits/socket.h:
/usr/include/i386-linux-gnu/bits/socket_type.h:
/usr/include/i386-linux-gnu/bits/sockaddr.h:
/usr/include/i386-linux-gnu/asm/socket.h:
/usr/include/asm-generic/socket.h:
/usr/include/i386-linux-gnu/asm/sockios.h:
/usr/include/asm-generic/sockios.h:
/usr/include/i386-linux-gnu/bits/socket2.h:
/usr/include/netinet/in.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdint.h:
/usr/include/stdint.h:
/usr/include/i386-linux-gnu/bits/wchar.h:
/usr/include/i386-linux-gnu/bits/in.h:
/usr/include/i386-linux-gnu/bits/byteswap.h:
/usr/include/i386-linux-gnu/bits/byteswap-16.h:
/usr/include/i386-linux-gnu/sys/stat.h:
/usr/include/netinet/tcp.h:
../coregrind/m_debuginfo/minilzo.h:
../coregrind/m_debuginfo/lzoconf.h:
/usr/lib/gcc/i686-linux-gnu/5/include-fixed/limits.h:
/usr/lib/gcc/i686-linux-gnu/5/include-fixed/syslimits.h:
/usr/include/limits.h:
/usr/include/i386-linux-gnu/bits/posix1_lim.h:
/usr/include/i386-linux-gnu/bits/local_lim.h:
/usr/include/linux/limits.h:
/usr/include/i386-linux-gnu/bits/posix2_lim.h:
/usr/include/i386-linux-gnu/bits/xopen_lim.h:
../coregrind/m_debuginfo/lzodefs.h:
../coregrind/m_debuginfo/minilzo-inl.c:
../coregrind/m_debuginfo/minilzo.h:
@@ -0,0 +1,303 @@
valgrind_listener-valgrind-listener.o: valgrind-listener.c \
/usr/include/stdc-predef.h ../coregrind/pub_core_basics.h \
../include/pub_tool_basics.h ../VEX/pub/libvex_basictypes.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h \
../coregrind/pub_core_libcassert.h ../include/pub_tool_libcassert.h \
../include/pub_tool_basics.h ../coregrind/pub_core_basics.h \
../coregrind/pub_core_vki.h ../include/pub_tool_vki.h \
../include/vki/vki-linux.h ../include/vki/vki-posixtypes-x86-linux.h \
../include/vki/vki-x86-linux.h ../include/vki/vki-linux-drm.h \
../include/vki/vki-xen.h ../include/vki/vki-xen-x86.h \
../include/vki/vki-xen-domctl.h ../include/vki/vki-xen-sysctl.h \
../include/vki/vki-xen-mmuext.h ../include/vki/vki-xen-schedop.h \
../include/vki/vki-xen-memory.h ../include/vki/vki-xen-evtchn.h \
../include/vki/vki-xen-gnttab.h ../include/vki/vki-xen-version.h \
../include/vki/vki-xen-hvm.h ../include/vki/vki-xen-tmem.h \
../include/vki/vki-xen-xsm.h ../include/vki/vki-xen-physdev.h \
../coregrind/pub_core_libcfile.h ../include/pub_tool_libcfile.h \
../include/pub_tool_vki.h /usr/include/stdio.h /usr/include/features.h \
/usr/include/i386-linux-gnu/sys/cdefs.h \
/usr/include/i386-linux-gnu/bits/wordsize.h \
/usr/include/i386-linux-gnu/gnu/stubs.h \
/usr/include/i386-linux-gnu/gnu/stubs-32.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stddef.h \
/usr/include/i386-linux-gnu/bits/types.h \
/usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/i386-linux-gnu/bits/stdio_lim.h \
/usr/include/i386-linux-gnu/bits/sys_errlist.h \
/usr/include/i386-linux-gnu/bits/stdio.h \
/usr/include/i386-linux-gnu/bits/stdio2.h /usr/include/unistd.h \
/usr/include/i386-linux-gnu/bits/posix_opt.h \
/usr/include/i386-linux-gnu/bits/environments.h \
/usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \
/usr/include/i386-linux-gnu/bits/unistd.h /usr/include/string.h \
/usr/include/xlocale.h /usr/include/i386-linux-gnu/bits/string.h \
/usr/include/i386-linux-gnu/bits/string2.h /usr/include/endian.h \
/usr/include/i386-linux-gnu/bits/endian.h \
/usr/include/i386-linux-gnu/bits/byteswap.h \
/usr/include/i386-linux-gnu/bits/byteswap-16.h /usr/include/stdlib.h \
/usr/include/i386-linux-gnu/bits/string3.h /usr/include/time.h \
/usr/include/i386-linux-gnu/bits/time.h /usr/include/fcntl.h \
/usr/include/i386-linux-gnu/bits/fcntl.h \
/usr/include/i386-linux-gnu/bits/fcntl-linux.h \
/usr/include/i386-linux-gnu/bits/stat.h \
/usr/include/i386-linux-gnu/bits/fcntl2.h \
/usr/include/i386-linux-gnu/bits/waitflags.h \
/usr/include/i386-linux-gnu/bits/waitstatus.h \
/usr/include/i386-linux-gnu/sys/types.h \
/usr/include/i386-linux-gnu/sys/select.h \
/usr/include/i386-linux-gnu/bits/select.h \
/usr/include/i386-linux-gnu/bits/sigset.h \
/usr/include/i386-linux-gnu/bits/select2.h \
/usr/include/i386-linux-gnu/sys/sysmacros.h \
/usr/include/i386-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h \
/usr/include/i386-linux-gnu/bits/stdlib-float.h \
/usr/include/i386-linux-gnu/bits/stdlib.h /usr/include/signal.h \
/usr/include/i386-linux-gnu/bits/signum.h \
/usr/include/i386-linux-gnu/bits/siginfo.h \
/usr/include/i386-linux-gnu/bits/sigaction.h \
/usr/include/i386-linux-gnu/bits/sigcontext.h \
/usr/include/i386-linux-gnu/bits/sigstack.h \
/usr/include/i386-linux-gnu/sys/ucontext.h \
/usr/include/i386-linux-gnu/bits/sigthread.h \
/usr/include/i386-linux-gnu/sys/poll.h \
/usr/include/i386-linux-gnu/bits/poll.h \
/usr/include/i386-linux-gnu/bits/poll2.h \
/usr/include/i386-linux-gnu/sys/socket.h \
/usr/include/i386-linux-gnu/sys/uio.h \
/usr/include/i386-linux-gnu/bits/uio.h \
/usr/include/i386-linux-gnu/bits/socket.h \
/usr/include/i386-linux-gnu/bits/socket_type.h \
/usr/include/i386-linux-gnu/bits/sockaddr.h \
/usr/include/i386-linux-gnu/asm/socket.h \
/usr/include/asm-generic/socket.h \
/usr/include/i386-linux-gnu/asm/sockios.h \
/usr/include/asm-generic/sockios.h \
/usr/include/i386-linux-gnu/bits/socket2.h /usr/include/netinet/in.h \
/usr/lib/gcc/i686-linux-gnu/5/include/stdint.h /usr/include/stdint.h \
/usr/include/i386-linux-gnu/bits/wchar.h \
/usr/include/i386-linux-gnu/bits/in.h
/usr/include/stdc-predef.h:
../coregrind/pub_core_basics.h:
../include/pub_tool_basics.h:
../VEX/pub/libvex_basictypes.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h:
../coregrind/pub_core_libcassert.h:
../include/pub_tool_libcassert.h:
../include/pub_tool_basics.h:
../coregrind/pub_core_basics.h:
../coregrind/pub_core_vki.h:
../include/pub_tool_vki.h:
../include/vki/vki-linux.h:
../include/vki/vki-posixtypes-x86-linux.h:
../include/vki/vki-x86-linux.h:
../include/vki/vki-linux-drm.h:
../include/vki/vki-xen.h:
../include/vki/vki-xen-x86.h:
../include/vki/vki-xen-domctl.h:
../include/vki/vki-xen-sysctl.h:
../include/vki/vki-xen-mmuext.h:
../include/vki/vki-xen-schedop.h:
../include/vki/vki-xen-memory.h:
../include/vki/vki-xen-evtchn.h:
../include/vki/vki-xen-gnttab.h:
../include/vki/vki-xen-version.h:
../include/vki/vki-xen-hvm.h:
../include/vki/vki-xen-tmem.h:
../include/vki/vki-xen-xsm.h:
../include/vki/vki-xen-physdev.h:
../coregrind/pub_core_libcfile.h:
../include/pub_tool_libcfile.h:
../include/pub_tool_vki.h:
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/i386-linux-gnu/sys/cdefs.h:
/usr/include/i386-linux-gnu/bits/wordsize.h:
/usr/include/i386-linux-gnu/gnu/stubs.h:
/usr/include/i386-linux-gnu/gnu/stubs-32.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stddef.h:
/usr/include/i386-linux-gnu/bits/types.h:
/usr/include/i386-linux-gnu/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/include/i386-linux-gnu/bits/stdio_lim.h:
/usr/include/i386-linux-gnu/bits/sys_errlist.h:
/usr/include/i386-linux-gnu/bits/stdio.h:
/usr/include/i386-linux-gnu/bits/stdio2.h:
/usr/include/unistd.h:
/usr/include/i386-linux-gnu/bits/posix_opt.h:
/usr/include/i386-linux-gnu/bits/environments.h:
/usr/include/i386-linux-gnu/bits/confname.h:
/usr/include/getopt.h:
/usr/include/i386-linux-gnu/bits/unistd.h:
/usr/include/string.h:
/usr/include/xlocale.h:
/usr/include/i386-linux-gnu/bits/string.h:
/usr/include/i386-linux-gnu/bits/string2.h:
/usr/include/endian.h:
/usr/include/i386-linux-gnu/bits/endian.h:
/usr/include/i386-linux-gnu/bits/byteswap.h:
/usr/include/i386-linux-gnu/bits/byteswap-16.h:
/usr/include/stdlib.h:
/usr/include/i386-linux-gnu/bits/string3.h:
/usr/include/time.h:
/usr/include/i386-linux-gnu/bits/time.h:
/usr/include/fcntl.h:
/usr/include/i386-linux-gnu/bits/fcntl.h:
/usr/include/i386-linux-gnu/bits/fcntl-linux.h:
/usr/include/i386-linux-gnu/bits/stat.h:
/usr/include/i386-linux-gnu/bits/fcntl2.h:
/usr/include/i386-linux-gnu/bits/waitflags.h:
/usr/include/i386-linux-gnu/bits/waitstatus.h:
/usr/include/i386-linux-gnu/sys/types.h:
/usr/include/i386-linux-gnu/sys/select.h:
/usr/include/i386-linux-gnu/bits/select.h:
/usr/include/i386-linux-gnu/bits/sigset.h:
/usr/include/i386-linux-gnu/bits/select2.h:
/usr/include/i386-linux-gnu/sys/sysmacros.h:
/usr/include/i386-linux-gnu/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:
/usr/include/i386-linux-gnu/bits/stdlib-float.h:
/usr/include/i386-linux-gnu/bits/stdlib.h:
/usr/include/signal.h:
/usr/include/i386-linux-gnu/bits/signum.h:
/usr/include/i386-linux-gnu/bits/siginfo.h:
/usr/include/i386-linux-gnu/bits/sigaction.h:
/usr/include/i386-linux-gnu/bits/sigcontext.h:
/usr/include/i386-linux-gnu/bits/sigstack.h:
/usr/include/i386-linux-gnu/sys/ucontext.h:
/usr/include/i386-linux-gnu/bits/sigthread.h:
/usr/include/i386-linux-gnu/sys/poll.h:
/usr/include/i386-linux-gnu/bits/poll.h:
/usr/include/i386-linux-gnu/bits/poll2.h:
/usr/include/i386-linux-gnu/sys/socket.h:
/usr/include/i386-linux-gnu/sys/uio.h:
/usr/include/i386-linux-gnu/bits/uio.h:
/usr/include/i386-linux-gnu/bits/socket.h:
/usr/include/i386-linux-gnu/bits/socket_type.h:
/usr/include/i386-linux-gnu/bits/sockaddr.h:
/usr/include/i386-linux-gnu/asm/socket.h:
/usr/include/asm-generic/socket.h:
/usr/include/i386-linux-gnu/asm/sockios.h:
/usr/include/asm-generic/sockios.h:
/usr/include/i386-linux-gnu/bits/socket2.h:
/usr/include/netinet/in.h:
/usr/lib/gcc/i686-linux-gnu/5/include/stdint.h:
/usr/include/stdint.h:
/usr/include/i386-linux-gnu/bits/wchar.h:
/usr/include/i386-linux-gnu/bits/in.h:
@@ -0,0 +1,271 @@
-- A program for extracting strongly connected components from a .dot
-- file created by auxprogs/gen-mdg.
-- How to use: one of the following:
-- compile to an exe: ghc -o dottoscc DotToScc.hs
-- and then ./dottoscc name_of_file.dot
-- or interpret with runhugs:
-- runhugs DotToScc.hs name_of_file.dot
-- or run within hugs:
-- hugs DotToScc.hs
-- Main> imain "name_of_file.dot"
module Main where
import System
import List ( sort, nub )
usage :: IO ()
usage = putStrLn "usage: dottoscc <name_of_file.dot>"
main :: IO ()
main = do args <- getArgs
if length args /= 1
then usage
else imain (head args)
imain :: String -> IO ()
imain dot_file_name
= do edges <- read_dot_file dot_file_name
let sccs = gen_sccs edges
let pretty = showPrettily sccs
putStrLn pretty
where
showPrettily :: [[String]] -> String
showPrettily = unlines . concatMap showScc
showScc elems
= let n = length elems
in
[""]
++ (if n > 1 then [" -- "
++ show n ++ " modules in cycle"]
else [])
++ map (" " ++) elems
-- Read a .dot file and return a list of edges
read_dot_file :: String{-filename-} -> IO [(String,String)]
read_dot_file dot_file_name
= do bytes <- readFile dot_file_name
let linez = lines bytes
let edges = [(s,d) | Just (s,d) <- map maybe_mk_edge linez]
return edges
where
-- identify lines of the form "text1 -> text2" and return
-- text1 and text2
maybe_mk_edge :: String -> Maybe (String, String)
maybe_mk_edge str
= case words str of
[text1, "->", text2] -> Just (text1, text2)
other -> Nothing
-- Take the list of edges and return a topologically sorted list of
-- sccs
gen_sccs :: [(String,String)] -> [[String]]
gen_sccs raw_edges
= let clean_edges = sort (nub raw_edges)
nodes = nub (concatMap (\(s,d) -> [s,d]) clean_edges)
ins v = [u | (u,w) <- clean_edges, v==w]
outs v = [w | (u,w) <- clean_edges, v==u]
components = map (sort.utSetToList) (deScc ins outs nodes)
in
components
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
-- Graph-theoretic stuff that does the interesting stuff.
-- ==========================================================--
--
deScc :: (Ord a) =>
(a -> [a]) -> -- The "ins" map
(a -> [a]) -> -- The "outs" map
[a] -> -- The root vertices
[Set a] -- The topologically sorted components
deScc ins outs
= spanning . depthFirst
where depthFirst = snd . deDepthFirstSearch outs (utSetEmpty, [])
spanning = snd . deSpanningSearch ins (utSetEmpty, [])
-- =========================================================--
--
deDepthFirstSearch :: (Ord a) =>
(a -> [a]) -> -- The map,
(Set a, [a]) -> -- state: visited set,
-- current sequence of vertices
[a] -> -- input vertices sequence
(Set a, [a]) -- final state
deDepthFirstSearch
= foldl . search
where
search relation (visited, sequence) vertex
| utSetElementOf vertex visited = (visited, sequence )
| otherwise = (visited', vertex: sequence')
where
(visited', sequence')
= deDepthFirstSearch relation
(utSetUnion visited (utSetSingleton vertex), sequence)
(relation vertex)
-- ==========================================================--
--
deSpanningSearch :: (Ord a) =>
(a -> [a]) -> -- The map
(Set a, [Set a]) -> -- Current state: visited set,
-- current sequence of vertice sets
[a] -> -- Input sequence of vertices
(Set a, [Set a]) -- Final state
deSpanningSearch
= foldl . search
where
search relation (visited, utSetSequence) vertex
| utSetElementOf vertex visited = (visited, utSetSequence )
| otherwise = (visited', utSetFromList (vertex: sequence): utSetSequence)
where
(visited', sequence)
= deDepthFirstSearch relation
(utSetUnion visited (utSetSingleton vertex), [])
(relation vertex)
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
-- Most of this set stuff isn't needed.
-- ====================================--
-- === set ===--
-- ====================================--
data Set e = MkSet [e]
-- ==========================================================--
--
unMkSet :: (Ord a) => Set a -> [a]
unMkSet (MkSet s) = s
-- ==========================================================--
--
utSetEmpty :: (Ord a) => Set a
utSetEmpty = MkSet []
-- ==========================================================--
--
utSetIsEmpty :: (Ord a) => Set a -> Bool
utSetIsEmpty (MkSet s) = s == []
-- ==========================================================--
--
utSetSingleton :: (Ord a) => a -> Set a
utSetSingleton x = MkSet [x]
-- ==========================================================--
--
utSetFromList :: (Ord a) => [a] -> Set a
utSetFromList x = (MkSet . rmdup . sort) x
where rmdup [] = []
rmdup [x] = [x]
rmdup (x:y:xs) | x==y = rmdup (y:xs)
| otherwise = x: rmdup (y:xs)
-- ==========================================================--
--
utSetToList :: (Ord a) => Set a -> [a]
utSetToList (MkSet xs) = xs
-- ==========================================================--
--
utSetUnion :: (Ord a) => Set a -> Set a -> Set a
utSetUnion (MkSet []) (MkSet []) = (MkSet [])
utSetUnion (MkSet []) (MkSet (b:bs)) = (MkSet (b:bs))
utSetUnion (MkSet (a:as)) (MkSet []) = (MkSet (a:as))
utSetUnion (MkSet (a:as)) (MkSet (b:bs))
| a < b = MkSet (a: (unMkSet (utSetUnion (MkSet as) (MkSet (b:bs)))))
| a == b = MkSet (a: (unMkSet (utSetUnion (MkSet as) (MkSet bs))))
| a > b = MkSet (b: (unMkSet (utSetUnion (MkSet (a:as)) (MkSet bs))))
-- ==========================================================--
--
utSetIntersection :: (Ord a) => Set a -> Set a -> Set a
utSetIntersection (MkSet []) (MkSet []) = (MkSet [])
utSetIntersection (MkSet []) (MkSet (b:bs)) = (MkSet [])
utSetIntersection (MkSet (a:as)) (MkSet []) = (MkSet [])
utSetIntersection (MkSet (a:as)) (MkSet (b:bs))
| a < b = utSetIntersection (MkSet as) (MkSet (b:bs))
| a == b = MkSet (a: (unMkSet (utSetIntersection (MkSet as) (MkSet bs))))
| a > b = utSetIntersection (MkSet (a:as)) (MkSet bs)
-- ==========================================================--
--
utSetSubtraction :: (Ord a) => Set a -> Set a -> Set a
utSetSubtraction (MkSet []) (MkSet []) = (MkSet [])
utSetSubtraction (MkSet []) (MkSet (b:bs)) = (MkSet [])
utSetSubtraction (MkSet (a:as)) (MkSet []) = (MkSet (a:as))
utSetSubtraction (MkSet (a:as)) (MkSet (b:bs))
| a < b = MkSet (a: (unMkSet (utSetSubtraction (MkSet as) (MkSet (b:bs)))))
| a == b = utSetSubtraction (MkSet as) (MkSet bs)
| a > b = utSetSubtraction (MkSet (a:as)) (MkSet bs)
-- ==========================================================--
--
utSetElementOf :: (Ord a) => a -> Set a -> Bool
utSetElementOf x (MkSet []) = False
utSetElementOf x (MkSet (y:ys)) = x==y || (x>y && utSetElementOf x (MkSet ys))
-- ==========================================================--
--
utSetSubsetOf :: (Ord a) => Set a -> Set a -> Bool
utSetSubsetOf (MkSet []) (MkSet bs) = True
utSetSubsetOf (MkSet (a:as)) (MkSet bs)
= utSetElementOf a (MkSet bs) && utSetSubsetOf (MkSet as) (MkSet bs)
-- ==========================================================--
--
utSetUnionList :: (Ord a) => [Set a] -> Set a
utSetUnionList setList = foldl utSetUnion utSetEmpty setList
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,130 @@
include $(top_srcdir)/Makefile.all.am
dist_noinst_SCRIPTS = \
change-copyright-year \
dump_insn_ppc.sh \
gen-mdg \
gsl16test \
gsl19test \
nightly-build-summary \
update-demangler \
posixtestsuite-1.5.1-diff-results
EXTRA_DIST = \
docs/valgrind-listener-manpage.xml \
DotToScc.hs \
Merge3Way.hs \
gsl16-badfree.patch \
gsl16-wavelet.patch \
posixtestsuite-1.5.1-diff.txt \
ppcfround.c \
ppc64shifts.c \
primes.c
#----------------------------------------------------------------------------
# valgrind_listener (built for the primary target only)
# valgrind-di-server (ditto)
#----------------------------------------------------------------------------
bin_PROGRAMS = valgrind-listener valgrind-di-server
valgrind_listener_SOURCES = valgrind-listener.c
valgrind_listener_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
valgrind_listener_CFLAGS = $(AM_CFLAGS_PRI)
valgrind_listener_CCASFLAGS = $(AM_CCASFLAGS_PRI)
valgrind_listener_LDFLAGS = $(AM_CFLAGS_PRI)
if VGCONF_PLATVARIANT_IS_ANDROID
valgrind_listener_CFLAGS += -static
endif
# If there is no secondary platform, and the platforms include x86-darwin,
# then the primary platform must be x86-darwin. Hence:
if ! VGCONF_HAVE_PLATFORM_SEC
if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
valgrind_listener_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
endif
endif
if VGCONF_OS_IS_SOLARIS
valgrind_listener_LDADD = -lsocket -lnsl
endif
valgrind_di_server_SOURCES = valgrind-di-server.c
valgrind_di_server_CPPFLAGS = $(AM_CPPFLAGS_PRI) -I$(top_srcdir)/coregrind
valgrind_di_server_CFLAGS = $(AM_CFLAGS_PRI)
valgrind_di_server_CCASFLAGS = $(AM_CCASFLAGS_PRI)
valgrind_di_server_LDFLAGS = $(AM_CFLAGS_PRI)
if VGCONF_PLATVARIANT_IS_ANDROID
valgrind_di_server_CFLAGS += -static
endif
# If there is no secondary platform, and the platforms include x86-darwin,
# then the primary platform must be x86-darwin. Hence:
if ! VGCONF_HAVE_PLATFORM_SEC
if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
valgrind_di_server_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
endif
endif
if VGCONF_OS_IS_SOLARIS
valgrind_di_server_LDADD = -lsocket -lnsl
endif
#----------------------------------------------------------------------------
# getoff-<platform>
# Used to retrieve user space various offsets, using user space libraries.
#----------------------------------------------------------------------------
noinst_PROGRAMS = getoff-@VGCONF_ARCH_PRI@-@VGCONF_OS@
if VGCONF_HAVE_PLATFORM_SEC
noinst_PROGRAMS += getoff-@VGCONF_ARCH_SEC@-@VGCONF_OS@
endif
# The link flags for this are tricky, because we want to build it for
# both the primary and secondary platforms, and add
# "-Wl,-read_only_relocs -Wl,suppress" to whichever of those is x86-darwin,
# if any. Hence there's a double-nested conditional that adds to the
# LDFLAGS in both cases.
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = getoff.c
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_PRI)
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_PRI) @LIB_UBSAN@
if HAVE_DLINFO_RTLD_DI_TLS_MODID
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = $(LDADD) -ldl
endif
# If there is no secondary platform, and the platforms include x86-darwin,
# then the primary platform must be x86-darwin. Hence:
if ! VGCONF_HAVE_PLATFORM_SEC
if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
getoff_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
endif
endif
if VGCONF_HAVE_PLATFORM_SEC
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = getoff.c
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CCASFLAGS = $(AM_CCASFLAGS_SEC)
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = $(AM_CFLAGS_SEC)
if HAVE_DLINFO_RTLD_DI_TLS_MODID
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = $(LDADD) -ldl
endif
endif
# If there is a secondary platform, and the platforms include x86-darwin,
# then the primary platform must be amd64-darwin and the secondary platform
# must be x86-darwin. Hence:
if VGCONF_HAVE_PLATFORM_SEC
if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
getoff_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
endif
endif
#----------------------------------------------------------------------------
# General stuff
#----------------------------------------------------------------------------
all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
clean-local: clean-noinst_DSYMS
install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
uninstall-local: uninstall-noinst_PROGRAMS uninstall-noinst_DSYMS
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,66 @@
module Main where
import IO
import Directory
import System
dirAA = "in-AAcommon-6077-1660"
dirBB = "in-BBtrunk"
dirCC = "in-CCaixbranch"
dirRR = "RESULT"
maybe_do :: String -> IO ()
maybe_do f
= let r = dirRR ++ "/" ++ f
a = dirAA ++ "/" ++ f
b = dirBB ++ "/" ++ f
c = dirCC ++ "/" ++ f
in
do x <- doesFileExist r
if x
then hPutStrLn stderr ("done: " ++ f)
else
do hPutStrLn stderr (" do: " ++ f)
xx <- system ("mkdir -p " ++ basename r)
rs <- merge3 r a b c
hPutStrLn stderr (rs ++ f)
merge3 :: String -> String -> String -> String -> IO String
merge3 r a b c
= do ca <- readFile a
cb <- readFile b
cc <- readFile c
let same = identical3 ca cb cc
if same
then
do ec <- system ("/bin/cp " ++ a ++ " " ++ r)
if ec == ExitSuccess
then return "COPY: "
else barf "/bin/cp failed"
else
do ec <- system ("kdiff3 -m -o " ++ r ++ " -b "
++ a ++ " " ++ b ++ " " ++ c ++ " &> /dev/null" )
if ec == ExitSuccess
then return " ok: "
else barf "kdiff3 failed"
barf :: String -> IO a
barf who
= do hPutStrLn stderr ("FAIL: " ++ who)
exitWith ExitSuccess
identical3 :: String -> String -> String -> Bool
identical3 [] [] [] = True
identical3 (x:xs) (y:ys) (z:zs)
= x == y && y == z && identical3 xs ys zs
identical3 _ _ _ = False
main :: IO ()
main
= do t <- readFile "FILEScba"
let fs = lines t
mapM_ maybe_do fs
basename = reverse . drop 1 . dropWhile (/= '/') . reverse
@@ -0,0 +1,29 @@
#! /bin/sh
#
# Script updates the copyright year in every file in Valgrind that contains
# a copyright notice. Assumes they're all in the same format:
#
# "Copyright (C) 20xy-2012"
#
# where x can be 0 or 1 and y can be anything.
# To use:
# - change the years in the 'perl' command below appropriately.
# - Run it from the base directory of a Valgrind workspace.
# - And check the results look ok by diff'ing against the repository.
#
# Note that it will spit out some warnings when it runs; ignore these.
#
# The find command deliberately skips .svn/ subdirs -- we don't want to
# change them.
for i in `find . -name '*.[chS]' -o -name '*.in' -type f -not -path '*.svn\/*'` ; do
echo $i
if [ -L $i ]; then continue; fi # skip symbolic links
perl -p -e 's/Copyright \(C\) 20([0-1])([0-9])-2013/Copyright (C) 20$1$2-2015/' < $i > tmp.$$
mv tmp.$$ $i
# Copyright IBM Corp. 2010-2011
perl -p -e 's/Copyright IBM Corp. 20([0-1])([0-9])-2013/Copyright IBM Corp. 20$1$2-2015/' < $i > tmp.$$
mv tmp.$$ $i
done
@@ -0,0 +1,74 @@
<?xml version="1.0"?> <!-- -*- sgml -*- -->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[ <!ENTITY % vg-entities SYSTEM "../../docs/xml/vg-entities.xml"> %vg-entities; ]>
<refentry id="listener">
<refmeta>
<refentrytitle>valgrind-listener</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Release &rel-version;</refmiscinfo>
</refmeta>
<refnamediv>
<refname>valgrind-listener</refname>
<refpurpose>listens on a socket for Valgrind commentary</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>valgrind-listener</command>
<arg><replaceable>options</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1 id="description">
<title>Description</title>
<para><command>valgrind-listener</command> accepts (multiple) connections
from <command>valgrind</command> processes that use the
<option>--log-socket</option> option on the specified port and copies the
commentary it is sent to stdout.
</para>
</refsect1>
<refsect1 id="options">
<title>Options</title>
<xi:include href="../../docs/xml/manual-core.xml" xpointer="listener.opts.list"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</refsect1>
<refsect1 id="see_also">
<title>See Also</title>
<para>
valgrind(1),
<filename>&vg-docs-path;</filename> or
<filename>&vg-docs-url;</filename>.
</para>
</refsect1>
<refsect1 id="author">
<title>Author</title>
<para>Julian Seward.</para>
</refsect1>
</refentry>
@@ -0,0 +1,4 @@
#!/bin/zsh
objdump -b binary -m powerpc -EB -D \
=(perl -e 'print pack "N", hex $ARGV[0]' $1) | tail +7
+264
View File
@@ -0,0 +1,264 @@
#! /usr/bin/perl
#
# Generate Valgrind's module dependence graph in 'dot' format.
#
# You can run it from anywhere(?) in a Valgrind source tree, but the two
# most interesting places are:
# - the root, to get the entire module dependence graph.
# - coregrind/, to get the core's module dependence graph.
#
# It sends a dot-format graph to stdout. You can use dot (part of the
# "GraphViz" package) to generated a PostScript graphs like this:
#
# dot -Tps foo.dot -o foo.ps
#
# Caveats:
# - It's not a proper parser. If you have a #include that is commented out,
# it will think it's there. We see that particularly in m_demangle.
# - It only looks in C files, not in header files, so it will miss any
# extra dependencies this causes. Fortunately we don't have many like
# that.
use warnings;
use strict;
#----------------------------------------------------------------------------
# Global variables
#----------------------------------------------------------------------------
# The dependence graph is a set of src-->dst pairs, stored in a double-hash:
#
# hash(src, hash(dst, dst_realname))
#
# Each of 'src' and 'dst' are node names. 'src' is always a module name,
# eg. 'm_main' or 'memcheck'. The destination is sometimes a module name,
# and sometimes a header file. Because Dot can't handle certain characters
# in its node names, when 'dst' represents a header file it's a transformed
# version of the header file name, eg. 'INT_memcheck_h' or 'EXT_sys_mman_h'.
# The 'dst_realname' holds the original name, eg. '"memcheck.h"' or
# "<sys/mman.h>". We use 'dst' for the node name in the graph, but label it
# with 'dst_realname' and that's what gets seen. (Although we use "" for
# 'dst_realname' when it would be the same as 'dst'.)
my $deps = {};
# Directories to skip. These are the defaults, they can be augmented
# using command-line options.
my %dirs_to_skip = ( auxprogs => 1, hp2ps => 1, tests => 1 );
# Command-line variables -- things we should show. Default is yes.
my $show_tools = 1;
my $show_headers = 1;
my $show_libc = 1;
# Modules to hide.
my %hide;
# List of all tools.
my @tools = ( "cachegrind", "helgrind",
"lackey", "massif", "memcheck", "none" );
my $usage = <<END
usage: gen-mdg [options]
options:
--headers=no|yes show headers, ie. show module-to-module deps only
--hide=<a>,<b>,... hide module(s) named <a>, <b>, ...
END
;
#----------------------------------------------------------------------------
# Subroutines
#----------------------------------------------------------------------------
sub process_cmd_line()
{
for my $arg (@ARGV) {
# --headers=yes|no
if ($arg =~ /^--headers=(yes|no)$/) {
$show_headers = 1 if ($1 eq "yes");
$show_headers = 0 if ($1 eq "no");
# --hide=<a>,<b>,...
} elsif ($arg =~ /^--hide=(.*)$/) {
my @hiders = split(/,/, $1);
foreach my $h (@hiders) {
$hide{$h} = 1;
}
} else {
die $usage;
}
}
if (!$show_tools) {
foreach my $tool (@tools) {
$dirs_to_skip{$tool} = 1;
}
}
}
# Convert a header filename into a node name acceptable by dot.
sub clean_nodename($)
{
my ($s) = @_;
$s =~ s/"([^"]+)"/INT_$1/; # "foo.h" --> foo.h
$s =~ s/<([^>]+)>/EXT_$1/; # <foo.h> --> foo.h
$s =~ s/\./_/g; # foo.h --> foo_h
$s =~ s/-/_/g; # foo-bar.h --> foo_bar_h
$s =~ s/\//_/g; # bar/foo_h --> bar_foo_h
return $s;
}
# Convert a header filename into a node label acceptable by dot.
sub clean_nodelabel($)
{
my ($s) = @_;
$s =~ s/"/\\"/g; # "foo.h" --> \"foo.h\"
return $s;
}
# $module is the module to which the C/asm file $f belongs.
sub scan_C_or_asm_file($$)
{
my ($module, $f) = @_;
# Skip if this is a module we want to hide
if ($hide{$module}) {
return;
}
# Get any existing dependencies for this module, initialise if none
my $module_deps = $deps->{$module};
if (not defined $module_deps) {
$module_deps = {};
}
# Scan the C/asm file
open(CFILE, "< $f") || die "File $f not openable\n";
while (my $line = <CFILE>) {
if ($line =~ /#include\s+(("|<)[^">]+("|>))/) {
# Right! We've found a #include line.
my $include_string = $1;
my $target;
my $realname;
if ($include_string =~ /"pub_(core|tool)_([A-Za-z]+).h"/) {
# If #include string is "pub_core_foo.h" or "pub_tool_foo.h",
# the target module is "m_foo".
#
# Nb: assuming the "foo" part does not contains underscores!
$target = "m_$2";
$realname = "";
# But don't show hidden modules
if ($hide{$target}) {
$target = "";
}
} elsif ($show_headers) {
# Otherwise use the #include string as-is for the target.
# Note that "#include pub_core_foo_asm.h" falls into this
# category. We don't consider that part of the m_foo module
# because the *_asm.h only define some constants.
$target = clean_nodename($include_string);
$realname = clean_nodelabel($include_string);
} else {
# Don't record anything
$target = "";
$realname = "";
}
# Maybe record dependency (unless it's circular)
if ($target ne "" and $target ne $module) {
$module_deps->{$target} = $realname;
}
}
}
close(CFILE);
# Store the updated dependencies.
$deps->{$module} = $module_deps;
}
sub process_dir($); # forward declarations required because of recursion
sub process_dir($)
{
my ($parentd) = @_;
# Go through each file/dir in the directory.
my @fs = <*>;
foreach my $f (@fs) {
if (-d $f) {
# Directory -- recursively process unless we want to skip it.
if (not exists $dirs_to_skip{$f}) {
chdir $f or die;
process_dir($f);
chdir ".." or die;
}
} elsif (-f $f) {
if ($f =~ /\w+\.[cS]$/) {
# If this is a .c/.S file in coregrind/, it's a module in its
# own right, eg. coregrind/m_redir.c --> module name of
# "m_redir".
#
# Otherwise, it belongs to the module whose name is that of
# the parent directory, eg. coregrind/m_debuginfo/symtab.c
# --> module name of "m_debuginfo".
my $module;
if ($parentd eq "coregrind") {
$module = $f;
$module =~ s/(\w+).[cS]$/$1/; # foo.c --> foo
} else {
$module = $parentd;
}
# Now the module/f pair is either:
# - like this: (m_redir, m_redir.c)
# - or like this: (m_debuginfo, symtab.c)
scan_C_or_asm_file($module, $f);
}
} else {
die "$f is not a dir nor a file\n";
}
}
}
sub print_graph()
{
my %printed_realnames;
print("digraph G {\n");
while (my ($src, $dst_hash) = each %$deps) {
while (my ($dst, $dst_realname) = each %$dst_hash) {
# If the dstnode has a realname, print just the dstnode with that
# realname, and record it in %printed_realnames so we don't print
# it again.
if ($dst_realname ne "") {
if (not defined $printed_realnames{$dst}) {
print(" $dst [label=\"$dst_realname\"]\n");
$printed_realnames{$dst} = 1;
}
}
# Print the src-->dst edge.
print(" $src -> $dst\n");
}
}
print("}\n");
}
#----------------------------------------------------------------------------
# main
#----------------------------------------------------------------------------
process_cmd_line();
my $start_dir = `basename \`pwd\``;
chop($start_dir); # trim newline
process_dir($start_dir);
print_graph();
Binary file not shown.
@@ -0,0 +1,181 @@
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2014-2015 Philippe Waroquiers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
/* This file is used to generate target executable(s) getoff-<platform>
In a bi-arch setup, this is used to build 2 executables
(for the primary and secondary platforms).
This program uses user space libraries to retrieve some platform
dependent offsets needed for Valgrind core, but that cannot (easily)
be retrieved by Valgrind core.
This is currently used only for handling the gdbsrv QGetTlsAddr query :
it only computes and outputs lm_modid_offset in struct link_map
of the dynamic linker. In theory, we should also compute the offset needed
to get the dtv from the thread register/pointer/...
Currently, the various valgrind-low-xxxxxx.c files are hardcoding this
offset as it is deemed (?) stable, and there is no clear way how to
compute this dtv offset.
The getoff-<platform> executable will be launched automatically by
Valgrind gdbserver when the first QGetTlsAddr query is retrieved.
On plaforms that do not support __thread and/or that do not provide
dlinfo RTLD_DI_TLS_MODID, this executable produces no output. */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <config.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_DLINFO_RTLD_DI_TLS_MODID
#include <link.h>
#include <dlfcn.h>
#endif
/* true if arg matches the provided option */
static
int is_opt(char* arg, const char *option)
{
int option_len = strlen(option);
if (option[option_len-1] == '=')
return (0 == strncmp(option, arg, option_len));
else
return (0 == strcmp(option, arg));
}
static int verbose = 0;
static
void usage (char* progname)
{
fprintf(stderr,
"Usage: %s [--help] [-h] [-v] [-o <outputfile>]\n"
"Outputs various user space offsets\n"
"By default, outputs on stdout.\n"
"Use -o to output to <outputfile>\n"
"-v : be more verbose\n",
progname);
}
int main (int argc, char** argv)
{
int i;
FILE *outputfile;
int nr_errors = 0;
outputfile = stdout;
i = 1;
while (i < argc) {
if (is_opt(argv[i], "--help") || is_opt(argv[i], "-h")) {
usage(argv[0]);
exit(0);
} else if (is_opt(argv[i], "-v")) {
verbose++;
} else if (is_opt(argv[i], "-o")) {
if (i+1 == argc) {
fprintf(stderr,
"missing output file for -o option\n"
"Use --help for more information.\n");
exit (1);
}
i++;
outputfile = fopen(argv[i], "w");
if (outputfile == NULL) {
fprintf(stderr, "Could not fopen %s in write mode\n", argv[i]);
perror ("fopen output file failed");
exit (1);
}
} else {
fprintf (stderr,
"unknown or invalid argument %s\n"
"Use --help for more information.\n",
argv[i]);
exit(1);
}
i++;
}
#ifdef HAVE_DLINFO_RTLD_DI_TLS_MODID
/* Compute offset of lm_modid in struct link_map.
This is needed to support QGetTlsAddr gdbsrv query.
Computation is done using an ugly hack, but less ugly than
hardcoding the offset depending on the glibc version and
platform.
The below works, based the assumption that RTLD_DI_TLS_MODID
just access and returns directly the field in the dummy
link_map structure we have prepared.
If glibc debug info is installed on your system, you can
also find this offset by doing in GDB:
p &((struct link_map*)0x0)->l_tls_modid
(see also coregrind/m_gdbserver/valgrind_low.h target_get_dtv
comments).
*/
{
#define MAX_LINKMAP_WORDS 10000
size_t dummy_link_map[MAX_LINKMAP_WORDS];
size_t off;
size_t modid_offset;
for (off = 0; off < MAX_LINKMAP_WORDS; off++)
dummy_link_map[off] = off;
if (dlinfo ((void*)dummy_link_map, RTLD_DI_TLS_MODID,
&modid_offset) == 0) {
assert(modid_offset >= 0 && modid_offset < MAX_LINKMAP_WORDS);
fprintf(outputfile,
"lm_modid_offset 0x%zx\n", modid_offset*sizeof(size_t));
} else {
fprintf(stderr,
"Error computing lm_modid_offset.\n"
"dlinfo error %s\n", dlerror());
nr_errors++;
}
#undef MAX_LINKMAP_WORDS
}
if (outputfile != stdout)
if (fclose (outputfile) != 0) {
perror ("fclose output file failed\n");
nr_errors++;
}
#else
if (verbose)
fprintf(stderr,
"cannot compute lm_modid_offset.\n"
"configure did not define HAVE_DLINFO_RTLD_DI_TLS_MODID.\n");
#endif
if (nr_errors == 0)
exit(0);
else
exit(1);
}
@@ -0,0 +1,32 @@
Index: test_complex_source.c
===================================================================
RCS file: /home/gsl-cvs/gsl/vector/test_complex_source.c,v
retrieving revision 1.23
diff -u -r1.23 test_complex_source.c
--- test_complex_source.c 24 Jun 2005 11:33:25 -0000 1.23
+++ test_complex_source.c 6 Jul 2005 11:18:33 -0000
@@ -75,7 +75,7 @@
if (stride == 1)
{
v0 = FUNCTION (gsl_vector, alloc) (N);
- view = FUNCTION (gsl_vector, subvector) (v, 0, N);
+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N);
v = &view.vector;
}
else
Index: test_source.c
===================================================================
RCS file: /home/gsl-cvs/gsl/vector/test_source.c,v
retrieving revision 1.26
diff -u -r1.26 test_source.c
--- test_source.c 24 Jun 2005 11:33:26 -0000 1.26
+++ test_source.c 6 Jul 2005 11:14:18 -0000
@@ -75,7 +75,7 @@
if (stride == 1)
{
v0 = FUNCTION (gsl_vector, alloc) (N);
- view = FUNCTION (gsl_vector, subvector) (v, 0, N);
+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N);
v = &view.vector;
}
else
@@ -0,0 +1,11 @@
--- wavelet/dwt.c~ 2004-12-24 14:57:34.000000000 +0100
+++ wavelet/dwt.c 2005-07-08 23:31:32.000000000 +0200
@@ -30,7 +30,7 @@
static int binary_logn (const size_t n);
static void dwt_step (const gsl_wavelet * w, double *a, size_t stride,
- size_t n, int isign, gsl_wavelet_workspace * work);
+ size_t n, gsl_wavelet_direction dir, gsl_wavelet_workspace * work);
static int
binary_logn (const size_t n)
+118
View File
@@ -0,0 +1,118 @@
#!/bin/sh
# Do an automated test which involves building and regtesting version
# 1.6 of the GNU Scientific Library (gsl). This has proven to be a
# very thorough test of Vex's CPU simulations and has exposed bugs
# which had not been previously discovered. Gsl contains more
# than 100,000 tests as part of its regression suite, and so this
# script's purpose is to runs those tests using valgrind and compare
# against the same tests run natively.
#
# You can download gsl and get more info about it at
# http://www.gnu.org/software/gsl
# Args:
# absolute name of gsl-1.6.tar.gz file
# name of C compiler
# args for C compiler
# name of Valgrind
# args for Valgrind
# Results: 3.7.0 --tool=none
# x86 1 failure Ubuntu 10.10
# FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs 7.25922435194575979e-15 expected)
# same failure was also present in 3.6.1
# s390x 0 failures on z900 running RHEL4
if [ $# != 5 ]
then
echo "usage: gsl16test /absolute/name/of/gsl-1.6-patched.tar.gz"
echo " C-compiler-command"
echo " flags-for-C-compiler"
echo " Valgrind-command"
echo " flags-for-Valgrind"
exit 1
fi
runcmd () {
echo -n " $1 ... "
shift
(eval "$*") >> log.verbose 2>&1
if [ $? = 0 ]
then
echo "done"
return 0
else
echo "failed"
return 1
fi
}
GSL_FILE=$1
GSL_CC=$2
GSL_CFLAGS=$3
GSL_VV=$4
GSL_VFLAGS=$5
TESTS1="block/test cblas/test cdf/test cheb/test combination/test"
TESTS2="complex/test const/test deriv/test dht/test diff/test"
TESTS3="eigen/test err/test fft/test fit/test histogram/test"
TESTS4="ieee-utils/test integration/test interpolation/test linalg/test"
TESTS5="matrix/test min/test monte/test multifit/test multimin/test"
TESTS6="multiroots/test ntuple/test ode-initval/test permutation/test"
TESTS7="poly/test qrng/test randist/test rng/test roots/test siman/test"
TESTS8="sort/test specfunc/test statistics/test sum/test sys/test"
TESTS9="vector/test wavelet/test"
ALL_TESTS="$TESTS1 $TESTS2 $TESTS3 $TESTS4 $TESTS5 $TESTS6 $TESTS7 $TESTS8 $TESTS9"
echo "gsl16test: src: " $GSL_FILE
echo "gsl16test: cc: " $GSL_CC
echo "gsl16test: cflags: " $GSL_CFLAGS
echo "gsl16test: valgrind: " $GSL_VV
echo "gsl16test: vflags: " $GSL_VFLAGS
rm -rf log.verbose gsl-1.6-patched summary.txt
echo > log.verbose
echo > summary.txt
echo $0 $1 \"$2\" \"$3\" \"$4\" \"$5\" >> summary.txt
echo >> summary.txt
runcmd "Untarring " \
"rm -rf gsl-1.6-patched && tar xzf $GSL_FILE" && \
\
runcmd "Configuring " \
"(cd gsl-1.6-patched && CC=$GSL_CC CFLAGS=\"$GSL_CFLAGS\" ./configure)" && \
\
runcmd "Building " \
"(cd gsl-1.6-patched && make -j4 && make -k check)"
echo -n " Collecting reference results "
rm -f out-REF
(cd gsl-1.6-patched && for f in $ALL_TESTS ; do ./$f ; done) &> out-REF
echo " ... done"
echo -n " Collecting valgrinded results "
rm -f out-VAL
(cd gsl-1.6-patched && for f in $ALL_TESTS ; do eval $GSL_VV -v --trace-children=yes "$GSL_VFLAGS" ./$f ; done) &> out-VAL
echo " ... done"
echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)
echo -n " Native passes: " && (grep PASS: out-REF | wc -l)
echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l)
echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l)
(echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)) >> summary.txt
(echo -n " Native passes: " && (grep PASS: out-REF | wc -l)) >> summary.txt
(echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l)) >> summary.txt
(echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l)) >> summary.txt
echo >> summary.txt
echo
+123
View File
@@ -0,0 +1,123 @@
#!/bin/sh
# Do an automated test which involves building and regtesting version
# 1.9 of the GNU Scientific Library (gsl). This has proven to be a
# very thorough test of Vex's CPU simulations and has exposed bugs
# which had not been previously discovered. Gsl 1.9 contains more
# than 6 million tests as part of its regression suite, and so this
# script's purpose is to runs those tests using valgrind and compare
# against the same tests run natively. Note that it produces a
# huge amount of output (about 2 x 620 MByte), so be careful.
# The older gsl16test script produces only about 2 x 7 MByte per run.
#
# You can download gsl and get more info about it at
# http://www.gnu.org/software/gsl
# Args:
# absolute name of gsl-1.9.tar.gz file
# name of C compiler
# args for C compiler
# name of Valgrind
# args for Valgrind
# Results: 3.7.0 --tool=none
# x86 1 failure Ubuntu 10.10
# FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs 7.25922435194575979e-15 expected)
# same failure was also present in 3.6.1
# s390x 0 failures on z196 running SLES11
if [ $# != 5 ]
then
echo "usage: gsl19test /absolute/name/of/gsl-1.9.tar.gz"
echo " C-compiler-command"
echo " flags-for-C-compiler"
echo " Valgrind-command"
echo " flags-for-Valgrind"
exit 1
fi
runcmd () {
echo -n " $1 ... "
shift
(eval "$*") >> log.verbose 2>&1
if [ $? = 0 ]
then
echo "done"
return 0
else
echo "failed"
return 1
fi
}
GSL_FILE=$1
GSL_CC=$2
GSL_CFLAGS=$3
GSL_VV=$4
GSL_VFLAGS=$5
TESTS1="block/test bspline/test cblas/test cdf/test cheb/test"
TESTS2="combination/test complex/test const/test deriv/test dht/test"
TESTS3="diff/test eigen/test err/test fft/test fit/test histogram/test"
TESTS4="ieee-utils/test integration/test interpolation/test linalg/test"
TESTS5="matrix/test min/test monte/test multifit/test multimin/test"
TESTS6="multiroots/test ntuple/test ode-initval/test permutation/test"
TESTS7="poly/test qrng/test randist/test rng/test roots/test siman/test"
TESTS8="sort/test specfunc/test statistics/test sum/test sys/test"
TESTS9="vector/test wavelet/test"
ALL_TESTS="$TESTS1 $TESTS2 $TESTS3 $TESTS4 $TESTS5 $TESTS6 $TESTS7 $TESTS8 $TESTS9"
echo "gsl19test: src: " $GSL_FILE
echo "gsl19test: cc: " $GSL_CC
echo "gsl19test: cflags: " $GSL_CFLAGS
echo "gsl19test: valgrind: " $GSL_VV
echo "gsl19test: vflags: " $GSL_VFLAGS
rm -rf log.verbose gsl-1.9 summary.txt
echo > log.verbose
echo > summary.txt
echo $0 $1 \"$2\" \"$3\" \"$4\" \"$5\" >> summary.txt
echo >> summary.txt
runcmd "Untarring " \
"rm -rf gsl-1.9 && tar xzf $GSL_FILE" && \
\
runcmd "Configuring " \
"(cd gsl-1.9 && CC=$GSL_CC CFLAGS=\"$GSL_CFLAGS\" ./configure)" && \
\
runcmd "Building " \
"(cd gsl-1.9 && make && make -k check)"
echo -n " Collecting reference results "
rm -f out-REF
(cd gsl-1.9 && for f in $ALL_TESTS ; \
do GSL_TEST_VERBOSE=1 ./$f ; done) &> out-REF
echo " ... done"
echo -n " Collecting valgrinded results "
rm -f out-V
(cd gsl-1.9 && for f in $ALL_TESTS ; \
do GSL_TEST_VERBOSE=1 eval $GSL_VV -v --trace-children=yes "$GSL_VFLAGS" ./$f ; done) &> out-V
echo " ... done"
echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)
echo -n " Native passes: " && (grep PASS: out-REF | wc -l)
echo -n " Valgrind fails: " && (grep FAIL: out-V | wc -l)
echo -n " Valgrind passes: " && (grep PASS: out-V | wc -l)
(echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)) >> summary.txt
(echo -n " Native passes: " && (grep PASS: out-REF | wc -l)) >> summary.txt
(echo -n " Valgrind fails: " && (grep FAIL: out-V | wc -l)) >> summary.txt
(echo -n " Valgrind passes: " && (grep PASS: out-V | wc -l)) >> summary.txt
echo >> summary.txt
echo
@@ -0,0 +1,478 @@
#!/usr/bin/env perl
#-----------------------------------------------------------------
# Quick and dirty script to summarize build information for a
# set of nightly runs.
#
# The results of the nighly regression runs are extracted from
# the GMANE mail archive. The URL for a given mail sent to the
# valgrind-developers mailing list is
#
# http://article.gmane.org/gmane.comp.debugging.valgrind.devel/<integer>
#
# The script extracts information about the regression run from a
# block of information at the beginning of the mail. That information
# was added beginning October 4, 2011. Therefore, only regression runs
# from that date or later can be analyzed.
#
# There is unfortunately no good way of figuring out the interval
# of integers in the above URL that include all nightly regression
# runs.
#
# The function get_regtest_data does all the work. It returns a hash
# whose keys are the dates at which nightly runs took place. The value
# is in turn a hash.
#
# Each such hash has the following keys:
# "builds" array of hashes
# "num_builds" int
# "num_failing_builds" int
# "num_passing_builds" int
# "num_testcase_failures" int
# "num_failing_testcases" int
# "failure_frequency" hash indexed by testcase name; value = int
#
# "builds" is an array of hashes with the following keys
# "arch" string (architecture)
# "distro" string (distribution, e.g. Fedora-15)
# "failures" array of strings (failing testcases)
# "valgrind revision" integer
# "VEX revision" integer
# "GCC version" string
# "C library" string
# "uname -mrs" string
# "Vendor version" string
#
#-----------------------------------------------------------------
use strict;
use warnings;
use LWP::Simple;
use Getopt::Long;
my $prog_name = "nightly-build-summary";
my $debug = 0;
my $keep = 0;
my $usage=<<EOF;
USAGE
$prog_name
--from=INTEGER beginning of mail interval; > 14800
[--to=INTEGER] end of mail interval; default = from + 100
[--debug] verbose mode (debugging)
[--keep] write individual emails to files (debugging)
[--dump] write results suitable for post-processing
[--readable] write results in human readable form (default)
EOF
#-----------------------------------------------------------------
# Search for a line indicating that this is an email containing
# the results of a valgrind regression run.
# Return 1, if found and 0 oherwise.
#-----------------------------------------------------------------
sub is_regtest_result {
my (@lines) = @_;
foreach my $line (@lines) {
return 1 if ($line =~ "^valgrind revision:");
}
return 0;
}
#-----------------------------------------------------------------
# Extract information from the run. Don't prep the data here. This
# is done later on.
#-----------------------------------------------------------------
sub get_raw_data {
my (@lines, $msgno) = @_;
my ($i, $n, $line, $date);
$n = scalar @lines;
my %hash = ();
# 1) Locate the section with the info about the environment of this nightly run
for ($i = 0; $i < $n; ++$i) {
last if ($lines[$i] =~ /^valgrind revision:/);
}
die "no info block in message $msgno" if ($i == $n);
# 2) Read the info about the build: compiler, valgrind revision etc.
# and put it into a hash.
for ( ; $i < $n; ++$i) {
$line = $lines[$i];
last if ($line =~ /^$/); # empty line indicates end of section
my ($key, $value) = split(/:/, $line);
$value =~ s/^[ ]*//; # removing leading blanks
$hash{$key} = $value;
}
if ($debug) {
foreach my $key (keys %hash) {
my ($val) = $hash{$key};
print "regtest env: KEY = |$key| VAL = |$val|\n";
}
}
# 3) Get the date from when the build was kicked off.
for ( ; $i < $n; ++$i) {
$line = $lines[$i];
if ($line =~ /^Started at[ ]+([^ ]+)/) {
$date = $1;
print "DATE = $date\n";
last;
}
}
die "no date found in message $msgno" if ($i == $n);
# 4) Find out if the regression run failed or passed
$hash{"failures"} = [];
for ($i = $i + 1; $i < $n; ++$i) {
$line = $lines[$i];
if ($line =~ /Running regression tests/) {
return %hash if ($line =~ /done$/); # regtest succeeded; no failures
die "cannot determine regtest outcome for message $msgno"
if (! ($line =~ /failed$/));
last;
}
}
# 5) Regtest failed; locate the section with the list of failing testcases
for ($i = $i + 1; $i < $n; ++$i) {
$line = $lines[$i];
# Match for end-of-line == because line might be split.
last if ($line =~ /==$/);
}
die "cannot locate failing testcases in message $msgno" if ($i == $n);
# 6) Get list of failing testcases
for ($i = $i + 1; $i < $n; ++$i) {
$line = $lines[$i];
last if ($line =~ /^$/);
my ($testcase) = (split(/\s+/, $line))[0];
print "ADD failing testcase $testcase\n" if ($debug);
push @{$hash{"failures"}}, $testcase;
}
return ($date, %hash);
}
#-----------------------------------------------------------------
# Extract architecture; get a pretty name for the distro
#-----------------------------------------------------------------
sub prep_regtest_data {
my (%hash) = @_;
my ($val, $arch, $distro);
$val = $hash{"uname -mrs"};
die "uname -mrs info is missing" if (! defined $val);
$arch = (split(/ /, $val))[2];
$val = $hash{"Vendor version"};
die "Vendor version info is missing" if (! defined $val);
if ($val =~ /Fedora release ([0-9]+)/) {
$distro = "Fedora-$1";
} elsif ($val =~ /openSUSE ([0-9]+)\.([0-9]+)/) {
$distro = "openSUSE-$1.$2";
} elsif ($val =~ /SUSE Linux Enterprise Server 11 SP1/) {
$distro = "SLES-11-SP1";
} elsif ($val =~ /Red Hat Enterprise Linux AS release 4/) {
$distro = "RHEL-4";
} else {
$distro = "UNKNOWN";
}
# Add architecture and distribution to hash
$hash{"arch"} = $arch;
$hash{"distro"} = $distro;
return %hash;
}
#-----------------------------------------------------------------
# Precompute some summary information and record it
#-----------------------------------------------------------------
sub precompute_summary_info
{
my (%dates) = @_;
foreach my $date (sort keys %dates) {
my %failure_frequency = ();
my %nightly = %{ $dates{$date} };
my @builds = @{ $nightly{"builds"} };
$nightly{"num_builds"} = scalar (@builds);
$nightly{"num_failing_builds"} = 0;
$nightly{"num_testcase_failures"} = 0;
foreach my $build (@builds) {
my %regtest_data = %{ $build };
my @failures = @{ $regtest_data{"failures"} };
my $num_fail = scalar (@failures);
++$nightly{"num_failing_builds"} if ($num_fail != 0);
$nightly{"num_testcase_failures"} += $num_fail;
# Compute how often a testcase failed
foreach my $test ( @failures ) {
if (defined $failure_frequency{$test}) {
++$failure_frequency{$test};
} else {
$failure_frequency{$test} = 1;
}
}
}
$nightly{"num_passing_builds"} =
$nightly{"num_builds"} - $nightly{"num_failing_builds"};
$nightly{"num_failing_testcases"} = scalar (keys %failure_frequency);
$nightly{"failure_frequency"} = { %failure_frequency };
$dates{$date} = { %nightly };
}
return %dates;
}
#-----------------------------------------------------------------
# Get messages from GMANE, and build up a database of results.
#-----------------------------------------------------------------
sub get_regtest_data {
my ($from, $to) = @_;
my $url_base = "http://article.gmane.org/gmane.comp.debugging.valgrind.devel/";
my %dates = ();
my $old_date = "-1";
my @builds = ();
for (my $i = $from; $i <= $to; ++$i) {
my $url = "$url_base" . "$i";
my $page = get("$url");
if ($keep) {
open (EMAIL, ">$i");
print EMAIL $page;
close(EMAIL);
}
# Detect if the article does not exist. Happens for too large --to= values
last if ($page eq "No such file.\n");
# Split the page into lines
my @lines = split(/\n/, $page);
# Check whether it contains a regression test result
next if (! is_regtest_result(@lines));
print "message $i is a regression test result\n" if ($debug);
# Get the raw data
my ($date, %regtest_data) = get_raw_data(@lines);
%regtest_data = prep_regtest_data(%regtest_data);
if ($date ne $old_date) {
my %nightly = ();
$nightly{"builds"} = [ @builds ];
$dates{$old_date} = { %nightly } if ($old_date ne "-1");
$old_date = $date;
@builds = ();
}
push @builds, { %regtest_data };
}
my %nightly = ();
$nightly{"builds"} = [ @builds ];
$dates{$old_date} = { %nightly } if ($old_date ne "-1");
# Convenience: precompute some info we'll be interested in
%dates = precompute_summary_info( %dates );
return %dates;
}
#-----------------------------------------------------------------
# Write out the results in a form suitable for automatic post-processing
#-----------------------------------------------------------------
sub dump_results {
my (%dates) = @_;
foreach my $date (sort keys %dates) {
my %nightly = %{ $dates{$date} };
my @builds = @{ $nightly{"builds"} };
foreach my $build (@builds) {
my %regtest_data = %{ $build };
my $arch = $regtest_data{"arch"};
my $distro = $regtest_data{"distro"};
my @failures = @{ $regtest_data{"failures"} };
my $num_fail = scalar (@failures);
my $fails = join(":", sort @failures);
printf("Regrun: %s %3d %-10s %-20s %s\n",
$date, $num_fail, $arch, $distro, $fails);
}
my %failure_frequency = %{ $nightly{"failure_frequency"} };
foreach my $test (keys %failure_frequency) {
printf("Test: %s %3d %s\n",
$date, $failure_frequency{$test}, $test);
}
printf("Total: %s builds: %d %d fail %d pass tests: %d fail %d unique\n",
$date, $nightly{"num_builds"}, $nightly{"num_failing_builds"},
$nightly{"num_passing_builds"}, $nightly{"num_testcase_failures"},
$nightly{"num_failing_testcases"});
}
}
sub write_readable_results {
my (%dates) = @_;
foreach my $date (sort keys %dates) {
my %nightly = %{ $dates{$date} };
print "$date\n----------\n";
printf("%3d builds\n", $nightly{"num_builds"});
printf("%3d builds fail\n", $nightly{"num_failing_builds"});
printf("%3d builds pass\n", $nightly{"num_passing_builds"});
print "\n";
printf("%3d testcase failures (across all runs)\n",
$nightly{"num_testcase_failures"});
printf("%3d failing testcases (unique)\n",
$nightly{"num_failing_testcases"});
print "\n";
my @builds = @{ $nightly{"builds"} };
if ($nightly{"num_passing_builds"} != 0) {
print "Passing builds\n";
print "--------------\n";
foreach my $build (@builds) {
my %regtest_data = %{ $build };
my @failures = @{ $regtest_data{"failures"} };
my $num_fail = scalar (@failures);
if ($num_fail == 0) {
my $arch = $regtest_data{"arch"};
my $distro = $regtest_data{"distro"};
printf("%-8s %-15s\n", $arch, $distro);
}
print "\n";
}
print "\n";
}
if ($nightly{"num_failing_builds"} != 0) {
print "Failing builds\n";
print "--------------\n";
foreach my $build (@builds) {
my %regtest_data = %{ $build };
my @failures = @{ $regtest_data{"failures"} };
my $num_fail = scalar (@failures);
if ($num_fail != 0) {
my $arch = $regtest_data{"arch"};
my $distro = $regtest_data{"distro"};
printf("%-8s %-15s %d failures\n", $arch, $distro, $num_fail);
foreach my $test (@failures) {
print " $test\n";
}
print "\n";
}
}
print "\n";
}
print "Failing testcases and their frequency\n";
print "-------------------------------------\n";
my %failure_frequency = %{ $nightly{"failure_frequency"} };
# Sorted in decreasing frequency
foreach my $test (sort {$failure_frequency{$b} cmp $failure_frequency{$a} }
keys %failure_frequency) {
printf("%3d %s\n", $failure_frequency{$test}, $test);
}
print "\n";
}
}
sub main
{
my ($from, $to, $dump, $readable);
$from = $to = 0;
$dump = $readable = 0;
GetOptions( "from=i" => \$from,
"to=i" => \$to,
"debug" => \$debug,
"dump" => \$dump,
"keep" => \$keep,
"readable" => \$readable
) || die $usage;
# 14800 is about Oct 4, 2011 which is when we began including information
# about the environment
die $usage if ($from < 14800);
$to = $from + 100 if ($to == 0);
if ($from > $to) {
print STDERR "*** invalid [from,to] interval. Try again\n";
die $usage;
}
$readable = 1 if ($dump == 0 && $readable == 0);
print "check message interval [$from...$to]\n" if ($debug);
# Get mails from GMANE mail archive
my %dates = get_regtest_data($from, $to);
dump_results(%dates) if ($dump);
write_readable_results(%dates) if ($readable);
}
main();
exit 0;
@@ -0,0 +1,21 @@
#!/bin/sh
usage()
{
cat <<EOF
Usage: $0 result_file_1 result_file_2
EOF
}
if [ $# != 2 ]; then
usage;
exit 1;
else
echo $1 $2;
rm -f tmptmp_1 tmptmp_2;
grep -v GRIND= $1 > tmptmp_1;
grep -v GRIND= $2 > tmptmp_2;
diff -U2 tmptmp_1 tmptmp_2;
fi
@@ -0,0 +1,149 @@
Only in posixtestsuite/conformance/interfaces/pthread_spin_lock: 1-1
diff -U3 -r posixtestsuite.orig/conformance/interfaces/pthread_spin_lock/1-1.c posixtestsuite/conformance/interfaces/pthread_spin_lock/1-1.c
--- posixtestsuite.orig/conformance/interfaces/pthread_spin_lock/1-1.c 2003-07-10 02:19:34.000000000 +0100
+++ posixtestsuite/conformance/interfaces/pthread_spin_lock/1-1.c 2006-07-05 15:38:27.000000000 +0100
@@ -39,7 +39,8 @@
static void sig_handler()
{
/* Just return */
- pthread_exit(0);
+ /* pthread_exit(0); */
+ exit(0);
return;
}
diff -U3 -r posixtestsuite.orig/LDFLAGS posixtestsuite/LDFLAGS
--- posixtestsuite.orig/LDFLAGS 2005-06-03 02:32:42.000000000 +0100
+++ posixtestsuite/LDFLAGS 2006-07-05 13:03:09.000000000 +0100
@@ -8,7 +8,7 @@
#-lpthread -D_GNU_SOURCE
#
#Recommended flags:
-#-D_XOPEN_SOURCE=600 -lpthread -lrt -lm
+-D_XOPEN_SOURCE=600 -lpthread -lrt -lm
#
# For use with Linux, you may try the following flags to
# allow for the NPTL-specific compilation (used in some test cases)
diff -U3 -r posixtestsuite.orig/locate-test posixtestsuite/locate-test
--- posixtestsuite.orig/locate-test 2005-03-14 13:53:50.000000000 +0000
+++ posixtestsuite/locate-test 2006-07-05 13:16:52.000000000 +0100
@@ -60,19 +60,19 @@
shift;
;;
"--fmake")
- find functional/ -type f -maxdepth 2 -mindepth 2 -name "Makefile" -exec dirname '{}' ';'
+ find functional/ -maxdepth 2 -mindepth 2 -type f -name "Makefile" -exec dirname '{}' ';'
exit 0;
;;
"--frun")
- find functional/ -type f -maxdepth 2 -mindepth 2 -name "run.sh" -exec dirname '{}' ';'
+ find functional/ -maxdepth 2 -mindepth 2 -type f -name "run.sh" -exec dirname '{}' ';'
exit 0;
;;
"--smake")
- find stress/ -type f -maxdepth 2 -mindepth 2 -name "Makefile" -exec dirname '{}' ';'
+ find stress/ -maxdepth 2 -mindepth 2 -type f -name "Makefile" -exec dirname '{}' ';'
exit 0;
;;
"--srun")
- find stress/ -type f -maxdepth 2 -mindepth 2 -name "run.sh" -exec dirname '{}' ';'
+ find stress/ -maxdepth 2 -mindepth 2 -type f -name "run.sh" -exec dirname '{}' ';'
exit 0;
;;
"--help")
diff -U3 -r posixtestsuite.orig/Makefile posixtestsuite/Makefile
--- posixtestsuite.orig/Makefile 2005-03-14 13:53:41.000000000 +0000
+++ posixtestsuite/Makefile 2006-07-05 16:28:57.000000000 +0100
@@ -19,7 +19,7 @@
# Added tests timeout from Sebastien Decugis (http://nptl.bullopensource.org)
# Expiration delay is 120 seconds
-TIMEOUT_VAL = 120
+TIMEOUT_VAL = 15
# The following value is the shell return value of a timedout application.
# with the bash shell, the ret val of a killed application is 128 + signum
# and under Linux, SIGALRM=14, so we have (Linux+bash) 142.
@@ -99,7 +99,8 @@
%.run-test: %.test $(top_builddir)/t0
@COMPLOG=$(LOGFILE).$$$$; \
[ -f $< ] || exit 0; \
- $(TIMEOUT) $< > $$COMPLOG 2>&1; \
+ echo "$(@:.run-test=): GRIND=$(GRIND)" | tee -a $(LOGFILE); \
+ $(TIMEOUT) $(GRIND) $< > $$COMPLOG 2>&1; \
RESULT=$$?; \
if [ $$RESULT -eq 1 ]; \
then \
@@ -141,11 +142,12 @@
@echo Building timeout helper files; \
$(CC) -O2 -o $@ $< ; \
echo `$(top_builddir)/t0 0; echo $$?` > $(top_builddir)/t0.val
-
+
%.run-test: %.sh $(top_builddir)/t0
@COMPLOG=$(LOGFILE).$$$$; \
+ echo "$(@:.run-test=): GRIND=$(GRIND)" | tee -a $(LOGFILE); \
chmod +x $<; \
- $(TIMEOUT) $< > $$COMPLOG 2>&1; \
+ $(TIMEOUT) $(GRIND) $< > $$COMPLOG 2>&1; \
RESULT=$$?; \
if [ $$RESULT -eq 0 ]; \
then \
diff -U3 -r posixtestsuite.orig/run_tests posixtestsuite/run_tests
--- posixtestsuite.orig/run_tests 2004-12-16 09:56:18.000000000 +0000
+++ posixtestsuite/run_tests 2006-07-05 19:06:48.000000000 +0100
@@ -12,11 +12,14 @@
usage()
{
cat <<EOF
-Usage: $0 [AIO|MEM|MSG|SEM|SIG|THR|TMR|TPS]
+Usage: $0 [AIO|MEM|MSG|SEM|SIG|THR|TMR|TPS |ALL]
Build and run the tests for POSIX area specified by the 3 letter tag
in the POSIX spec
+Optionally, set env variable GRIND to be the Valgrind and args used
+to run the tests (eg, GRIND="vTRUNK --tool=none").
+
EOF
}
@@ -64,6 +67,39 @@
runtests "$BASEDIR/m*map"
runtests "$BASEDIR/shm_*"
;;
+
+
+ ALL) echo "Executing all tests"
+ echo "Executing asynchronous I/O tests"
+ runtests "$BASEDIR/aio_*"
+ runtests "$BASEDIR/lio_listio"
+ echo "Executing signals tests"
+ runtests "$BASEDIR/sig*"
+ runtests $BASEDIR/raise
+ runtests $BASEDIR/kill
+ runtests $BASEDIR/killpg
+ runtests $BASEDIR/pthread_kill
+ runtests $BASEDIR/pthread_sigmask
+ echo "Executing semaphores tests"
+ runtests "$BASEDIR/sem*"
+ echo "Executing threads tests"
+ runtests "$BASEDIR/pthread_*"
+ echo "Executing timers and clocks tests"
+ runtests "$BASEDIR/time*"
+ runtests "$BASEDIR/*time"
+ runtests "$BASEDIR/clock*"
+ runtests $BASEDIR/nanosleep
+ echo "Executing message queues tests"
+ runtests "$BASEDIR/mq_*"
+ echo "Executing process and thread scheduling tests"
+ runtests "$BASEDIR/*sched*"
+ echo "Executing mapped, process and shared memory tests"
+ runtests "$BASEDIR/m*lock*"
+ runtests "$BASEDIR/m*map"
+ runtests "$BASEDIR/shm_*"
+ ;;
+
+
*) usage
exit 1
;;
@@ -0,0 +1,543 @@
#include <stdio.h>
typedef unsigned long long int ULong;
/* ------------------------ SRADI ------------------------ */
#define INSN_SRADI(nnn) \
void do_sradi_##nnn ( ULong arg, /*OUT*/ULong* res, /*OUT*/ULong* xer ) \
{ \
ULong argW = arg; \
ULong resW = 0; \
ULong xerW = 0; \
__asm__ __volatile__( \
"sradi %0,%2, " #nnn "\n\t" \
"mfxer %1" \
: /*out*/ "=b"(resW), "=b"(xerW) \
: /*in*/ "b"(argW) \
: /*trash*/ "cc" \
); \
*res = resW; \
*xer = xerW; \
}
INSN_SRADI(0)
INSN_SRADI(1)
INSN_SRADI(2)
INSN_SRADI(3)
INSN_SRADI(4)
INSN_SRADI(5)
INSN_SRADI(6)
INSN_SRADI(7)
INSN_SRADI(8)
INSN_SRADI(9)
INSN_SRADI(10)
INSN_SRADI(11)
INSN_SRADI(12)
INSN_SRADI(13)
INSN_SRADI(14)
INSN_SRADI(15)
INSN_SRADI(16)
INSN_SRADI(17)
INSN_SRADI(18)
INSN_SRADI(19)
INSN_SRADI(20)
INSN_SRADI(21)
INSN_SRADI(22)
INSN_SRADI(23)
INSN_SRADI(24)
INSN_SRADI(25)
INSN_SRADI(26)
INSN_SRADI(27)
INSN_SRADI(28)
INSN_SRADI(29)
INSN_SRADI(30)
INSN_SRADI(31)
INSN_SRADI(32)
INSN_SRADI(33)
INSN_SRADI(34)
INSN_SRADI(35)
INSN_SRADI(36)
INSN_SRADI(37)
INSN_SRADI(38)
INSN_SRADI(39)
INSN_SRADI(40)
INSN_SRADI(41)
INSN_SRADI(42)
INSN_SRADI(43)
INSN_SRADI(44)
INSN_SRADI(45)
INSN_SRADI(46)
INSN_SRADI(47)
INSN_SRADI(48)
INSN_SRADI(49)
INSN_SRADI(50)
INSN_SRADI(51)
INSN_SRADI(52)
INSN_SRADI(53)
INSN_SRADI(54)
INSN_SRADI(55)
INSN_SRADI(56)
INSN_SRADI(57)
INSN_SRADI(58)
INSN_SRADI(59)
INSN_SRADI(60)
INSN_SRADI(61)
INSN_SRADI(62)
INSN_SRADI(63)
static void* all_sradi[64]
= {
(void*)&do_sradi_0,
(void*)&do_sradi_1,
(void*)&do_sradi_2,
(void*)&do_sradi_3,
(void*)&do_sradi_4,
(void*)&do_sradi_5,
(void*)&do_sradi_6,
(void*)&do_sradi_7,
(void*)&do_sradi_8,
(void*)&do_sradi_9,
(void*)&do_sradi_10,
(void*)&do_sradi_11,
(void*)&do_sradi_12,
(void*)&do_sradi_13,
(void*)&do_sradi_14,
(void*)&do_sradi_15,
(void*)&do_sradi_16,
(void*)&do_sradi_17,
(void*)&do_sradi_18,
(void*)&do_sradi_19,
(void*)&do_sradi_20,
(void*)&do_sradi_21,
(void*)&do_sradi_22,
(void*)&do_sradi_23,
(void*)&do_sradi_24,
(void*)&do_sradi_25,
(void*)&do_sradi_26,
(void*)&do_sradi_27,
(void*)&do_sradi_28,
(void*)&do_sradi_29,
(void*)&do_sradi_30,
(void*)&do_sradi_31,
(void*)&do_sradi_32,
(void*)&do_sradi_33,
(void*)&do_sradi_34,
(void*)&do_sradi_35,
(void*)&do_sradi_36,
(void*)&do_sradi_37,
(void*)&do_sradi_38,
(void*)&do_sradi_39,
(void*)&do_sradi_40,
(void*)&do_sradi_41,
(void*)&do_sradi_42,
(void*)&do_sradi_43,
(void*)&do_sradi_44,
(void*)&do_sradi_45,
(void*)&do_sradi_46,
(void*)&do_sradi_47,
(void*)&do_sradi_48,
(void*)&do_sradi_49,
(void*)&do_sradi_50,
(void*)&do_sradi_51,
(void*)&do_sradi_52,
(void*)&do_sradi_53,
(void*)&do_sradi_54,
(void*)&do_sradi_55,
(void*)&do_sradi_56,
(void*)&do_sradi_57,
(void*)&do_sradi_58,
(void*)&do_sradi_59,
(void*)&do_sradi_60,
(void*)&do_sradi_61,
(void*)&do_sradi_62,
(void*)&do_sradi_63
};
/* ------------------------ SRAWI ------------------------ */
#define INSN_SRAWI(nnn) \
void do_srawi_##nnn ( ULong arg, /*OUT*/ULong* res, /*OUT*/ULong* xer ) \
{ \
ULong argW = arg; \
ULong resW = 0; \
ULong xerW = 0; \
__asm__ __volatile__( \
"srawi %0,%2, " #nnn "\n\t" \
"mfxer %1" \
: /*out*/ "=b"(resW), "=b"(xerW) \
: /*in*/ "b"(argW) \
: /*trash*/ "cc" \
); \
*res = resW; \
*xer = xerW; \
}
INSN_SRAWI(0)
INSN_SRAWI(1)
INSN_SRAWI(2)
INSN_SRAWI(3)
INSN_SRAWI(4)
INSN_SRAWI(5)
INSN_SRAWI(6)
INSN_SRAWI(7)
INSN_SRAWI(8)
INSN_SRAWI(9)
INSN_SRAWI(10)
INSN_SRAWI(11)
INSN_SRAWI(12)
INSN_SRAWI(13)
INSN_SRAWI(14)
INSN_SRAWI(15)
INSN_SRAWI(16)
INSN_SRAWI(17)
INSN_SRAWI(18)
INSN_SRAWI(19)
INSN_SRAWI(20)
INSN_SRAWI(21)
INSN_SRAWI(22)
INSN_SRAWI(23)
INSN_SRAWI(24)
INSN_SRAWI(25)
INSN_SRAWI(26)
INSN_SRAWI(27)
INSN_SRAWI(28)
INSN_SRAWI(29)
INSN_SRAWI(30)
INSN_SRAWI(31)
static void* all_srawi[32]
= {
(void*)&do_srawi_0,
(void*)&do_srawi_1,
(void*)&do_srawi_2,
(void*)&do_srawi_3,
(void*)&do_srawi_4,
(void*)&do_srawi_5,
(void*)&do_srawi_6,
(void*)&do_srawi_7,
(void*)&do_srawi_8,
(void*)&do_srawi_9,
(void*)&do_srawi_10,
(void*)&do_srawi_11,
(void*)&do_srawi_12,
(void*)&do_srawi_13,
(void*)&do_srawi_14,
(void*)&do_srawi_15,
(void*)&do_srawi_16,
(void*)&do_srawi_17,
(void*)&do_srawi_18,
(void*)&do_srawi_19,
(void*)&do_srawi_20,
(void*)&do_srawi_21,
(void*)&do_srawi_22,
(void*)&do_srawi_23,
(void*)&do_srawi_24,
(void*)&do_srawi_25,
(void*)&do_srawi_26,
(void*)&do_srawi_27,
(void*)&do_srawi_28,
(void*)&do_srawi_29,
(void*)&do_srawi_30,
(void*)&do_srawi_31
};
/* ------------------------ SRAD ------------------------ */
void do_srad ( ULong arg1, ULong arg2,
/*OUT*/ULong* res, /*OUT*/ULong* xer )
{
ULong arg1W = arg1;
ULong arg2W = arg2;
ULong resW = 0;
ULong xerW = 0;
__asm__ __volatile__(
"srad %0,%2,%3\n\t"
"mfxer %1"
: /*out*/ "=b"(resW), "=b"(xerW)
: /*in*/ "b"(arg1W), "b"(arg2W)
: /*trash*/ "cc"
);
*res = resW;
*xer = xerW;
}
/* ------------------------ SRAW ------------------------ */
void do_sraw ( ULong arg1, ULong arg2,
/*OUT*/ULong* res, /*OUT*/ULong* xer )
{
ULong arg1W = arg1;
ULong arg2W = arg2;
ULong resW = 0;
ULong xerW = 0;
__asm__ __volatile__(
"sraw %0,%2,%3\n\t"
"mfxer %1"
: /*out*/ "=b"(resW), "=b"(xerW)
: /*in*/ "b"(arg1W), "b"(arg2W)
: /*trash*/ "cc"
);
*res = resW;
*xer = xerW;
}
/* ------------------------ SRD ------------------------ */
void do_srd ( ULong arg1, ULong arg2,
/*OUT*/ULong* res, /*OUT*/ULong* xer )
{
ULong arg1W = arg1;
ULong arg2W = arg2;
ULong resW = 0;
ULong xerW = 0;
__asm__ __volatile__(
"srd %0,%2,%3\n\t"
"mfxer %1"
: /*out*/ "=b"(resW), "=b"(xerW)
: /*in*/ "b"(arg1W), "b"(arg2W)
: /*trash*/ "cc"
);
*res = resW;
*xer = xerW;
}
/* ------------------------ SRW ------------------------ */
void do_srw ( ULong arg1, ULong arg2,
/*OUT*/ULong* res, /*OUT*/ULong* xer )
{
ULong arg1W = arg1;
ULong arg2W = arg2;
ULong resW = 0;
ULong xerW = 0;
__asm__ __volatile__(
"srw %0,%2,%3\n\t"
"mfxer %1"
: /*out*/ "=b"(resW), "=b"(xerW)
: /*in*/ "b"(arg1W), "b"(arg2W)
: /*trash*/ "cc"
);
*res = resW;
*xer = xerW;
}
/* ------------------------ SLD ------------------------ */
void do_sld ( ULong arg1, ULong arg2,
/*OUT*/ULong* res, /*OUT*/ULong* xer )
{
ULong arg1W = arg1;
ULong arg2W = arg2;
ULong resW = 0;
ULong xerW = 0;
__asm__ __volatile__(
"sld %0,%2,%3\n\t"
"mfxer %1"
: /*out*/ "=b"(resW), "=b"(xerW)
: /*in*/ "b"(arg1W), "b"(arg2W)
: /*trash*/ "cc"
);
*res = resW;
*xer = xerW;
}
/* ------------------------ SLW ------------------------ */
void do_slw ( ULong arg1, ULong arg2,
/*OUT*/ULong* res, /*OUT*/ULong* xer )
{
ULong arg1W = arg1;
ULong arg2W = arg2;
ULong resW = 0;
ULong xerW = 0;
__asm__ __volatile__(
"slw %0,%2,%3\n\t"
"mfxer %1"
: /*out*/ "=b"(resW), "=b"(xerW)
: /*in*/ "b"(arg1W), "b"(arg2W)
: /*trash*/ "cc"
);
*res = resW;
*xer = xerW;
}
/* ------------------------ ------------------------ */
/* ------------------------ ------------------------ */
/* ------------------------ ------------------------ */
#define N_ARGS64 41
ULong args64[N_ARGS64] = {
0x0000000000000000ULL,
0x0000000000000001ULL,
0x0000000031415927ULL,
0x000000007FFFFFFFULL,
0x0000000080000000ULL,
0x00000000FFFFFFFFULL,
0x0000000100000000ULL,
0x3141592700000000ULL,
0x7FFFFFFF00000000ULL,
0x8000000000000000ULL,
0xFFFFFFFF00000000ULL,
0x7FFFFFFF00000001ULL,
0x7FFFFFFF31415927ULL,
0x7FFFFFFF7FFFFFFFULL,
0x7FFFFFFF80000000ULL,
0x7FFFFFFFFFFFFFFFULL,
0x000000017FFFFFFFULL,
0x314159277FFFFFFFULL,
0x7FFFFFFF7FFFFFFFULL,
0x800000007FFFFFFFULL,
0xFFFFFFFF7FFFFFFFULL,
0x8000000000000001ULL,
0x8000000031415927ULL,
0x800000007FFFFFFFULL,
0x8000000080000000ULL,
0x80000000FFFFFFFFULL,
0x0000000180000000ULL,
0x3141592780000000ULL,
0x7FFFFFFF80000000ULL,
0x8000000080000000ULL,
0xFFFFFFFF80000000ULL,
0xFFFFFFFF00000001ULL,
0xFFFFFFFF31415927ULL,
0xFFFFFFFF7FFFFFFFULL,
0xFFFFFFFF80000000ULL,
0xFFFFFFFFFFFFFFFFULL,
0x00000001FFFFFFFFULL,
0x31415927FFFFFFFFULL,
0x7FFFFFFFFFFFFFFFULL,
0x80000000FFFFFFFFULL,
0xFFFFFFFFFFFFFFFFULL
};
void do_unary ( char* name, void** fns, int n_fns )
{
int i, j;
ULong arg, res, xer;
void(*fn)(ULong,ULong*,ULong*);
for (i = 0; i < n_fns; i++) { /* shift */
for (j = 0; j < N_ARGS64; j++) { /* arg */
arg = args64[j];
res = xer = 0;
fn = fns[i];
fn( arg, &res, &xer );
printf("%5s(0x%016llx, %2d) = 0x%016llx, %d\n",
name, arg, (int)i, res, (int)((xer >> 29 & 1)));
}
}
}
void do_binary ( char* name, void* fnV )
{
int i, j;
ULong arg1, arg2, res, xer;
void(*fn)(ULong,ULong,ULong*,ULong*);
for (i = 0; i < 64+10; i++) { /* shift */
for (j = 0; j < N_ARGS64; j++) { /* arg */
arg1 = args64[j];
arg2 = i;
res = xer = 0;
fn = fnV;
fn( arg1, arg2, &res, &xer );
printf("%5s(0x%016llx, %2d) = 0x%016llx, %d\n",
name, arg1, (int)arg2, res, (int)((xer >> 29 & 1)));
}
}
}
int main ( void )
{
do_unary("sradi", all_sradi, 64);
do_unary("srawi", all_srawi, 32);
do_binary("srad", do_srad);
do_binary("sraw", do_sraw);
do_binary("srd", do_srd);
do_binary("srw", do_srw);
do_binary("sld", do_sld);
do_binary("slw", do_slw);
return 0;
}
/*
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
*/
@@ -0,0 +1,539 @@
#include <assert.h>
#include <stdio.h>
#include <malloc.h>
typedef unsigned int UInt;
typedef unsigned long long int ULong;
typedef
struct {
double fres;
UInt cr;
UInt fpscr;
}
Result;
static void set_NEAREST ( void ) {
__asm__ __volatile__("mtfsb0 30 ; mtfsb0 31");
}
static void set_ZERO ( void ) {
__asm__ __volatile__("mtfsb0 30 ; mtfsb1 31");
}
static void set_PosINF ( void ) {
__asm__ __volatile__("mtfsb1 30 ; mtfsb0 31");
}
static void set_NegINF ( void ) {
__asm__ __volatile__("mtfsb1 30 ; mtfsb1 31");
}
static ULong double_as_ULong ( double d )
{
union { double dd; ULong ll; } u;
assert(sizeof(u) == 8);
u.dd = d;
return u.ll;
}
static ULong round_with_mask ( ULong x, ULong mask )
{
if (mask == 1) {
switch (x & 1) {
case 0: return x;
case 1: return x+1;
}
assert(0);
}
if (mask == 3) {
switch (x & 3) {
case 0: return x;
case 1: return x-1;
case 2: return x+2;
case 3: return x+1;
}
assert(0);
}
if (mask == 7) {
switch (x & 7) {
case 0: return x;
case 1: return x-1;
case 2: return x-2;
case 3: return x-3;
case 4: return x+4;
case 5: return x+3;
case 6: return x+2;
case 7: return x+1;
}
assert(0);
}
if (mask == 15) {
switch (x & 15) {
case 0: return x;
case 1: return x-1;
case 2: return x-2;
case 3: return x-3;
case 4: return x-4;
case 5: return x-5;
case 6: return x-6;
case 7: return x-7;
case 8: return x+8;
case 9: return x+7;
case 10: return x+6;
case 11: return x+5;
case 12: return x+4;
case 13: return x+3;
case 14: return x+2;
case 15: return x+1;
}
assert(0);
}
assert(0);
}
static void showResult ( Result r, ULong hideMask )
{
/* hidemask should have 1 for every result bit we **don't**
want to show. viz should be all zeroes normally. */
#if 0
printf("(%016llx cr1 0x%01x fprf 0x%02x)",
double_as_ULong(r.fres) & ~hidemask,
(r.cr >> 24) & 0xF, (r.fpscr >> 12) & 0x1F);
#else
printf("(%016llx cr1 ... fprf ...)",
(hideMask == 0x1 || hideMask == 0x3 || hideMask == 0x7)
? round_with_mask( double_as_ULong(r.fres), hideMask )
: double_as_ULong(r.fres) & ~hideMask
);
#endif
}
/* Give an insn string such as "fmadd %%f4, %%f1,%%f2,%%f3". Args are
in f1, f2, f3, and result should go in f4. */
#define INSN(name,insn) \
\
static Result insn_##name ( double arg1, double arg2, double arg3 ) \
{ \
struct { \
/* 0 */ double a1; \
/* 8 */ double a2; \
/* 16 */ double a3; \
/* 24 */ double res; \
/* 32 */ UInt fpscr_after; \
/* 36 */ UInt cr_after; \
} foo; \
assert(sizeof(foo) == 40); \
foo.a1 = foo.a2 = foo.a3 = foo.res = 0; \
foo.fpscr_after = foo.cr_after = 0; \
foo.a1 = arg1; \
foo.a2 = arg2; \
foo.a3 = arg3; \
__asm__ __volatile__( \
"lfd %%f1, 0(%0)\n\t" /* a1 */ \
"lfd %%f2, 8(%0)\n\t" /* a2 */ \
"lfd %%f3, 16(%0)\n\t" /* a3 */ \
insn "\n\t" \
"stfd %%f4, 24(%0)\n\t" /* res */ \
"mffs %%f4\n\t" \
"addi %0,%0,32\n\t" \
"stfiwx %%f4, %%r0,%0\n\t" /* fpscr_after. r0 reads as zero */ \
"addi %0,%0,-32\n\t" \
"mfcr %%r31\n\t" \
"stw %%r31, 36(%0)" /* cr_after */ \
: /*out*/ \
: /*in*/ "b" (&foo.a1) \
: /*trash*/ "memory","cc", "fr1","fr2","fr3","fr4", "r31" \
); \
{ Result result; \
result.fres = foo.res; \
result.cr = foo.cr_after; \
result.fpscr = foo.fpscr_after; \
return result; \
} \
}
INSN(fabs, "fabs %%f4, %%f1");
INSN(fabs_, "fabs. %%f4, %%f1");
INSN(fnabs, "fnabs %%f4, %%f1");
INSN(fnabs_, "fnabs. %%f4, %%f1");
INSN(fadd, "fadd %%f4, %%f1,%%f2");
INSN(fadd_, "fadd. %%f4, %%f1,%%f2");
INSN(fadds, "fadds %%f4, %%f1,%%f2");
INSN(fadds_, "fadds. %%f4, %%f1,%%f2");
INSN(fcfid, "fcfid %%f4, %%f1");
INSN(fcfid_, "fcfid. %%f4, %%f1");
INSN(fctid, "fctid %%f4, %%f1");
INSN(fctid_, "fctid. %%f4, %%f1");
INSN(fctidz, "fctidz %%f4, %%f1");
INSN(fctidz_, "fctidz. %%f4, %%f1");
INSN(fctiw, "fctiw %%f4, %%f1");
INSN(fctiw_, "fctiw. %%f4, %%f1");
INSN(fctiwz, "fctiwz %%f4, %%f1");
INSN(fctiwz_, "fctiwz. %%f4, %%f1");
INSN(fdiv, "fdiv %%f4, %%f1,%%f2");
INSN(fdiv_, "fdiv. %%f4, %%f1,%%f2");
INSN(fdivs, "fdivs %%f4, %%f1,%%f2");
INSN(fdivs_, "fdivs. %%f4, %%f1,%%f2");
INSN(fmadd, "fmadd %%f4, %%f1,%%f2,%%f3");
INSN(fmadd_, "fmadd. %%f4, %%f1,%%f2,%%f3");
INSN(fmadds, "fmadds %%f4, %%f1,%%f2,%%f3");
INSN(fmadds_, "fmadds. %%f4, %%f1,%%f2,%%f3");
INSN(fmr, "fmr %%f4, %%f1");
INSN(fmr_, "fmr. %%f4, %%f1");
INSN(fmsub, "fmsub %%f4, %%f1,%%f2,%%f3");
INSN(fmsub_, "fmsub. %%f4, %%f1,%%f2,%%f3");
INSN(fmsubs, "fmsubs %%f4, %%f1,%%f2,%%f3");
INSN(fmsubs_, "fmsubs. %%f4, %%f1,%%f2,%%f3");
INSN(fmul, "fmul %%f4, %%f1,%%f2");
INSN(fmul_, "fmul. %%f4, %%f1,%%f2");
INSN(fmuls, "fmuls %%f4, %%f1,%%f2");
INSN(fmuls_, "fmuls. %%f4, %%f1,%%f2");
INSN(fneg, "fneg %%f4, %%f1");
INSN(fneg_, "fneg. %%f4, %%f1");
INSN(fnmadd, "fnmadd %%f4, %%f1,%%f2,%%f3");
INSN(fnmadd_, "fnmadd. %%f4, %%f1,%%f2,%%f3");
INSN(fnmadds, "fnmadds %%f4, %%f1,%%f2,%%f3");
INSN(fnmadds_, "fnmadds. %%f4, %%f1,%%f2,%%f3");
INSN(fnmsub, "fnmsub %%f4, %%f1,%%f2,%%f3");
INSN(fnmsub_, "fnmsub. %%f4, %%f1,%%f2,%%f3");
INSN(fnmsubs, "fnmsubs %%f4, %%f1,%%f2,%%f3");
INSN(fnmsubs_, "fnmsubs. %%f4, %%f1,%%f2,%%f3");
INSN(fre, "fre %%f4, %%f1");
INSN(fre_, "fre. %%f4, %%f1");
INSN(fres, "fres %%f4, %%f1");
INSN(fres_, "fres. %%f4, %%f1");
INSN(frsqrte, "frsqrte %%f4, %%f1");
INSN(frsqrte_, "frsqrte. %%f4, %%f1");
//INSN(frsqrtes, "frsqrtes %%f4, %%f1");
//INSN(frsqrtes_, "frsqrtes. %%f4, %%f1");
INSN(frsp, "frsp %%f4, %%f1");
INSN(frsp_, "frsp. %%f4, %%f1");
INSN(fsel, "fsel %%f4, %%f1,%%f2,%%f3");
INSN(fsel_, "fsel. %%f4, %%f1,%%f2,%%f3");
INSN(fsqrt, "fsqrt %%f4, %%f1");
INSN(fsqrt_, "fsqrt. %%f4, %%f1");
INSN(fsqrts, "fsqrts %%f4, %%f1");
INSN(fsqrts_, "fsqrts. %%f4, %%f1");
INSN(fsub, "fsub %%f4, %%f1,%%f2");
INSN(fsub_, "fsub. %%f4, %%f1,%%f2");
INSN(fsubs, "fsubs %%f4, %%f1,%%f2");
INSN(fsubs_, "fsubs. %%f4, %%f1,%%f2");
void do_1_unary ( char* name,
Result(*f)(double,double,double),
double a1,
ULong hideMask )
{
Result r;
printf("%8s: %016llx (%e)\n", name, double_as_ULong(a1), a1);
set_NEAREST();
r = f(a1, 0.0,0.0);
printf(" near "); showResult(r,hideMask); printf("\n");
set_ZERO();
r = f(a1, 0.0,0.0);
printf(" zero "); showResult(r,hideMask); printf("\n");
set_PosINF();
r = f(a1, 0.0,0.0);
printf(" +inf "); showResult(r,hideMask); printf("\n");
set_NegINF();
r = f(a1, 0.0,0.0);
printf(" -inf "); showResult(r,hideMask); printf("\n");
}
void do_1_binary ( char* name,
Result(*f)(double,double,double),
double a1, double a2,
ULong hideMask )
{
Result r;
printf("%8s: %016llx %016llx\n", name, double_as_ULong(a1),
double_as_ULong(a2));
set_NEAREST();
r = f(a1,a2, 0.0);
printf(" near "); showResult(r,hideMask); printf("\n");
set_ZERO();
r = f(a1,a2, 0.0);
printf(" zero "); showResult(r,hideMask); printf("\n");
set_PosINF();
r = f(a1,a2, 0.0);
printf(" +inf "); showResult(r,hideMask); printf("\n");
set_NegINF();
r = f(a1,a2, 0.0);
printf(" -inf "); showResult(r,hideMask); printf("\n");
}
void do_1_ternary ( char* name,
Result(*f)(double,double,double),
double a1, double a2, double a3,
ULong hideMask )
{
Result r;
printf("%8s: %016llx %016llx %016llx\n",
name, double_as_ULong(a1),
double_as_ULong(a2), double_as_ULong(a3));
set_NEAREST();
r = f(a1,a2,a3);
printf(" near "); showResult(r,hideMask); printf("\n");
set_ZERO();
r = f(a1,a2,a3);
printf(" zero "); showResult(r,hideMask); printf("\n");
set_PosINF();
r = f(a1,a2,a3);
printf(" +inf "); showResult(r,hideMask); printf("\n");
set_NegINF();
r = f(a1,a2,a3);
printf(" -inf "); showResult(r,hideMask); printf("\n");
}
void do_N_unary ( char* name,
Result(*f)(double,double,double),
double* args,
int nargs,
ULong hideMask )
{
int i;
for (i = 0; i < nargs; i++) {
do_1_unary( name, f, args[i], hideMask );
}
}
void do_N_binary ( char* name,
Result(*f)(double,double,double),
double* args,
int nargs,
ULong hideMask )
{
int i, j;
for (i = 0; i < nargs; i++) {
for (j = 0; j < nargs; j++) {
do_1_binary( name, f, args[i], args[j], hideMask );
}
}
}
void do_N_ternary ( char* name,
Result(*f)(double,double,double),
double* args,
int nargs,
ULong hideMask )
{
int i, j, k;
for (i = 0; i < nargs; i++) {
for (j = 0; j < nargs; j++) {
for (k = 0; k < nargs; k++) {
do_1_ternary( name, f, args[i], args[j], args[k], hideMask );
}
}
}
}
int main ( void )
{
const ULong SHOW_ALL = 0;
int nargs = 21;
int nMacArgs = 11;
double* args = malloc(nargs * sizeof(double));
double* macArgs = malloc(nMacArgs * sizeof(double));
args[0] = 0.0;
args[1] = 1.0 / 0.0; // inf
args[2] = -args[1]; // -inf
args[3] = args[2]/args[2]; // nan
args[4] = -args[3]; // -nan
args[5] = -5e100;
args[6] = -5e20;
args[7] = -501.0;
args[8] = -6.0;
args[9] = -1.0;
args[10] = -2e-20;
args[11] = -2e-200;
args[12] = 2e-200;
args[13] = 2e-20;
args[14] = 1.0;
args[15] = 6.0;
args[16] = 501.0;
args[17] = 5e20;
args[18] = 5e100;
args[19] = 1.23e+5;
args[20] = 1.23e+14;
#if 0
macArgs[0] = 0.0;
macArgs[1] = -5e100;
macArgs[2] = -5e20;
macArgs[3] = -501.0;
macArgs[4] = -6.0;
macArgs[5] = -1.0;
macArgs[6] = -2e-20;
macArgs[7] = -2e-200;
macArgs[8] = 2e-200;
macArgs[9] = 2e-20;
macArgs[10] = 1.0;
macArgs[11] = 6.0;
macArgs[12] = 501.0;
macArgs[13] = 5e20;
macArgs[14] = 5e100;
macArgs[15] = 1.23e+5;
macArgs[16] = 1.23e+14;
//macArgs[17] = args[3]; // nan
//macArgs[18] = -args[3]; // -nan
#endif
macArgs[0] = 0.0;
macArgs[1] = 1.0;
macArgs[2] = 1.0 + (1.0/7.0);
macArgs[3] = 6.01;
macArgs[4] = 501.0;
macArgs[5] = 31415927.0;
macArgs[6] = - 1.0;
macArgs[7] = - (1.0 + (1.0/7.0));
macArgs[8] = - 6.01;
macArgs[9] = - 501.0;
macArgs[10] = - 31415927.0;
do_N_unary("fmr", insn_fmr, args, nargs, SHOW_ALL);
do_N_unary("fmr_", insn_fmr_, args, nargs, SHOW_ALL);
do_N_unary("fneg", insn_fneg, args, nargs, SHOW_ALL);
do_N_unary("fneg_", insn_fneg_, args, nargs, SHOW_ALL);
do_N_unary("fabs", insn_fabs, args, nargs, SHOW_ALL);
do_N_unary("fabs_", insn_fabs_, args, nargs, SHOW_ALL);
do_N_unary("fnabs", insn_fnabs, args, nargs, SHOW_ALL);
do_N_unary("fnabs_", insn_fnabs_, args, nargs, SHOW_ALL);
do_N_binary("fadd", insn_fadd, args, nargs, SHOW_ALL);
do_N_binary("fadd_", insn_fadd_, args, nargs, SHOW_ALL);
do_N_binary("fadds", insn_fadds, args, nargs, SHOW_ALL);
do_N_binary("fadds_", insn_fadds_, args, nargs, SHOW_ALL);
do_N_binary("fdiv", insn_fdiv, args, nargs, SHOW_ALL);
do_N_binary("fdiv_", insn_fdiv_, args, nargs, SHOW_ALL);
do_N_binary("fdivs", insn_fdivs, args, nargs, SHOW_ALL);
do_N_binary("fdivs_", insn_fdivs_, args, nargs, SHOW_ALL);
do_N_binary("fmul", insn_fmul, args, nargs, SHOW_ALL);
do_N_binary("fmul_", insn_fmul_, args, nargs, SHOW_ALL);
do_N_binary("fmuls", insn_fmuls, args, nargs, SHOW_ALL);
do_N_binary("fmuls_", insn_fmuls_, args, nargs, SHOW_ALL);
do_N_binary("fsub", insn_fsub, args, nargs, SHOW_ALL);
do_N_binary("fsub_", insn_fsub_, args, nargs, SHOW_ALL);
do_N_binary("fsubs", insn_fsubs, args, nargs, SHOW_ALL);
do_N_binary("fsubs_", insn_fsubs_, args, nargs, SHOW_ALL);
//do_N_unary(fcfid, SHOW_ALL);
//do_N_unary(fcfid_, SHOW_ALL);
//do_N_unary(fctid, SHOW_ALL);
//do_N_unary(fctid_, SHOW_ALL);
//do_N_unary(fctidz, SHOW_ALL);
//do_N_unary(fctidz_, SHOW_ALL);
do_N_unary("fctiw", insn_fctiw, args, nargs, 0xFFFFFFFF00000000ULL);
do_N_unary("fctiw_", insn_fctiw_, args, nargs, 0xFFFFFFFF00000000ULL);
do_N_unary("fctiwz", insn_fctiwz, args, nargs, 0xFFFFFFFF00000000ULL);
do_N_unary("fctiwz_", insn_fctiwz_, args, nargs, 0xFFFFFFFF00000000ULL);
do_N_ternary("fmadd", insn_fmadd, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fmadd_", insn_fmadd_, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fmadds", insn_fmadds, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fmadds_", insn_fmadds_, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fmsub", insn_fmsub, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fmsub_", insn_fmsub_, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fmsubs", insn_fmsubs, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fmsubs_", insn_fmsubs_, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fnmadd", insn_fnmadd, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fnmadd_", insn_fnmadd_, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fnmadds", insn_fnmadds, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fnmadds_", insn_fnmadds_, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fnmsub", insn_fnmsub, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fnmsub_", insn_fnmsub_, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fnmsubs", insn_fnmsubs, macArgs, nMacArgs, SHOW_ALL);
do_N_ternary("fnmsubs_", insn_fnmsubs_, macArgs, nMacArgs, SHOW_ALL);
//do_N_unary(fre, SHOW_ALL);
//do_N_unary(fre_, SHOW_ALL);
do_N_unary("fres", insn_fres, args, nargs, 0x000001FFFFFFFFFFULL);
do_N_unary("fres_", insn_fres_, args, nargs, 0x000001FFFFFFFFFFULL);
do_N_unary("frsqrte", insn_frsqrte, args, nargs, SHOW_ALL);
do_N_unary("frsqrte_", insn_frsqrte_, args, nargs, SHOW_ALL);
// do_N_unary("frsqrtes", insn_frsqrtes, args, nargs, SHOW_ALL);
// do_N_unary("frsqrtes_", insn_frsqrtes_, args, nargs, SHOW_ALL);
do_N_unary("frsp", insn_frsp, args, nargs, SHOW_ALL);
do_N_unary("frsp_", insn_frsp_, args, nargs, SHOW_ALL);
do_N_ternary("fsel", insn_fsel, args, nargs, SHOW_ALL);
do_N_ternary("fsel_", insn_fsel_, args, nargs, SHOW_ALL);
//do_N_unary(fsqrt, SHOW_ALL);
//do_N_unary(fsqrt_, SHOW_ALL);
//do_N_unary(fsqrts, SHOW_ALL);
//do_N_unary(fsqrts_, SHOW_ALL);
return 0;
}
@@ -0,0 +1,20 @@
#include <stdio.h>
#include <math.h>
int isprime ( int n )
{
int m;
int sqrt_n = sqrt(n);
for (m = 2; m <= sqrt_n+1; m++) // +1 in case of obscure rounding error
if ((n % m) == 0) return 0;
return 1;
}
int main ( int argc, char** argv )
{
int i;
for (i = 79000; i < 81000; i++)
if (isprime(i)) { printf ( "%d ", i ); fflush(stdout); }
return 0;
}
+106
View File
@@ -0,0 +1,106 @@
#!/bin/sh
set -e
#---------------------------------------------------------------------
# This quick and dirty script assists in updating the C++ demangler
# machinery in coregrind/m_demangle.
# The script will check out
# - old and new revisions of the C++ demangler related files from GCC's trunk
# - m_demangle from valgrind's trunk.
# It will assemble
# - a patch file with local changes that were applied to the C++
# demangler to make it work within valgrind
# - a directory new_m_demangle whose contents should be copied to
# m_demangle in valgrind trunk
# The patch will *not* be applied automatically.
#---------------------------------------------------------------------
# You need to modify these revision numbers for your update.
old_gcc_revision=r181975 # the revision of the previous update
new_gcc_revision=r212125 # the revision for this update
# Unless the organization of demangler related files has changed, no
# changes below this line should be necessary.
# Setup a temp directory
DIR=/tmp/demangle
rm -rf $DIR
mkdir -p $DIR
cd $DIR
echo "Updating the demangler in $DIR"
# 1) Check out files from old GCC revision
echo "Checking out GCC files @ $old_gcc_revision"
mkdir gcc-$old_gcc_revision
cd gcc-$old_gcc_revision
svn co -$old_gcc_revision svn://gcc.gnu.org/svn/gcc/trunk/libiberty libiberty > /dev/null
svn co -$old_gcc_revision svn://gcc.gnu.org/svn/gcc/trunk/include include > /dev/null
rm -rf libiberty/.svn
rm -rf include/.svn
cd ..
# 2) Assemble the ones we need in $DIR/$old_gcc_revision
mkdir $old_gcc_revision
cd $old_gcc_revision
cp ../gcc-$old_gcc_revision/include/ansidecl.h .
cp ../gcc-$old_gcc_revision/include/demangle.h .
cp ../gcc-$old_gcc_revision/include/dyn-string.h .
cp ../gcc-$old_gcc_revision/include/safe-ctype.h .
cp ../gcc-$old_gcc_revision/libiberty/cp-demangle.c .
cp ../gcc-$old_gcc_revision/libiberty/cp-demangle.h .
cp ../gcc-$old_gcc_revision/libiberty/cplus-dem.c .
cp ../gcc-$old_gcc_revision/libiberty/dyn-string.c .
cp ../gcc-$old_gcc_revision/libiberty/safe-ctype.c .
cd ..
# 3) Check out files from new GCC revision
echo "Checking out GCC files @ $new_gcc_revision"
mkdir gcc-$new_gcc_revision
cd gcc-$new_gcc_revision
svn co -$new_gcc_revision svn://gcc.gnu.org/svn/gcc/trunk/libiberty libiberty > /dev/null
svn co -$new_gcc_revision svn://gcc.gnu.org/svn/gcc/trunk/include include > /dev/null
rm -rf libiberty/.svn
rm -rf include/.svn
cd ..
# 4) Assemble the ones we need in $DIR/$new_gcc_revision
mkdir $new_gcc_revision
cd $new_gcc_revision
cp ../gcc-$new_gcc_revision/include/ansidecl.h .
cp ../gcc-$new_gcc_revision/include/demangle.h .
cp ../gcc-$new_gcc_revision/include/dyn-string.h .
cp ../gcc-$new_gcc_revision/include/safe-ctype.h .
cp ../gcc-$new_gcc_revision/libiberty/cp-demangle.c .
cp ../gcc-$new_gcc_revision/libiberty/cp-demangle.h .
cp ../gcc-$new_gcc_revision/libiberty/cplus-dem.c .
cp ../gcc-$new_gcc_revision/libiberty/dyn-string.c .
cp ../gcc-$new_gcc_revision/libiberty/safe-ctype.c .
cd ..
# 5) Check out valgrind coregrind/m_demangle into old_m_demangle
echo "Checking out coregrind/m_demangle"
svn co svn://svn.valgrind.org/valgrind/trunk/coregrind/m_demangle old_m_demangle > /dev/null
rm -rf old_m_demangle/.svn
# 6) Create new_m_demangle
cp -rp old_m_demangle new_m_demangle
cp -rp $new_gcc_revision/*.[ch] new_m_demangle
# 7) Compare files from previous GCC revision against old_m_demangle
# (This gets us the changes we made to the demangler).
echo "Creating patch"
set +e
diff -r -u $old_gcc_revision old_m_demangle > our-changes
echo "Patch file 'our-changes' created"
# 7) See how the patch would apply
echo "Attempting to apply the patch (but not actualy doing it)."
cd new_m_demangle
patch --dry -p1 < ../our-changes
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -0,0 +1,439 @@
/*--------------------------------------------------------------------*/
/*--- A simple program to listen for valgrind logfile data. ---*/
/*--- valgrind-listener.c ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2000-2015 Julian Seward
jseward@acm.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
The GNU General Public License is contained in the file COPYING.
*/
/*---------------------------------------------------------------*/
/* Include valgrind headers before system headers to avoid problems
with the system headers #defining things which are used as names
of structure members in vki headers. */
#include "pub_core_basics.h"
#include "pub_core_libcassert.h" // For VG_BUGS_TO
#include "pub_core_vki.h" // Avoids warnings from
// pub_core_libcfile.h
#include "pub_core_libcfile.h" // For VG_CLO_DEFAULT_LOGPORT
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/poll.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
/*---------------------------------------------------------------*/
/* The default allowable number of concurrent connections. */
#define M_CONNECTIONS_DEFAULT 50
/* The maximum allowable number of concurrent connections. */
#define M_CONNECTIONS_MAX 5000
/* The maximum allowable number of concurrent connections. */
unsigned M_CONNECTIONS = 0;
/*---------------------------------------------------------------*/
__attribute__ ((noreturn))
static void panic ( const char* str )
{
fprintf(stderr,
"\nvalgrind-listener: the "
"'impossible' happened:\n %s\n", str);
fprintf(stderr,
"Please report this bug at: %s\n\n", VG_BUGS_TO);
exit(1);
}
__attribute__ ((noreturn))
static void my_assert_fail ( const char* expr, const char* file, int line, const char* fn )
{
fprintf(stderr,
"\nvalgrind-listener: %s:%d (%s): Assertion '%s' failed.\n",
file, line, fn, expr );
fprintf(stderr,
"Please report this bug at: %s\n\n", VG_BUGS_TO);
exit(1);
}
#undef assert
#define assert(expr) \
((void) ((expr) ? 0 : \
(my_assert_fail (VG_STRINGIFY(expr), \
__FILE__, __LINE__, \
__PRETTY_FUNCTION__), 0)))
/*---------------------------------------------------------------*/
/* holds the fds for connections; zero if slot not in use. */
int conn_count = 0;
int *conn_fd;
struct pollfd *conn_pollfd;
static void set_nonblocking ( int sd )
{
int res;
res = fcntl(sd, F_GETFL);
res = fcntl(sd, F_SETFL, res | O_NONBLOCK);
if (res != 0) {
perror("fcntl failed");
panic("set_nonblocking");
}
}
static void set_blocking ( int sd )
{
int res;
res = fcntl(sd, F_GETFL);
res = fcntl(sd, F_SETFL, res & ~O_NONBLOCK);
if (res != 0) {
perror("fcntl failed");
panic("set_blocking");
}
}
static void copyout ( char* buf, int nbuf )
{
int i;
for (i = 0; i < nbuf; i++) {
if (buf[i] == '\n') {
fprintf(stdout, "\n(%d) ", conn_count);
} else {
__attribute__((unused)) size_t ignored
= fwrite(&buf[i], 1, 1, stdout);
}
}
fflush(stdout);
}
static int read_from_sd ( int sd )
{
char buf[100];
int n;
set_blocking(sd);
n = read(sd, buf, 99);
if (n <= 0) return 0; /* closed */
copyout(buf, n);
set_nonblocking(sd);
while (1) {
n = read(sd, buf, 100);
if (n <= 0) return 1; /* not closed */
copyout(buf, n);
}
}
static void snooze ( void )
{
struct timespec req;
req.tv_sec = 0;
req.tv_nsec = 200 * 1000 * 1000;
nanosleep(&req,NULL);
}
/* returns 0 if negative, or > BOUND or invalid characters were found */
static int atoi_with_bound ( const char* str, int bound )
{
int n = 0;
while (1) {
if (*str == 0)
break;
if (*str < '0' || *str > '9')
return 0;
n = 10*n + (int)(*str - '0');
str++;
if (n >= bound)
return 0;
}
return n;
}
/* returns 0 if invalid, else port # */
static int atoi_portno ( const char* str )
{
int n = atoi_with_bound(str, 65536);
if (n < 1024)
return 0;
return n;
}
static void usage ( void )
{
fprintf(stderr,
"\n"
"usage is:\n"
"\n"
" valgrind-listener [--exit-at-zero|-e] [--max-connect=INT] [port-number]\n"
"\n"
" where --exit-at-zero or -e causes the listener to exit\n"
" when the number of connections falls back to zero\n"
" (the default is to keep listening forever)\n"
"\n"
" --max-connect=INT can be used to increase the maximum\n"
" number of connected processes (default = %d).\n"
" INT must be positive and less than %d.\n"
"\n"
" port-number is the default port on which to listen for\n"
" connections. It must be between 1024 and 65535.\n"
" Current default is %d.\n"
"\n"
,
M_CONNECTIONS_DEFAULT, M_CONNECTIONS_MAX, VG_CLO_DEFAULT_LOGPORT
);
exit(1);
}
static void banner ( const char* str )
{
time_t t;
t = time(NULL);
printf("valgrind-listener %s at %s", str, ctime(&t));
fflush(stdout);
}
static void exit_routine ( void )
{
banner("exited");
exit(0);
}
static void sigint_handler ( int signo )
{
exit_routine();
}
int main (int argc, char** argv)
{
int i, j, k, res, one;
int main_sd, new_sd;
socklen_t client_len;
struct sockaddr_in client_addr, server_addr;
char /*bool*/ exit_when_zero = 0;
int port = VG_CLO_DEFAULT_LOGPORT;
for (i = 1; i < argc; i++) {
if (0==strcmp(argv[i], "--exit-at-zero")
|| 0==strcmp(argv[i], "-e")) {
exit_when_zero = 1;
}
else if (0 == strncmp(argv[i], "--max-connect=", 14)) {
M_CONNECTIONS = atoi_with_bound(strchr(argv[i], '=') + 1, 5000);
if (M_CONNECTIONS <= 0 || M_CONNECTIONS > M_CONNECTIONS_MAX)
usage();
}
else
if (atoi_portno(argv[i]) > 0) {
port = atoi_portno(argv[i]);
}
else
usage();
}
if (M_CONNECTIONS == 0) // nothing specified on command line
M_CONNECTIONS = M_CONNECTIONS_DEFAULT;
conn_fd = malloc(M_CONNECTIONS * sizeof conn_fd[0]);
conn_pollfd = malloc(M_CONNECTIONS * sizeof conn_pollfd[0]);
if (conn_fd == NULL || conn_pollfd == NULL) {
fprintf(stderr, "Memory allocation failed; cannot continue.\n");
exit(1);
}
banner("started");
signal(SIGINT, sigint_handler);
conn_count = 0;
for (i = 0; i < M_CONNECTIONS; i++)
conn_fd[i] = 0;
/* create socket */
main_sd = socket(AF_INET, SOCK_STREAM, 0);
if (main_sd < 0) {
perror("cannot open socket ");
panic("main -- create socket");
}
/* allow address reuse to avoid "address already in use" errors */
one = 1;
if (setsockopt(main_sd, SOL_SOCKET, SO_REUSEADDR,
&one, sizeof(int)) < 0) {
perror("cannot enable address reuse ");
panic("main -- enable address reuse");
}
/* bind server port */
server_addr.sin_family = AF_INET;
server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
server_addr.sin_port = htons(port);
if (bind(main_sd, (struct sockaddr *) &server_addr,
sizeof(server_addr) ) < 0) {
perror("cannot bind port ");
panic("main -- bind port");
}
res = listen(main_sd,M_CONNECTIONS);
if (res != 0) {
perror("listen failed ");
panic("main -- listen");
}
while (1) {
snooze();
/* enquire, using poll, whether there is any activity available on
the main socket descriptor. If so, someone is trying to
connect; get the fd and add it to our table thereof. */
{ struct pollfd ufd;
while (1) {
ufd.fd = main_sd;
ufd.events = POLLIN;
ufd.revents = 0;
res = poll(&ufd, 1, 0);
if (res == 0) break;
/* ok, we have someone waiting to connect. Get the sd. */
client_len = sizeof(client_addr);
new_sd = accept(main_sd, (struct sockaddr *)&client_addr,
&client_len);
if (new_sd < 0) {
perror("cannot accept connection ");
panic("main -- accept connection");
}
/* find a place to put it. */
assert(new_sd > 0);
for (i = 0; i < M_CONNECTIONS; i++)
if (conn_fd[i] == 0)
break;
if (i >= M_CONNECTIONS) {
fprintf(stderr, "\n\nMore than %d concurrent connections.\n"
"Restart the listener giving --max-connect=INT on the\n"
"commandline to increase the limit.\n\n",
M_CONNECTIONS);
exit(1);
}
conn_fd[i] = new_sd;
conn_count++;
printf("\n(%d) -------------------- CONNECT "
"--------------------\n(%d)\n(%d) ",
conn_count, conn_count, conn_count);
fflush(stdout);
} /* while (1) */
}
/* We've processed all new connect requests. Listen for changes
to the current set of fds. */
j = 0;
for (i = 0; i < M_CONNECTIONS; i++) {
if (conn_fd[i] == 0)
continue;
conn_pollfd[j].fd = conn_fd[i];
conn_pollfd[j].events = POLLIN /* | POLLHUP | POLLNVAL */;
conn_pollfd[j].revents = 0;
j++;
}
res = poll(conn_pollfd, j, 0 /* return immediately. */ );
if (res < 0) {
perror("poll(main) failed");
panic("poll(main) failed");
}
/* nothing happened. go round again. */
if (res == 0) {
continue;
}
/* inspect the fds. */
for (i = 0; i < j; i++) {
if (conn_pollfd[i].revents & POLLIN) {
/* data is available on this fd */
res = read_from_sd(conn_pollfd[i].fd);
if (res == 0) {
/* the connection has been closed. */
close(conn_pollfd[i].fd);
/* this fd has been closed or otherwise gone bad; forget
about it. */
for (k = 0; k < M_CONNECTIONS; k++)
if (conn_fd[k] == conn_pollfd[i].fd)
break;
assert(k < M_CONNECTIONS);
conn_fd[k] = 0;
conn_count--;
printf("\n(%d) ------------------- DISCONNECT "
"-------------------\n(%d)\n(%d) ",
conn_count, conn_count, conn_count);
fflush(stdout);
if (conn_count == 0 && exit_when_zero) {
printf("\n");
fflush(stdout);
exit_routine();
}
}
}
} /* for (i = 0; i < j; i++) */
} /* while (1) */
/* NOTREACHED */
}
/*--------------------------------------------------------------------*/
/*--- end valgrind-listener.c ---*/
/*--------------------------------------------------------------------*/