* strace.cc (show_usecs): Renamed from 'usecs'.

(main): Use show_usecs rather than usecs.  Toggle delta if '-u' is specified.
(handle_output_debug_string): Avoid printing microsecond timestamp if
show_usecs == 0.
* utils.sgml (strace): Add words to describe '-u'.
This commit is contained in:
Christopher Faylor 2005-12-05 16:39:06 +00:00
parent a7dc05b5d1
commit 801d6cc753
3 changed files with 18 additions and 7 deletions

View File

@ -1,3 +1,12 @@
2005-12-05 Christopher Faylor <cgf@timesys.com>
* strace.cc (show_usecs): Renamed from 'usecs'.
(main): Use show_usecs rather than usecs. Toggle delta if '-u' is
specified.
(handle_output_debug_string): Avoid printing microsecond timestamp if
show_usecs == 0.
* utils.sgml (strace): Add words to describe '-u'.
2005-11-22 Brian Dessent <brian@dessent.net> 2005-11-22 Brian Dessent <brian@dessent.net>
* Makefile.in: Link cygcheck with libwininet.a. * Makefile.in: Link cygcheck with libwininet.a.

View File

@ -35,7 +35,7 @@ static const char version[] = "$Revision$";
static const char *pgm; static const char *pgm;
static int forkdebug = 1; static int forkdebug = 1;
static int numerror = 1; static int numerror = 1;
static int usecs = 1; static int show_usecs = 1;
static int delta = 1; static int delta = 1;
static int hhmmss = 0; static int hhmmss = 0;
static int bufsize = 0; static int bufsize = 0;
@ -381,7 +381,7 @@ syst (long long t)
{ {
FILETIME n; FILETIME n;
static SYSTEMTIME st; static SYSTEMTIME st;
long long now = t + ((long long) usecs * 10); long long now = t /*+ ((long long) usecs * 10)*/;
n.dwHighDateTime = now >> 32; n.dwHighDateTime = now >> 32;
n.dwLowDateTime = now & 0xffffffff; n.dwLowDateTime = now & 0xffffffff;
FileTimeToSystemTime (&n, &st); FileTimeToSystemTime (&n, &st);
@ -475,7 +475,7 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile)
else else
{ {
ptrest = q; ptrest = q;
ptusec = s; ptusec = show_usecs ? s : ptrest;
usecs = dusecs; usecs = dusecs;
} }
@ -817,6 +817,7 @@ Trace system calls and signals\n\
the default microsecond timestamp. Implies -d\n\ the default microsecond timestamp. Implies -d\n\
-T, --toggle toggle tracing in a process already being\n\ -T, --toggle toggle tracing in a process already being\n\
traced. Requires -p <pid>\n\ traced. Requires -p <pid>\n\
-u, --usecs toggle printing of microseconds timestamp\n\
-v, --version output version information and exit\n\ -v, --version output version information and exit\n\
-w, --new-window spawn program under test in a new window\n\ -w, --new-window spawn program under test in a new window\n\
\n", pgm, pgm); \n", pgm, pgm);
@ -974,7 +975,8 @@ character #%d.\n", optarg, (int) (endptr - optarg), endptr);
break; break;
case 'u': case 'u':
// FIXME: currently unimplemented // FIXME: currently unimplemented
usecs ^= 1; show_usecs ^= 1;
delta ^= 1;
break; break;
case 'v': case 'v':
// Print version info and exit // Print version info and exit

View File

@ -1493,6 +1493,7 @@ Trace system calls and signals
-t, --timestamp use an absolute hh:mm:ss timestamp insted of -t, --timestamp use an absolute hh:mm:ss timestamp insted of
the default microsecond timestamp. Implies -d the default microsecond timestamp. Implies -d
-T, --toggle toggle tracing in a process already being -T, --toggle toggle tracing in a process already being
-u, --usecs toggle printing of microseconds timestamp
traced. Requires -p &lt;pid&gt; traced. Requires -p &lt;pid&gt;
-v, --version output version information and exit -v, --version output version information and exit
-w, --new-window spawn program under test in a new window -w, --new-window spawn program under test in a new window
@ -1540,9 +1541,8 @@ take a long time to complete.
<para> <para>
Note that <command>strace</command> is a standalone Windows program and so does Note that <command>strace</command> is a standalone Windows program and so does
not rely on the Cygwin DLL itself (you can verify this with not rely on the Cygwin DLL itself (you can verify this with
<command>cygcheck</command>). As a result it does not understand POSIX <command>cygcheck</command>). As a result it does not understand symlinks.
pathnames or symlinks. This program is mainly useful for debugging the This program is mainly useful for debugging the Cygwin DLL itself.</para>
Cygwin DLL itself.</para>
</sect2> </sect2>