* child_info.h (CURR_CHILD_INFO_MAGIC): Reset for previous changes.

* dcrt0.cc (get_cygwin_startup_info): Signal readiness when stracing since
strace::write_child relies on it.  Use strace.activate to notify strace
process, passing in arg indicating whether we're forked.
* sigproc.cc (wait_sig): Accommodate new strace::activate argument.
* spawn.cc (child_info_spawn::worker): Oops.  Previous suspended test was
actually correct.  Revert and document.
* strace.cc (strace::activate): Send additional flag indicating whether this is
an attempt to activate a forked process.
(strace::hello): Report on windows pid.
* include/sys/strace.h (strace::strace): Make a dummy.
(strace::activate): Modify declaration to accept an argument.
(strace::write_childpid): Set regparm.
This commit is contained in:
Christopher Faylor
2011-11-24 02:17:55 +00:00
parent 5f38ec4681
commit 8942ed09ac
7 changed files with 32 additions and 12 deletions

View File

@@ -32,12 +32,12 @@ class strace NO_COPY strace;
#ifndef NOSTRACE
void
strace::activate ()
strace::activate (bool isfork)
{
if (!dynamically_loaded && !_active && being_debugged ())
{
char buf[30];
__small_sprintf (buf, "cYg%8x %x", _STRACE_INTERFACE_ACTIVATE_ADDR, &_active);
__small_sprintf (buf, "cYg%8x %x %d", _STRACE_INTERFACE_ACTIVATE_ADDR, &_active, isfork);
OutputDebugString (buf);
}
}
@@ -47,9 +47,10 @@ strace::hello ()
{
if (active ())
{
char pidbuf[40];
char pidbuf[80];
if (myself->progname[0])
__small_sprintf (pidbuf, "(pid %d, ppid %d)", myself->pid, myself->ppid ?: 1);
__small_sprintf (pidbuf, "(pid %d, ppid %d, windows pid %u)", myself->pid,
myself->ppid ?: 1, GetCurrentProcessId ());
else
{
GetModuleFileNameW (NULL, myself->progname, sizeof (myself->progname));