diff options
author | Christopher Faylor <me@cgf.cx> | 2002-01-29 02:02:03 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-01-29 02:02:03 +0000 |
commit | 494a66d9c5799091ccefcfd2f3d22226b16f4c38 (patch) | |
tree | bbcd6f02ad3860e2cfb35b6065c2beec2bfd5e88 /winsup/cygwin/strace.cc | |
parent | a489b37643af9b02d8a31b0e584713f90bbd9ba7 (diff) | |
download | cygnal-494a66d9c5799091ccefcfd2f3d22226b16f4c38.tar.gz cygnal-494a66d9c5799091ccefcfd2f3d22226b16f4c38.tar.bz2 cygnal-494a66d9c5799091ccefcfd2f3d22226b16f4c38.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/strace.cc')
-rw-r--r-- | winsup/cygwin/strace.cc | 25 |
1 files changed, 25 insertions, 0 deletions
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() { |