diff options
author | cvs2svn <> | 2014-02-18 19:58:41 +0000 |
---|---|---|
committer | cvs2svn <> | 2014-02-18 19:58:41 +0000 |
commit | b5279ecc51ff751ccd052fbb7c20efd529575f7e (patch) | |
tree | 64141e96a5d64ae59fb7f410270e4daa41878a03 /winsup/utils/ssp.c | |
parent | a2a48cb593a9b3cc3f5c63c39f52c32db31cec50 (diff) | |
download | cygnal-b5279ecc51ff751ccd052fbb7c20efd529575f7e.tar.gz cygnal-b5279ecc51ff751ccd052fbb7c20efd529575f7e.tar.bz2 cygnal-b5279ecc51ff751ccd052fbb7c20efd529575f7e.zip |
This commit was manufactured by cvs2svn to create tag 'cygwin-pre-user-db'.cygwin-pre-user-db
Sprout from cygwin-1_7_29-release-branchpoint 2014-02-18 19:58:40 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch 'cygwin-1_7_29'
Cherrypick from master 2014-02-08 22:25:11 UTC Corinna Vinschen <corinna@vinschen.de> 'Fix ChangeLog':
winsup/cygwin/ChangeLog
winsup/cygwin/miscfuncs.cc
winsup/cygwin/miscfuncs.h
winsup/cygwin/mount.cc
Delete:
winsup/COPYING
winsup/CYGWIN_LICENSE
winsup/ChangeLog
winsup/Makefile.common
winsup/Makefile.in
winsup/README
winsup/acinclude.m4
winsup/aclocal.m4
winsup/autogen.sh
winsup/c++wrap
winsup/ccwrap
winsup/config.guess
winsup/config.sub
winsup/configure
winsup/configure.ac
winsup/configure.cygwin
winsup/cygserver/ChangeLog
winsup/cygserver/ChangeLog.64bit
winsup/cygserver/Makefile.in
winsup/cygserver/README
winsup/cygserver/aclocal.m4
winsup/cygserver/autogen.sh
winsup/cygserver/bsd_helper.cc
winsup/cygserver/bsd_helper.h
winsup/cygserver/bsd_log.cc
winsup/cygserver/bsd_log.h
winsup/cygserver/bsd_mutex.cc
winsup/cygserver/bsd_mutex.h
winsup/cygserver/client.cc
winsup/cygserver/configure
winsup/cygserver/configure.ac
winsup/cygserver/cygserver-config
winsup/cygserver/cygserver.cc
winsup/cygserver/cygserver.conf
winsup/cygserver/msg.cc
winsup/cygserver/process.cc
winsup/cygserver/process.h
winsup/cygserver/sem.cc
winsup/cygserver/setpwd.cc
winsup/cygserver/shm.cc
winsup/cygserver/sysv_msg.cc
winsup/cygserver/sysv_sem.cc
winsup/cygserver/sysv_shm.cc
winsup/cygserver/threaded_queue.cc
winsup/cygserver/threaded_queue.h
winsup/cygserver/transport.cc
winsup/cygserver/transport.h
winsup/cygserver/transport_pipes.cc
winsup/cygserver/transport_pipes.h
winsup/cygserver/woutsup.h
winsup/cygwin/release/1.7.29
winsup/doc/.cvsignore
winsup/doc/ChangeLog
winsup/doc/Makefile.in
winsup/doc/README
winsup/doc/Wishlist
winsup/doc/aclocal.m4
winsup/doc/bodysnatcher.pl
winsup/doc/configure
winsup/doc/configure.ac
winsup/doc/cygserver.xml
winsup/doc/cygwin-api.in.xml
winsup/doc/cygwin-ug-net.xml
winsup/doc/cygwin.xsl
winsup/doc/cygwinenv.xml
winsup/doc/dll.xml
winsup/doc/doctool.c
winsup/doc/doctool.txt
winsup/doc/effectively.xml
winsup/doc/faq-api.xml
winsup/doc/faq-copyright.xml
winsup/doc/faq-programming.xml
winsup/doc/faq-resources.xml
winsup/doc/faq-setup.xml
winsup/doc/faq-using.xml
winsup/doc/faq-what.xml
winsup/doc/faq.xml
winsup/doc/fhandler-tut.txt
winsup/doc/filemodes.xml
winsup/doc/fo.xsl
winsup/doc/gcc.xml
winsup/doc/gdb.xml
winsup/doc/highlights.xml
winsup/doc/legal.xml
winsup/doc/new-features.xml
winsup/doc/ntsec.xml
winsup/doc/ov-ex-unix.xml
winsup/doc/ov-ex-win.xml
winsup/doc/overview.xml
winsup/doc/pathnames.xml
winsup/doc/programming.xml
winsup/doc/setup-env.xml
winsup/doc/setup-files.xml
winsup/doc/setup-locale.xml
winsup/doc/setup-maxmem.xml
winsup/doc/setup-net.xml
winsup/doc/specialnames.xml
winsup/doc/textbinary.xml
winsup/doc/ug-info.xml
winsup/doc/using.xml
winsup/doc/windres.xml
winsup/doc/xidepend
winsup/install-sh
winsup/lsaauth/ChangeLog
winsup/lsaauth/ChangeLog.64bit
winsup/lsaauth/Makefile.in
winsup/lsaauth/aclocal.m4
winsup/lsaauth/configure
winsup/lsaauth/configure.ac
winsup/lsaauth/cyglsa-config
winsup/lsaauth/cyglsa.c
winsup/lsaauth/cyglsa.din
winsup/lsaauth/cyglsa64.def
winsup/testsuite/ChangeLog
winsup/testsuite/Makefile.in
winsup/testsuite/README
winsup/testsuite/aclocal.m4
winsup/testsuite/config/default.exp
winsup/testsuite/configure
winsup/testsuite/configure.ac
winsup/testsuite/cygrun.c
winsup/testsuite/libltp/include/dataascii.h
winsup/testsuite/libltp/include/databin.h
winsup/testsuite/libltp/include/file_lock.h
winsup/testsuite/libltp/include/forker.h
winsup/testsuite/libltp/include/open_flags.h
winsup/testsuite/libltp/include/pattern.h
winsup/testsuite/libltp/include/random_range.h
winsup/testsuite/libltp/include/rmobj.h
winsup/testsuite/libltp/include/search_path.h
winsup/testsuite/libltp/include/str_to_bytes.h
winsup/testsuite/libltp/include/string_to_tokens.h
winsup/testsuite/libltp/include/test.h
winsup/testsuite/libltp/include/tlibio.h
winsup/testsuite/libltp/include/usctest.h
winsup/testsuite/libltp/include/write_log.h
winsup/testsuite/libltp/lib/dataascii.c
winsup/testsuite/libltp/lib/databin.c
winsup/testsuite/libltp/lib/datapid.c
winsup/testsuite/libltp/lib/forker.c
winsup/testsuite/libltp/lib/get_high_address.c
winsup/testsuite/libltp/lib/libtestsuite.c
winsup/testsuite/libltp/lib/open_flags.c
winsup/testsuite/libltp/lib/parse_opts.c
winsup/testsuite/libltp/lib/pattern.c
winsup/testsuite/libltp/lib/rmobj.c
winsup/testsuite/libltp/lib/search_path.c
winsup/testsuite/libltp/lib/str_to_bytes.c
winsup/testsuite/libltp/lib/string_to_tokens.c
winsup/testsuite/libltp/lib/tst_res.c
winsup/testsuite/libltp/lib/tst_sig.c
winsup/testsuite/libltp/lib/tst_tmpdir.c
winsup/testsuite/libltp/lib/write_log.c
winsup/testsuite/winsup.api/checksignal.c
winsup/testsuite/winsup.api/crlf.c
winsup/testsuite/winsup.api/cygload.cc
winsup/testsuite/winsup.api/cygload.exp
winsup/testsuite/winsup.api/cygload.h
winsup/testsuite/winsup.api/devdsp.c
winsup/testsuite/winsup.api/devdsp_okay.h
winsup/testsuite/winsup.api/devzero.c
winsup/testsuite/winsup.api/iospeed.c
winsup/testsuite/winsup.api/known_bugs.tcl
winsup/testsuite/winsup.api/ltp/access01.c
winsup/testsuite/winsup.api/ltp/access03.c
winsup/testsuite/winsup.api/ltp/access04.c
winsup/testsuite/winsup.api/ltp/access05.c
winsup/testsuite/winsup.api/ltp/alarm01.c
winsup/testsuite/winsup.api/ltp/alarm02.c
winsup/testsuite/winsup.api/ltp/alarm03.c
winsup/testsuite/winsup.api/ltp/alarm07.c
winsup/testsuite/winsup.api/ltp/asyncio02.c
winsup/testsuite/winsup.api/ltp/chdir02.c
winsup/testsuite/winsup.api/ltp/chdir04.c
winsup/testsuite/winsup.api/ltp/chmod01.c
winsup/testsuite/winsup.api/ltp/chmod02.c
winsup/testsuite/winsup.api/ltp/chown01.c
winsup/testsuite/winsup.api/ltp/close01.c
winsup/testsuite/winsup.api/ltp/close02.c
winsup/testsuite/winsup.api/ltp/close08.c
winsup/testsuite/winsup.api/ltp/creat01.c
winsup/testsuite/winsup.api/ltp/creat03.c
winsup/testsuite/winsup.api/ltp/creat09.c
winsup/testsuite/winsup.api/ltp/dup01.c
winsup/testsuite/winsup.api/ltp/dup02.c
winsup/testsuite/winsup.api/ltp/dup03.c
winsup/testsuite/winsup.api/ltp/dup04.c
winsup/testsuite/winsup.api/ltp/dup05.c
winsup/testsuite/winsup.api/ltp/execl01.c
winsup/testsuite/winsup.api/ltp/execle01.c
winsup/testsuite/winsup.api/ltp/execlp01.c
winsup/testsuite/winsup.api/ltp/execv01.c
winsup/testsuite/winsup.api/ltp/execve01.c
winsup/testsuite/winsup.api/ltp/execvp01.c
winsup/testsuite/winsup.api/ltp/exit01.c
winsup/testsuite/winsup.api/ltp/exit02.c
winsup/testsuite/winsup.api/ltp/fchdir01.c
winsup/testsuite/winsup.api/ltp/fchdir02.c
winsup/testsuite/winsup.api/ltp/fchmod01.c
winsup/testsuite/winsup.api/ltp/fchown01.c
winsup/testsuite/winsup.api/ltp/fcntl02.c
winsup/testsuite/winsup.api/ltp/fcntl03.c
winsup/testsuite/winsup.api/ltp/fcntl04.c
winsup/testsuite/winsup.api/ltp/fcntl05.c
winsup/testsuite/winsup.api/ltp/fcntl07.c
winsup/testsuite/winsup.api/ltp/fcntl07B.c
winsup/testsuite/winsup.api/ltp/fcntl08.c
winsup/testsuite/winsup.api/ltp/fcntl09.c
winsup/testsuite/winsup.api/ltp/fcntl10.c
winsup/testsuite/winsup.api/ltp/fork01.c
winsup/testsuite/winsup.api/ltp/fork02.c
winsup/testsuite/winsup.api/ltp/fork03.c
winsup/testsuite/winsup.api/ltp/fork04.c
winsup/testsuite/winsup.api/ltp/fork06.c
winsup/testsuite/winsup.api/ltp/fork07.c
winsup/testsuite/winsup.api/ltp/fork09.c
winsup/testsuite/winsup.api/ltp/fork10.c
winsup/testsuite/winsup.api/ltp/fork11.c
winsup/testsuite/winsup.api/ltp/fpathconf01.c
winsup/testsuite/winsup.api/ltp/fstat01.c
winsup/testsuite/winsup.api/ltp/fstat02.c
winsup/testsuite/winsup.api/ltp/fstat03.c
winsup/testsuite/winsup.api/ltp/fstat04.c
winsup/testsuite/winsup.api/ltp/fsync01.c
winsup/testsuite/winsup.api/ltp/ftruncate01.c
winsup/testsuite/winsup.api/ltp/ftruncate02.c
winsup/testsuite/winsup.api/ltp/ftruncate03.c
winsup/testsuite/winsup.api/ltp/getegid01.c
winsup/testsuite/winsup.api/ltp/geteuid01.c
winsup/testsuite/winsup.api/ltp/getgid01.c
winsup/testsuite/winsup.api/ltp/getgid02.c
winsup/testsuite/winsup.api/ltp/getgid03.c
winsup/testsuite/winsup.api/ltp/getgroups01.c
winsup/testsuite/winsup.api/ltp/getgroups02.c
winsup/testsuite/winsup.api/ltp/gethostid01.c
winsup/testsuite/winsup.api/ltp/gethostname01.c
winsup/testsuite/winsup.api/ltp/getpgid01.c
winsup/testsuite/winsup.api/ltp/getpgid02.c
winsup/testsuite/winsup.api/ltp/getpgrp01.c
winsup/testsuite/winsup.api/ltp/getpid01.c
winsup/testsuite/winsup.api/ltp/getpid02.c
winsup/testsuite/winsup.api/ltp/getppid01.c
winsup/testsuite/winsup.api/ltp/getppid02.c
winsup/testsuite/winsup.api/ltp/getuid01.c
winsup/testsuite/winsup.api/ltp/getuid02.c
winsup/testsuite/winsup.api/ltp/getuid03.c
winsup/testsuite/winsup.api/ltp/kill01.c
winsup/testsuite/winsup.api/ltp/kill02.c
winsup/testsuite/winsup.api/ltp/kill03.c
winsup/testsuite/winsup.api/ltp/kill04.c
winsup/testsuite/winsup.api/ltp/kill09.c
winsup/testsuite/winsup.api/ltp/link02.c
winsup/testsuite/winsup.api/ltp/link03.c
winsup/testsuite/winsup.api/ltp/link04.c
winsup/testsuite/winsup.api/ltp/link05.c
winsup/testsuite/winsup.api/ltp/lseek01.c
winsup/testsuite/winsup.api/ltp/lseek02.c
winsup/testsuite/winsup.api/ltp/lseek03.c
winsup/testsuite/winsup.api/ltp/lseek04.c
winsup/testsuite/winsup.api/ltp/lseek05.c
winsup/testsuite/winsup.api/ltp/lseek06.c
winsup/testsuite/winsup.api/ltp/lseek07.c
winsup/testsuite/winsup.api/ltp/lseek08.c
winsup/testsuite/winsup.api/ltp/lseek09.c
winsup/testsuite/winsup.api/ltp/lseek10.c
winsup/testsuite/winsup.api/ltp/lstat02.c
winsup/testsuite/winsup.api/ltp/mkdir01.c
winsup/testsuite/winsup.api/ltp/mkdir08.c
winsup/testsuite/winsup.api/ltp/mknod01.c
winsup/testsuite/winsup.api/ltp/mmap001.c
winsup/testsuite/winsup.api/ltp/mmap02.c
winsup/testsuite/winsup.api/ltp/mmap03.c
winsup/testsuite/winsup.api/ltp/mmap04.c
winsup/testsuite/winsup.api/ltp/mmap05.c
winsup/testsuite/winsup.api/ltp/mmap06.c
winsup/testsuite/winsup.api/ltp/mmap07.c
winsup/testsuite/winsup.api/ltp/mmap08.c
winsup/testsuite/winsup.api/ltp/munmap01.c
winsup/testsuite/winsup.api/ltp/munmap02.c
winsup/testsuite/winsup.api/ltp/nice05.c
winsup/testsuite/winsup.api/ltp/open02.c
winsup/testsuite/winsup.api/ltp/open03.c
winsup/testsuite/winsup.api/ltp/pathconf01.c
winsup/testsuite/winsup.api/ltp/pause01.c
winsup/testsuite/winsup.api/ltp/pipe01.c
winsup/testsuite/winsup.api/ltp/pipe08.c
winsup/testsuite/winsup.api/ltp/pipe09.c
winsup/testsuite/winsup.api/ltp/pipe10.c
winsup/testsuite/winsup.api/ltp/pipe11.c
winsup/testsuite/winsup.api/ltp/poll01.c
winsup/testsuite/winsup.api/ltp/read01.c
winsup/testsuite/winsup.api/ltp/read04.c
winsup/testsuite/winsup.api/ltp/readdir01.c
winsup/testsuite/winsup.api/ltp/readlink01.c
winsup/testsuite/winsup.api/ltp/readlink02.c
winsup/testsuite/winsup.api/ltp/readlink03.c
winsup/testsuite/winsup.api/ltp/rename01.c
winsup/testsuite/winsup.api/ltp/rename02.c
winsup/testsuite/winsup.api/ltp/rename08.c
winsup/testsuite/winsup.api/ltp/rename10.c
winsup/testsuite/winsup.api/ltp/rmdir01.c
winsup/testsuite/winsup.api/ltp/rmdir04.c
winsup/testsuite/winsup.api/ltp/rmdir05.c
winsup/testsuite/winsup.api/ltp/sbrk01.c
winsup/testsuite/winsup.api/ltp/select01.c
winsup/testsuite/winsup.api/ltp/select02.c
winsup/testsuite/winsup.api/ltp/select03.c
winsup/testsuite/winsup.api/ltp/setgid01.c
winsup/testsuite/winsup.api/ltp/setgroups01.c
winsup/testsuite/winsup.api/ltp/setpgid01.c
winsup/testsuite/winsup.api/ltp/setregid01.c
winsup/testsuite/winsup.api/ltp/setreuid01.c
winsup/testsuite/winsup.api/ltp/setuid01.c
winsup/testsuite/winsup.api/ltp/setuid02.c
winsup/testsuite/winsup.api/ltp/signal03.c
winsup/testsuite/winsup.api/ltp/stat01.c
winsup/testsuite/winsup.api/ltp/stat02.c
winsup/testsuite/winsup.api/ltp/stat03.c
winsup/testsuite/winsup.api/ltp/stat05.c
winsup/testsuite/winsup.api/ltp/stat06.c
winsup/testsuite/winsup.api/ltp/symlink01.c
winsup/testsuite/winsup.api/ltp/symlink02.c
winsup/testsuite/winsup.api/ltp/symlink03.c
winsup/testsuite/winsup.api/ltp/symlink04.c
winsup/testsuite/winsup.api/ltp/symlink05.c
winsup/testsuite/winsup.api/ltp/sync01.c
winsup/testsuite/winsup.api/ltp/sync02.c
winsup/testsuite/winsup.api/ltp/time01.c
winsup/testsuite/winsup.api/ltp/time02.c
winsup/testsuite/winsup.api/ltp/times01.c
winsup/testsuite/winsup.api/ltp/times02.c
winsup/testsuite/winsup.api/ltp/times03.c
winsup/testsuite/winsup.api/ltp/truncate01.c
winsup/testsuite/winsup.api/ltp/truncate02.c
winsup/testsuite/winsup.api/ltp/ulimit01.c
winsup/testsuite/winsup.api/ltp/umask01.c
winsup/testsuite/winsup.api/ltp/umask02.c
winsup/testsuite/winsup.api/ltp/umask03.c
winsup/testsuite/winsup.api/ltp/uname01.c
winsup/testsuite/winsup.api/ltp/unlink05.c
winsup/testsuite/winsup.api/ltp/unlink06.c
winsup/testsuite/winsup.api/ltp/unlink07.c
winsup/testsuite/winsup.api/ltp/unlink08.c
winsup/testsuite/winsup.api/ltp/vfork01.c
winsup/testsuite/winsup.api/ltp/wait02.c
winsup/testsuite/winsup.api/ltp/wait401.c
winsup/testsuite/winsup.api/ltp/wait402.c
winsup/testsuite/winsup.api/ltp/write01.c
winsup/testsuite/winsup.api/ltp/write02.c
winsup/testsuite/winsup.api/ltp/write03.c
winsup/testsuite/winsup.api/mmaptest01.c
winsup/testsuite/winsup.api/mmaptest02.c
winsup/testsuite/winsup.api/mmaptest03.c
winsup/testsuite/winsup.api/mmaptest04.c
winsup/testsuite/winsup.api/msgtest.c
winsup/testsuite/winsup.api/nullgetcwd.c
winsup/testsuite/winsup.api/pthread/cancel1.c
winsup/testsuite/winsup.api/pthread/cancel10.c
winsup/testsuite/winsup.api/pthread/cancel11.c
winsup/testsuite/winsup.api/pthread/cancel12.c
winsup/testsuite/winsup.api/pthread/cancel2.c
winsup/testsuite/winsup.api/pthread/cancel3.c
winsup/testsuite/winsup.api/pthread/cancel4.c
winsup/testsuite/winsup.api/pthread/cancel5.c
winsup/testsuite/winsup.api/pthread/cancel6.c
winsup/testsuite/winsup.api/pthread/cancel7.c
winsup/testsuite/winsup.api/pthread/cancel8.c
winsup/testsuite/winsup.api/pthread/cancel9.c
winsup/testsuite/winsup.api/pthread/cleanup2.c
winsup/testsuite/winsup.api/pthread/cleanup3.c
winsup/testsuite/winsup.api/pthread/condvar1.c
winsup/testsuite/winsup.api/pthread/condvar2.c
winsup/testsuite/winsup.api/pthread/condvar2_1.c
winsup/testsuite/winsup.api/pthread/condvar3.c
winsup/testsuite/winsup.api/pthread/condvar3_1.c
winsup/testsuite/winsup.api/pthread/condvar3_2.c
winsup/testsuite/winsup.api/pthread/condvar3_3.c
winsup/testsuite/winsup.api/pthread/condvar4.c
winsup/testsuite/winsup.api/pthread/condvar5.c
winsup/testsuite/winsup.api/pthread/condvar6.c
winsup/testsuite/winsup.api/pthread/condvar7.c
winsup/testsuite/winsup.api/pthread/condvar8.c
winsup/testsuite/winsup.api/pthread/condvar9.c
winsup/testsuite/winsup.api/pthread/count1.c
winsup/testsuite/winsup.api/pthread/create1.c
winsup/testsuite/winsup.api/pthread/create2.c
winsup/testsuite/winsup.api/pthread/equal1.c
winsup/testsuite/winsup.api/pthread/exit1.c
winsup/testsuite/winsup.api/pthread/exit2.c
winsup/testsuite/winsup.api/pthread/exit3.c
winsup/testsuite/winsup.api/pthread/inherit1.c
winsup/testsuite/winsup.api/pthread/join0.c
winsup/testsuite/winsup.api/pthread/join1.c
winsup/testsuite/winsup.api/pthread/join2.c
winsup/testsuite/winsup.api/pthread/mainthreadexits.c
winsup/testsuite/winsup.api/pthread/mutex1.c
winsup/testsuite/winsup.api/pthread/mutex1d.c
winsup/testsuite/winsup.api/pthread/mutex1e.c
winsup/testsuite/winsup.api/pthread/mutex1n.c
winsup/testsuite/winsup.api/pthread/mutex1r.c
winsup/testsuite/winsup.api/pthread/mutex2.c
winsup/testsuite/winsup.api/pthread/mutex3.c
winsup/testsuite/winsup.api/pthread/mutex4.c
winsup/testsuite/winsup.api/pthread/mutex5.c
winsup/testsuite/winsup.api/pthread/mutex6d.c
winsup/testsuite/winsup.api/pthread/mutex6e.c
winsup/testsuite/winsup.api/pthread/mutex6n.c
winsup/testsuite/winsup.api/pthread/mutex6r.c
winsup/testsuite/winsup.api/pthread/mutex7.c
winsup/testsuite/winsup.api/pthread/mutex7d.c
winsup/testsuite/winsup.api/pthread/mutex7e.c
winsup/testsuite/winsup.api/pthread/mutex7n.c
winsup/testsuite/winsup.api/pthread/mutex7r.c
winsup/testsuite/winsup.api/pthread/mutex8e.c
winsup/testsuite/winsup.api/pthread/mutex8n.c
winsup/testsuite/winsup.api/pthread/mutex8r.c
winsup/testsuite/winsup.api/pthread/once1.c
winsup/testsuite/winsup.api/pthread/priority1.c
winsup/testsuite/winsup.api/pthread/priority2.c
winsup/testsuite/winsup.api/pthread/rwlock1.c
winsup/testsuite/winsup.api/pthread/rwlock2.c
winsup/testsuite/winsup.api/pthread/rwlock3.c
winsup/testsuite/winsup.api/pthread/rwlock4.c
winsup/testsuite/winsup.api/pthread/rwlock5.c
winsup/testsuite/winsup.api/pthread/rwlock6.c
winsup/testsuite/winsup.api/pthread/rwlock7.c
winsup/testsuite/winsup.api/pthread/self1.c
winsup/testsuite/winsup.api/pthread/self2.c
winsup/testsuite/winsup.api/pthread/test.h
winsup/testsuite/winsup.api/pthread/threadidafterfork.c
winsup/testsuite/winsup.api/pthread/tsd1.c
winsup/testsuite/winsup.api/resethand.c
winsup/testsuite/winsup.api/samples/sample-fail.c
winsup/testsuite/winsup.api/samples/sample-miscompile.c
winsup/testsuite/winsup.api/samples/sample-pass.c
winsup/testsuite/winsup.api/semtest.c
winsup/testsuite/winsup.api/shmtest.c
winsup/testsuite/winsup.api/sigchld.c
winsup/testsuite/winsup.api/signal-into-win32-api.c
winsup/testsuite/winsup.api/systemcall.c
winsup/testsuite/winsup.api/user_malloc.c
winsup/testsuite/winsup.api/waitpid.c
winsup/testsuite/winsup.api/winsup.exp
winsup/utils/COPYING.dumper
winsup/utils/ChangeLog
winsup/utils/ChangeLog-2000
winsup/utils/ChangeLog.64bit
winsup/utils/Makefile.in
winsup/utils/aclocal.m4
winsup/utils/autogen.sh
winsup/utils/bloda.cc
winsup/utils/configure
winsup/utils/configure.ac
winsup/utils/cygcheck.cc
winsup/utils/cygpath.cc
winsup/utils/cygwin-console-helper.cc
winsup/utils/dump_setup.cc
winsup/utils/dumper.cc
winsup/utils/dumper.h
winsup/utils/getconf.c
winsup/utils/getfacl.c
winsup/utils/kill.cc
winsup/utils/ldd.cc
winsup/utils/ldh.cc
winsup/utils/loadlib.h
winsup/utils/locale.cc
winsup/utils/minidumper.cc
winsup/utils/mkgroup.c
winsup/utils/mkpasswd.c
winsup/utils/module_info.cc
winsup/utils/mount.cc
winsup/utils/parse_pe.cc
winsup/utils/passwd.c
winsup/utils/path.cc
winsup/utils/path.h
winsup/utils/pldd.c
winsup/utils/ps.cc
winsup/utils/regtool.cc
winsup/utils/setfacl.c
winsup/utils/setmetamode.c
winsup/utils/ssp.c
winsup/utils/ssp.txt
winsup/utils/strace.cc
winsup/utils/testsuite.cc
winsup/utils/testsuite.h
winsup/utils/tzset.c
winsup/utils/umount.cc
winsup/utils/utils.xml
winsup/utils/wide_path.h
Diffstat (limited to 'winsup/utils/ssp.c')
-rw-r--r-- | winsup/utils/ssp.c | 956 |
1 files changed, 0 insertions, 956 deletions
diff --git a/winsup/utils/ssp.c b/winsup/utils/ssp.c deleted file mode 100644 index 3136a9f66..000000000 --- a/winsup/utils/ssp.c +++ /dev/null @@ -1,956 +0,0 @@ -/* - * Copyright (c) 2000, 2001, 2002, 2009, 2011, 2013 Red Hat, Inc. - * - * 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. - * - * A copy of the GNU General Public License can be found at - * http://www.gnu.org/ - * - * Written by DJ Delorie <dj@redhat.com> - * - */ - -#ifdef __x86_64__ - -#include <stdio.h> - -int -main (int argc, char **argv) -{ - fprintf (stderr, "%s: This application is unsuported on x86_64 so far.\n", - argv[0]); - return 1; -} - -#else - -#include <errno.h> -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <fcntl.h> -#include <time.h> -#include <ctype.h> -#include <windows.h> -#include <getopt.h> -#include <cygwin/version.h> - -static char *prog_name; - -static struct option longopts[] = -{ - {"console-trace", no_argument, NULL, 'c' }, - {"disable", no_argument, NULL, 'd' }, - {"enable", no_argument, NULL, 'e' }, - {"help", no_argument, NULL, 'h' }, - {"dll", no_argument, NULL, 'l' }, - {"sub-threads", no_argument, NULL, 's' }, - {"trace-eip", no_argument, NULL, 't' }, - {"verbose", no_argument, NULL, 'v' }, - {"version", no_argument, NULL, 'V' }, - {NULL, 0, NULL, 0} -}; - -static char opts[] = "+cdehlstvV"; - -#define KERNEL_ADDR 0x77000000 - -#define TRACE_SSP 0 - -#define VERBOSE 1 -#define TIMES 1000 - -/* from winsup/gmon.h */ -struct gmonhdr { - unsigned long lpc; /* base pc address of sample buffer */ - unsigned long hpc; /* max pc address of sampled buffer */ - int ncnt; /* size of sample buffer (plus this header) */ - int version; /* version number */ - int profrate; /* profiling clock rate */ - int spare[3]; /* reserved */ -}; -#define GMONVERSION 0x00051879 -#define HISTCOUNTER unsigned short - -typedef struct { - unsigned int base_address; - int pcount; - int scount; - char *name; -} DllInfo; - -typedef struct { - unsigned int address; - unsigned char real_byte; -} PendingBreakpoints; - -unsigned low_pc=0, high_pc=0; -unsigned last_pc=0, pc, last_sp=0, sp; -int total_cycles, count; -HANDLE hProcess; -PROCESS_INFORMATION procinfo; -STARTUPINFO startup; -CONTEXT context; -HISTCOUNTER *hits=0; -struct gmonhdr hdr; -int running = 1, profiling = 1; -char dll_name[1024], *dll_ptr, *cp; -int eip; -unsigned opcode_count = 0; - -int stepping_enabled = 1; -int tracing_enabled = 0; -int trace_console = 0; -int trace_all_threads = 0; -int dll_counts = 0; -int verbose = 0; - -#define MAXTHREADS 100 -DWORD active_thread_ids[MAXTHREADS]; -HANDLE active_threads[MAXTHREADS]; -DWORD thread_step_flags[MAXTHREADS]; -DWORD thread_return_address[MAXTHREADS]; -int num_active_threads = 0; -int suspended_count=0; - -#define MAXDLLS 100 -DllInfo dll_info[MAXDLLS]; -int num_dlls=0; - -#define MAXPENDS 100 -PendingBreakpoints pending_breakpoints[MAXPENDS]; -int num_breakpoints=0; - -static void -add_breakpoint (unsigned int address) -{ - int i; - DWORD rv; - static char int3[] = { 0xcc }; - for (i=0; i<num_breakpoints; i++) - { - if (pending_breakpoints[i].address == address) - return; - if (pending_breakpoints[i].address == 0) - break; - } - if (i == MAXPENDS) - return; - pending_breakpoints[i].address = address; - ReadProcessMemory (hProcess, - (void *)address, - &(pending_breakpoints[i].real_byte), - 1, &rv); - - WriteProcessMemory (hProcess, - (void *)address, - (LPVOID)int3, 1, &rv); - if (i >= num_breakpoints) - num_breakpoints = i+1; -} - -static int -remove_breakpoint (unsigned int address) -{ - int i; - DWORD rv; - for (i=0; i<num_breakpoints; i++) - { - if (pending_breakpoints[i].address == address) - { - pending_breakpoints[i].address = 0; - WriteProcessMemory (hProcess, - (void *)address, - &(pending_breakpoints[i].real_byte), - 1, &rv); - return 1; - } - } - return 0; -} - -static HANDLE -lookup_thread_id (DWORD threadId, int *tix) -{ - int i; - *tix = 0; - for (i=0; i<num_active_threads; i++) - if (active_thread_ids[i] == threadId) - { - if (tix) - *tix = i; - return active_threads[i]; - } - return 0; -} - -static void -set_step_threads (int threadId, int trace) -{ - int rv, tix; - HANDLE thread = lookup_thread_id (threadId, &tix); - - rv = GetThreadContext (thread, &context); - if (rv != -1) - { - thread_step_flags[tix] = trace; - if (trace) - context.EFlags |= 0x100; /* TRAP (single step) flag */ - else - context.EFlags &= ~0x100; /* TRAP (single step) flag */ - SetThreadContext (thread, &context); - } -} - -static void -set_steps () -{ - int i, s; - for (i=0; i<num_active_threads; i++) - { - GetThreadContext (active_threads[i], &context); - s = context.EFlags & 0x0100; - if (!s && thread_step_flags[i]) - { - set_step_threads (active_thread_ids[i], 1); - } - } -} - -static int -dll_sort (const void *va, const void *vb) -{ - DllInfo *a = (DllInfo *)va; - DllInfo *b = (DllInfo *)vb; - if (a->base_address < b->base_address) - return -1; - return 1; -} - -static char * -addr2dllname (unsigned int addr) -{ - int i; - for (i=num_dlls-1; i>=0; i--) - { - if (dll_info[i].base_address < addr) - { - return dll_info[i].name; - } - } - return (char *)""; -} - -static void -dump_registers (HANDLE thread) -{ - context.ContextFlags = CONTEXT_FULL; - GetThreadContext (thread, &context); - printf ("eax %08lx ebx %08lx ecx %08lx edx %08lx eip\n", - context.Eax, context.Ebx, context.Ecx, context.Edx); - printf ("esi %08lx edi %08lx ebp %08lx esp %08lx %08lx\n", - context.Esi, context.Esi, context.Ebp, context.Esp, context.Eip); -} - -typedef struct Edge { - struct Edge *next; - unsigned int from_pc; - unsigned int to_pc; - unsigned int count; -} Edge; - -Edge *edges[4096]; - -void -store_call_edge (unsigned int from_pc, unsigned int to_pc) -{ - Edge *e; - unsigned int h = ((from_pc + to_pc)>>4) & 4095; - for (e=edges[h]; e; e=e->next) - if (e->from_pc == from_pc && e->to_pc == to_pc) - break; - if (!e) - { - e = (Edge *)malloc (sizeof (Edge)); - e->next = edges[h]; - edges[h] = e; - e->from_pc = from_pc; - e->to_pc = to_pc; - e->count = 0; - } - e->count++; -} - -void -write_call_edges (FILE *f) -{ - int h; - Edge *e; - for (h=0; h<4096; h++) - for (e=edges[h]; e; e=e->next) - fwrite (&(e->from_pc), 1, 3*sizeof (unsigned int), f); -} - -char * -wide_strdup (char *cp) -{ - unsigned short *s = (unsigned short *)cp; - int len; - char *rv; - for (len=0; s[len]; len++); - rv = (char *)malloc (len+1); - for (len=0; s[len]; len++) - rv[len] = s[len]; - rv[len] = 0; - return rv; -} - -void -run_program (char *cmdline) -{ - FILE *tracefile = 0; - int tix, i; - HANDLE hThread; - char *string; - - memset (&startup, 0, sizeof (startup)); - startup.cb = sizeof (startup); - - if (!CreateProcess (0, cmdline, 0, 0, 0, - CREATE_NEW_PROCESS_GROUP - | CREATE_SUSPENDED - | DEBUG_PROCESS - | DEBUG_ONLY_THIS_PROCESS, - 0, 0, &startup, &procinfo)) - { - fprintf (stderr, "Can't create process: error %ld\n", GetLastError ()); - exit (1); - } - - hProcess = procinfo.hProcess; -#if 0 - printf ("procinfo: %08x %08x %08x %08x\n", - hProcess, procinfo.hThread, procinfo.dwProcessId, procinfo.dwThreadId); -#endif - - active_threads[0] = procinfo.hThread; - active_thread_ids[0] = procinfo.dwThreadId; - thread_step_flags[0] = stepping_enabled; - num_active_threads = 1; - - dll_info[0].base_address = 0; - dll_info[0].pcount = 0; - dll_info[0].scount = 0; - dll_info[0].name = cmdline; - num_dlls = 1; - - SetThreadPriority (procinfo.hThread, THREAD_PRIORITY_IDLE); - - context.ContextFlags = CONTEXT_FULL; - - ResumeThread (procinfo.hThread); - - total_cycles = 0; - - if (tracing_enabled) - { - tracefile = fopen ("trace.ssp", "w"); - if (!tracefile) - { - tracing_enabled = 0; - perror ("trace.ssp"); - } - } - - running = 1; - while (running) - { - int src, dest; - DWORD rv; - DEBUG_EVENT event; - int contv = DBG_CONTINUE; - - event.dwDebugEventCode = -1; - if (!WaitForDebugEvent (&event, INFINITE)) - { - printf ("idle...\n"); - } - - hThread = lookup_thread_id (event.dwThreadId, &tix); - -#if 0 - printf ("DE: %x/%d %d %d ", - hThread, tix, - event.dwDebugEventCode, num_active_threads); - for (src=0; src<num_active_threads; src++) - { - int sc = SuspendThread (active_threads[src]); - int rv = GetThreadContext (active_threads[src], &context); - ResumeThread (active_threads[src]); - printf (" [%x,%x,%x]", - active_threads[src], context.Eip, active_thread_ids[src]); - } - printf ("\n"); -#endif - - switch (event.dwDebugEventCode) - { - - case CREATE_PROCESS_DEBUG_EVENT: - break; - - case CREATE_THREAD_DEBUG_EVENT: - if (verbose) - printf ("create thread %08lx at %08x %s\n", - event.dwThreadId, - (int)event.u.CreateThread.lpStartAddress, - addr2dllname ((unsigned int)event.u.CreateThread.lpStartAddress)); - - active_thread_ids[num_active_threads] = event.dwThreadId; - active_threads[num_active_threads] = event.u.CreateThread.hThread; - thread_return_address[num_active_threads] = 0; - num_active_threads++; - - if (trace_all_threads && stepping_enabled) - { - thread_step_flags[num_active_threads-1] = stepping_enabled; - add_breakpoint ((int)event.u.CreateThread.lpStartAddress); - } - - break; - - case EXIT_THREAD_DEBUG_EVENT: - if (verbose) - printf ("exit thread %08lx, code=%ld\n", - event.dwThreadId, - event.u.ExitThread.dwExitCode); - - for (src=0, dest=0; src<num_active_threads; src++) - if (active_thread_ids[src] != event.dwThreadId) - { - active_thread_ids[dest] = active_thread_ids[src]; - active_threads[dest] = active_threads[src]; - dest++; - } - num_active_threads = dest; - break; - - case EXCEPTION_DEBUG_EVENT: - rv = GetThreadContext (hThread, &context); - switch (event.u.Exception.ExceptionRecord.ExceptionCode) - { - case STATUS_BREAKPOINT: - if (remove_breakpoint ((int)event.u.Exception.ExceptionRecord.ExceptionAddress)) - { - context.Eip --; - if (!rv) - SetThreadContext (hThread, &context); - if (ReadProcessMemory (hProcess, (void *)context.Esp, &rv, 4, &rv)) - thread_return_address[tix] = rv; - } - set_step_threads (event.dwThreadId, stepping_enabled); - case STATUS_SINGLE_STEP: - opcode_count++; - pc = (unsigned int)event.u.Exception.ExceptionRecord.ExceptionAddress; - sp = (unsigned int)context.Esp; - if (tracing_enabled) - fprintf (tracefile, "%08x %08lx\n", pc, event.dwThreadId); - if (trace_console) - { - printf ("%d %08x\n", tix, pc); - fflush (stdout); - } - - if (dll_counts) - { - int i; - for (i=num_dlls-1; i>=0; i--) - { - if (dll_info[i].base_address < context.Eip) - { - if (hThread == procinfo.hThread) - dll_info[i].pcount++; - else - dll_info[i].scount++; - break; - } - } - } - - if (pc < last_pc || pc > last_pc+10) - { - static int ncalls=0; - static int qq=0; - if (++qq % 100 == 0) - fprintf (stderr, " %08x %d %d \r", - pc, ncalls, opcode_count); - - if (sp == last_sp-4) - { - ncalls++; - store_call_edge (last_pc, pc); - if (last_pc < KERNEL_ADDR && pc > KERNEL_ADDR) - { - int retaddr; - DWORD rv; - ReadProcessMemory (hProcess, - (void *)sp, - (LPVOID)&(retaddr), - 4, &rv); -#if 0 - printf ("call last_pc = %08x pc = %08x rv = %08x\n", - last_pc, pc, retaddr); - /* experimental - try to skip kernel calls for speed */ - add_breakpoint (retaddr); - set_step_threads (event.dwThreadId, 0); -#endif - } - } - } - - total_cycles++; - last_sp = sp; - last_pc = pc; - if (pc >= low_pc && pc < high_pc) - hits[(pc - low_pc)/2] ++; - break; - default: - if (verbose) - { - printf ("exception %ld, ", event.u.Exception.dwFirstChance); - printf ("code: %lx flags: %lx\n", - event.u.Exception.ExceptionRecord.ExceptionCode, - event.u.Exception.ExceptionRecord.ExceptionFlags); - if (event.u.Exception.dwFirstChance == 1) - dump_registers (hThread); - } - contv = DBG_EXCEPTION_NOT_HANDLED; - running = 0; - break; - } - - if (!rv) - { - if (pc == thread_return_address[tix]) - { - if (context.EFlags & 0x100) - { - context.EFlags &= ~0x100; /* TRAP (single step) flag */ - SetThreadContext (hThread, &context); - } - } - else if (stepping_enabled) - { - if (!(context.EFlags & 0x100)) - { - context.EFlags |= 0x100; /* TRAP (single step) flag */ - SetThreadContext (hThread, &context); - } - } - } - break; - - case OUTPUT_DEBUG_STRING_EVENT: - string = (char *)malloc (event.u.DebugString.nDebugStringLength+1); - i = ReadProcessMemory (hProcess, - event.u.DebugString.lpDebugStringData, - (LPVOID)string, - event.u.DebugString.nDebugStringLength, - &rv); - if (!i) - { - printf ("error reading memory: %ld %ld\n", rv, GetLastError ()); - } - if (verbose) - printf ("ODS: %x/%d \"%s\"\n", - (int)hThread, tix, string); - - if (strcmp (string, "ssp on") == 0) - { - stepping_enabled = 1; - set_step_threads (event.dwThreadId, 1); - } - - if (strcmp (string, "ssp off") == 0) - { - stepping_enabled = 0; - set_step_threads (event.dwThreadId, 0); - } - - break; - - - case LOAD_DLL_DEBUG_EVENT: - if (verbose) - printf ("load dll %08x:", - (int)event.u.LoadDll.lpBaseOfDll); - - dll_ptr = (char *)"( u n k n o w n ) \0\0"; - if (event.u.LoadDll.lpImageName) - { - ReadProcessMemory (hProcess, - event.u.LoadDll.lpImageName, - (LPVOID)&src, - sizeof (src), - &rv); - if (src) - { - ReadProcessMemory (hProcess, - (void *)src, - (LPVOID)dll_name, - sizeof (dll_name), - &rv); - dll_name[rv] = 0; - dll_ptr = dll_name; - for (cp=dll_name; *cp; cp++) - { - if (*cp == '\\' || *cp == '/') - { - dll_ptr = cp+1; - } - *cp = tolower ((unsigned char) *cp); - } - } - } - - - dll_info[num_dlls].base_address - = (unsigned int)event.u.LoadDll.lpBaseOfDll; - dll_info[num_dlls].pcount = 0; - dll_info[num_dlls].scount = 0; - dll_info[num_dlls].name = wide_strdup (dll_ptr); - if (verbose) - printf (" %s\n", dll_info[num_dlls].name); - num_dlls++; - qsort (dll_info, num_dlls, sizeof (DllInfo), dll_sort); - - break; - - case UNLOAD_DLL_DEBUG_EVENT: - if (verbose) - printf ("unload dll\n"); - break; - - case EXIT_PROCESS_DEBUG_EVENT: - if (verbose) - printf ("process %08lx %08lx exit %ld\n", - event.dwProcessId, event.dwThreadId, - event.u.ExitProcess.dwExitCode); - - running = 0; - break; - } - - set_steps (); - ContinueDebugEvent (event.dwProcessId, event.dwThreadId, contv); - } - - count = 0; - for (pc=low_pc; pc<high_pc; pc+=2) - { - count += hits[(pc - low_pc)/2]; - } - printf ("total cycles: %d, counted cycles: %d\n", total_cycles, count); - - if (tracing_enabled) - fclose (tracefile); - -} - -static void -usage (FILE * stream) -{ - fprintf (stream , "" - "Usage: %s [options] low_pc high_pc command...\n" - "\n" - "Single-step profile COMMAND\n" - "\n" - " -c, --console-trace trace every EIP value to the console. *Lots* slower.\n" - " -d, --disable disable single-stepping by default; use\n" - " OutputDebugString (\"ssp on\") to enable stepping\n" - " -e, --enable enable single-stepping by default; use\n" - " OutputDebugString (\"ssp off\") to disable stepping\n" - " -h, --help output usage information and exit\n" - " -l, --dll enable dll profiling. A chart of relative DLL usage\n" - " is produced after the run.\n" - " -s, --sub-threads trace sub-threads too. Dangerous if you have\n" - " race conditions.\n" - " -t, --trace-eip trace every EIP value to a file TRACE.SSP. This\n" - " gets big *fast*.\n" - " -v, --verbose output verbose messages about debug events.\n" - " -V, --version output version information and exit\n" - "\n" - "Example: %s 0x401000 0x403000 hello.exe\n" - "\n" - "", prog_name, prog_name); - if (stream == stdout) - fprintf (stream , "" - "SSP - The Single Step Profiler\n" - "\n" - "Original Author: DJ Delorie <dj@redhat.com>\n" - "\n" - "The SSP is a program that uses the Win32 debug API to run a program\n" - "one ASM instruction at a time. It records the location of each\n" - "instruction used, how many times that instruction is used, and all\n" - "function calls. The results are saved in a format that is usable by\n" - "the profiling program \"gprof\", although gprof will claim the values\n" - "are seconds, they really are instruction counts. More on that later.\n" - "\n" - "Because the SSP was originally designed to profile the cygwin DLL, it\n" - "does not automatically select a block of code to report statistics on.\n" - "You must specify the range of memory addresses to keep track of\n" - "manually, but it's not hard to figure out what to specify. Use the\n" - "\"objdump\" program to determine the bounds of the target's \".text\"\n" - "section. Let's say we're profiling cygwin1.dll. Make sure you've\n" - "built it with debug symbols (else gprof won't run) and run objdump\n" - "like this:\n" - "\n" - " objdump -h cygwin1.dll\n" - "\n" - "It will print a report like this:\n" - "\n" - "cygwin1.dll: file format pei-i386\n" - "\n" - "Sections:\n" - "Idx Name Size VMA LMA File off Algn\n" - " 0 .text 0007ea00 61001000 61001000 00000400 2**2\n" - " CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA\n" - " 1 .data 00008000 61080000 61080000 0007ee00 2**2\n" - " CONTENTS, ALLOC, LOAD, DATA\n" - " . . .\n" - "\n" - "The only information we're concerned with are the VMA of the .text\n" - "section and the VMA of the section after it (sections are usually\n" - "contiguous; you can also add the Size to the VMA to get the end\n" - "address). In this case, the VMA is 0x61001000 and the ending address\n" - "is either 0x61080000 (start of .data method) or 0x0x6107fa00 (VMA+Size\n" - "method).\n" - "\n" - "There are two basic ways to use SSP - either profiling a whole\n" - "program, or selectively profiling parts of the program.\n" - "\n" - "To profile a whole program, just run ssp without options. By default,\n" - "it will step the whole program. Here's a simple example, using the\n" - "numbers above:\n" - "\n" - " ssp 0x61001000 0x61080000 hello.exe\n" - "\n" - "This will step the whole program. It will take at least 8 minutes on\n" - "a PII/300 (yes, really). When it's done, it will create a file called\n" - "\"gmon.out\". You can turn this data file into a readable report with\n" - "gprof:\n" - "\n" - " gprof -b cygwin1.dll\n" - "\n" - "The \"-b\" means 'skip the help pages'. You can omit this until you're\n" - "familiar with the report layout. The gprof documentation explains\n" - "a lot about this report, but ssp changes a few things. For example,\n" - "the first part of the report reports the amount of time spent in each\n" - "function, like this:\n" - "\n" - "Each sample counts as 0.01 seconds.\n" - " %% cumulative self self total\n" - " time seconds seconds calls ms/call ms/call name\n" - " 10.02 231.22 72.43 46 1574.57 1574.57 strcspn\n" - " 7.95 288.70 57.48 130 442.15 442.15 strncasematch\n" - "\n" - "The \"seconds\" columns are really CPU opcodes, 1/100 second per opcode.\n" - "So, \"231.22\" above means 23,122 opcodes. The ms/call values are 10x\n" - "too big; 1574.57 means 157.457 opcodes per call. Similar adjustments\n" - "need to be made for the \"self\" and \"children\" columns in the second\n" - "part of the report.\n" - "\n" - "OK, so now we've got a huge report that took a long time to generate,\n" - "and we've identified a spot we want to work on optimizing. Let's say\n" - "it's the time() function. We can use SSP to selectively profile this\n" - "function by using OutputDebugString() to control SSP from within the\n" - "program. Here's a sample program:\n" - "\n" - " #include <windows.h>\n" - " main()\n" - " {\n" - " time_t t;\n" - " OutputDebugString(\"ssp on\");\n" - " time(&t);\n" - " OutputDebugString(\"ssp off\");\n" - " }\n" - "\n" - "Then, add the \"-d\" option to ssp to default to *disabling* profiling.\n" - "The program will run at full speed until the first OutputDebugString,\n" - "then step until the second.\n" - "\n" - " ssp -d 0x61001000 0x61080000 hello.exe\n" - "\n" - "You can then use gprof (as usual) to see the performance profile for\n" - "just that portion of the program's execution.\n" - "\n" - "There are many options to ssp. Since step-profiling makes your\n" - "program run about 1,000 times slower than normal, it's best to\n" - "understand all the options so that you can narrow down the parts\n" - "of your program you need to single-step.\n" - "\n" - "\"-v\" - verbose. This prints messages about threads starting and\n" - "stopping, OutputDebugString calls, DLLs loading, etc.\n" - "\n" - "\"-t\" and \"-c\" - tracing. With -t, *every* step's address is written\n" - "to the file \"trace.ssp\". This can be used to help debug functions,\n" - "since it can trace multiple threads. Clever use of scripts can match\n" - "addresses with disassembled opcodes if needed. Warning: creates\n" - "*huge* files, very quickly. \"-c\" prints each address to the console,\n" - "useful for debugging key chunks of assembler.\n" - "Use \"addr2line -C -f -s -e foo.exe < trace.ssp > lines.ssp\" and then\n" - "\"perl cvttrace\" to convert to symbolic traces.\n" - "\n" - "\"-s\" - subthreads. Usually, you only need to trace the main thread,\n" - "but sometimes you need to trace all threads, so this enables that.\n" - "It's also needed when you want to profile a function that only a\n" - "subthread calls. However, using OutputDebugString automatically\n" - "enables profiling on the thread that called it, not the main thread.\n" - "\n" - "\"-l\" - dll profiling. Generates a pretty table of how much time was\n" - "spent in each dll the program used. No sense optimizing a function in\n" - "your program if most of the time is spent in the DLL.\n" - "\n" - "Typically use the -v, -s, and -l options:\n" - "\n" - " ssp -v -s -l -d 0x61001000 0x61080000 hello.exe\n" - "\n"); - if (stream == stderr) - fprintf (stream, "Try '%s --help' for more information.\n", prog_name); - exit (stream == stderr ? 1 : 0); -} - -static void -print_version () -{ - printf ("ssp (cygwin) %d.%d.%d\n" - "Single-Step Profiler\n" - "Copyright (C) 2000 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" - "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); -} - -int -main (int argc, char **argv) -{ - int c, i; - int total_pcount = 0, total_scount = 0; - FILE *gmon; - - setbuf (stdout, 0); - - prog_name = program_invocation_short_name; - - while ((c = getopt_long (argc, argv, opts, longopts, NULL)) != EOF) - switch (c) - { - case 'c': - printf ("tracing *all* $eip to the console\n"); - trace_console = 1; - break; - case 'd': - printf ("stepping disabled; enable via OutputDebugString (\"ssp on\")\n"); - stepping_enabled = 0; - break; - case 'e': - printf ("stepping enabled; disable via OutputDebugString (\"ssp off\")\n"); - stepping_enabled = 1; - break; - case 'h': - usage (stdout); - break; - case 'l': - printf ("profiling dll usage\n"); - dll_counts = 1; - break; - case 's': - printf ("tracing all sub-threads too, not just the main one\n"); - trace_all_threads = 1; - break; - case 't': - printf ("tracing all $eip to trace.ssp\n"); - tracing_enabled = 1; - break; - case 'v': - printf ("verbose messages enabled\n"); - verbose = 1; - break; - case 'V': - print_version (); - exit (0); - default: - fprintf (stderr, "Try `%s --help' for more information.\n", prog_name); - exit (1); - } - - if ( (argc - optind) < 3 ) - usage (stderr); - sscanf (argv[optind++], "%i", &low_pc); - sscanf (argv[optind++], "%i", &high_pc); - - if (low_pc > high_pc-8) - { - fprintf (stderr, "Hey, low_pc must be lower than high_pc\n"); - exit (1); - } - - hits = (HISTCOUNTER *)malloc (high_pc-low_pc+4); - memset (hits, 0, high_pc-low_pc+4); - - fprintf (stderr, "prun: [%08x,%08x] Running '%s'\n", - low_pc, high_pc, argv[optind]); - - run_program (argv[optind]); - - hdr.lpc = low_pc; - hdr.hpc = high_pc; - hdr.ncnt = high_pc-low_pc + sizeof (hdr); - hdr.version = GMONVERSION; - hdr.profrate = 100; - - gmon = fopen ("gmon.out", "wb"); - fwrite (&hdr, 1, sizeof (hdr), gmon); - fwrite (hits, 1, high_pc-low_pc, gmon); - write_call_edges (gmon); - fclose (gmon); - - if (dll_counts) - { - /* 1234567 123% 1234567 123% 12345678 xxxxxxxxxxx */ - printf (" Main-Thread Other-Thread BaseAddr DLL Name\n"); - - total_pcount = 0; - total_scount = 0; - for (i=0; i<num_dlls; i++) - { - total_pcount += dll_info[i].pcount; - total_scount += dll_info[i].scount; - } - - if (total_pcount == 0) total_pcount++; - if (total_scount == 0) total_scount++; - - for (i=0; i<num_dlls; i++) - if (dll_info[i].pcount || dll_info[i].scount) - { - printf ("%7d %3d%% %7d %3d%% %08x %s\n", - dll_info[i].pcount, - (dll_info[i].pcount*100)/opcode_count, - dll_info[i].scount, - (dll_info[i].scount*100)/opcode_count, - dll_info[i].base_address, - dll_info[i].name); - } - } - - exit (0); -} - -#endif /* !__x86_64 */ |