aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/strace.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2008-12-19 19:09:51 +0000
committerChristopher Faylor <me@cgf.cx>2008-12-19 19:09:51 +0000
commit1af6bb97a4c189f734e03580f238c68865b4b21f (patch)
treeb5e6999eaba73b31dc30cab33adbec66202c659b /winsup/cygwin/strace.cc
parent887eb76fca6231e6d6b9a5058a95cba28dcc46b6 (diff)
downloadnewlib-1af6bb97a4c189f734e03580f238c68865b4b21f.zip
newlib-1af6bb97a4c189f734e03580f238c68865b4b21f.tar.gz
newlib-1af6bb97a4c189f734e03580f238c68865b4b21f.tar.bz2
* pinfo.cc (pinfo_basic): New class.
(pinfo_basic::pinfo_basic): Define constructor for new class. (myself): Initialize from myself_initial. (set_myself): Set pid and progname from already myself_initial. * strace.cc (strace::strace): Split apart strace::hello. Send notification to strace as early as possible. (strace::hello): Just send clause which describes the current process. This can now be preceded by early initialization strace output. * include/sys/strace.h (strace::strace): Declare new constructor.
Diffstat (limited to 'winsup/cygwin/strace.cc')
-rw-r--r--winsup/cygwin/strace.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc
index 4672615..b9af9df 100644
--- a/winsup/cygwin/strace.cc
+++ b/winsup/cygwin/strace.cc
@@ -31,16 +31,19 @@ class strace NO_COPY strace;
#ifndef NOSTRACE
+strace::strace ()
+{
+ if (!dynamically_loaded && !_active && being_debugged ())
+ {
+ char buf[30];
+ __small_sprintf (buf, "cYg%8x %x", _STRACE_INTERFACE_ACTIVATE_ADDR, &_active);
+ OutputDebugString (buf);
+ }
+}
+
void
strace::hello ()
{
- if (_active || !being_debugged ())
- return;
-
- char buf[30];
- __small_sprintf (buf, "cYg%8x %x", _STRACE_INTERFACE_ACTIVATE_ADDR, &_active);
- OutputDebugString (buf);
-
if (active ())
{
char pidbuf[40];