Skip to content

Commit bdbab02

Browse files
committed
Activate strace
1 parent 40a0e86 commit bdbab02

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

winsup/cygwin/dcrt0.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ dll_crt0_1 (void *)
10011001
sig_dispatch_pending (false);
10021002
_my_tls.call_signal_handler ();
10031003
_my_tls.incyg--; /* Not in Cygwin anymore */
1004+
strace.set_active (true);
10041005
cygwin_exit (user_data->main (__argc, newargv, environ));
10051006
}
10061007
__asm__ (" \n\

winsup/cygwin/include/sys/strace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class strace
3838
unsigned char _active;
3939
public:
4040
void activate (bool);
41+
void set_active (unsigned active) {_active = active;}
4142
strace () {}
4243
int microseconds ();
4344
int version;
@@ -91,6 +92,7 @@ extern "C" {
9192

9293
void small_printf (const char *, ...);
9394
void strace_printf (unsigned, const char *func, const char *, ...);
95+
void strace_set_active (unsigned);
9496

9597
#ifdef __cplusplus
9698
}

winsup/cygwin/strace.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ strace_printf (unsigned category, const char *func, const char *fmt, ...)
312312
}
313313
}
314314

315+
extern "C" void
316+
strace_set_active (unsigned active)
317+
{
318+
strace.set_active (active);
319+
}
315320
static NO_COPY struct tab
316321
{
317322
int v;

winsup/testsuite/winsup.api/waitpid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <stdio.h>
2+
#include <sys/strace.h>
23
#include <sys/wait.h>
34
#include <errno.h>
45
#include <unistd.h>

0 commit comments

Comments
 (0)