From 494a66d9c5799091ccefcfd2f3d22226b16f4c38 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 29 Jan 2002 02:02:03 +0000 Subject: * external.cc (cygwin_internal): Initialize various internal settings if required to allow use of some things from user loaded DLL. (CW_STRACE_ON): Add new feature. (CW_CYGWIN_PID_TO_WINPID): Ditto. * pinfo.cc (set_myself): Call "strace.hello" to initiate possible strace session. (pinfo::init): Guard against dereferencing uninitialized myself. * sigproc.cc (wait_sig): Call strace.hello() when __SIGTRACE "signal" received. * strace.cc (strace::hello): New method. * wincap.cc (wincapc::init): Avoid initializing if already initialized. * wincap.h (wincapc::wincapc): New method. * include/sys/cygwin.h: Add new CW_ enums. Kludge typedefs of {g,u}id_t if required. * strace.h (strace::hello): Declare new method. --- winsup/cygwin/strace.cc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'winsup/cygwin/strace.cc') diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc index b7e0a2a32..993bfe1ef 100644 --- a/winsup/cygwin/strace.cc +++ b/winsup/cygwin/strace.cc @@ -17,6 +17,8 @@ details. */ #include "sync.h" #include "sigproc.h" #include "pinfo.h" +#include "perprocess.h" +#include "cygwin_version.h" #define PROTECT(x) x[sizeof(x)-1] = 0 #define CHECK(x) if (x[sizeof(x)-1] != 0) { small_printf("array bound exceeded %d\n", __LINE__); ExitProcess(1); } @@ -28,6 +30,29 @@ class NO_COPY strace strace; #ifndef NOSTRACE +void +strace::hello() +{ + char buf[30]; + __small_sprintf (buf, "cYg%8x %x", _STRACE_INTERFACE_ACTIVATE_ADDR, &active); + OutputDebugString (buf); + + if (active) + { + prntf (1, NULL, "**********************************************"); + prntf (1, NULL, "Program name: %s (%d)", myself->progname, myself->pid); + prntf (1, NULL, "App version: %d.%d, api: %d.%d", + user_data->dll_major, user_data->dll_minor, + user_data->api_major, user_data->api_minor); + prntf (1, NULL, "DLL version: %d.%d, api: %d.%d", + cygwin_version.dll_major, cygwin_version.dll_minor, + cygwin_version.api_major, cygwin_version.api_minor); + prntf (1, NULL, "DLL build: %s", cygwin_version.dll_build_date); + prntf (1, NULL, "OS version: Windows %s", wincap.osname ()); + prntf (1, NULL, "**********************************************"); + } +} + int strace::microseconds() { -- cgit v1.2.3