Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-02-28 08:05:33 +0300
committerChristopher Faylor <me@cgf.cx>2000-02-28 08:05:33 +0300
commitd542443ea4e9615e66b729fc4a93ec72a5305fff (patch)
treec006010e903c36adb0a74879f0f2999224ee1c30 /winsup/cygwin/strace.cc
parent1dc94f73700244d77cf9ceb5d4e65fd71a2f65f0 (diff)
* dcrt0.cc (set_os_type): Record OS name string.
(getprogname): Eliminate obsolete function. (dll_crt0_1): Move initial strace initialization output to set_myself. * exceptions.cc (interruptible): Add debugging output. (interrupt_setup): New function. (interrupt_now): Use interrupt_setup to set up common interrupt handler stuff. (interrupt_on_return): Ditto. (call_handler): Move signal_arrived arm and clear threads to region where signalled thread is suspended or suffer races. * pinfo.cc (set_myself): Output interesting information when strace is first initialized. Initialize progname here. * sigproc.cc (sig_dispatch_pending): Modify to ensure that flush signal are sent synchronously. * strace.cc (strace_vsprintf): Move code into strace program. * uname.cc (uname): Use 'osname' global to construct cygwin name + Windows type + version.
Diffstat (limited to 'winsup/cygwin/strace.cc')
-rw-r--r--winsup/cygwin/strace.cc42
1 files changed, 11 insertions, 31 deletions
diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc
index 742feaed1..d76f7b84a 100644
--- a/winsup/cygwin/strace.cc
+++ b/winsup/cygwin/strace.cc
@@ -63,30 +63,16 @@ static int
strace_vsprintf (char *buf, const char *infmt, va_list ap)
{
int count;
- char fmt[80], unkfmt[80];
+ char fmt[80];
static int nonewline = FALSE;
DWORD err = GetLastError ();
+ const char *tn = threadname (0);
-#ifndef STRACE_HHMMSS
static int lmicrosec = 0;
int microsec = strace_microseconds ();
- int dmicrosec = lmicrosec ? microsec - lmicrosec : 0;
lmicrosec = microsec;
- __small_sprintf (fmt, "%5d %7d [%s] %s ",
- dmicrosec, microsec, threadname (0), "%s %d%s");
- __small_sprintf (unkfmt, "%6d %7d [%s] %s ",
- dmicrosec, microsec, threadname (0),
- "(unknown)");
-#else
- SYSTEMTIME st;
- GetLocalTime (&st);
- const char *tn = threadname (0);
- __small_sprintf (fmt, "%02d:%02d:%02d [%s] %s ",
- st.wHour, st.wMinute, st.wSecond, tn, "%s %d%s");
- __small_sprintf (unkfmt, "%02d:%02d:%02d [%s] %s ",
- st.wHour, st.wMinute, st.wSecond, tn, "***");
-#endif
+ __small_sprintf (fmt, "%7d [%s] %s ", microsec, tn, "%s %d%s");
SetLastError (err);
if (nonewline)
@@ -101,21 +87,15 @@ strace_vsprintf (char *buf, const char *infmt, va_list ap)
else
{
char *p, progname[sizeof (myself->progname)];
- static BOOL NO_COPY output_path_once = FALSE;
- if (!output_path_once)
- output_path_once = !!(p = myself->progname);
+ if ((p = strrchr (myself->progname, '\\')) != NULL)
+ p++;
else
- {
- if ((p = strrchr (myself->progname, '\\')) != NULL)
- p++;
- else
- p = myself->progname;
- strcpy (progname, p);
- if ((p = strrchr (progname, '.')) != NULL)
- *p = '\000';
- p = progname;
- }
- count = __small_sprintf (buf, fmt, p && *p ? p : "(unknown)",
+ p = myself->progname;
+ strcpy (progname, p);
+ if ((p = strrchr (progname, '.')) != NULL)
+ *p = '\000';
+ p = progname;
+ count = __small_sprintf (buf, fmt, p && *p ? p : "?",
myself->pid, hExeced ? "!" : "");
}