aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-02 17:46:38 +0000
committerChristopher Faylor <me@cgf.cx>2002-06-02 17:46:38 +0000
commitf69af9b3d2352f2343234cc83c93df7375086679 (patch)
treee09f18ba573bbef53adf40557791d5917c315dc6
parent97478fe6b48cf652434119911dc6caf8e07a603d (diff)
downloadnewlib-f69af9b3d2352f2343234cc83c93df7375086679.zip
newlib-f69af9b3d2352f2343234cc83c93df7375086679.tar.gz
newlib-f69af9b3d2352f2343234cc83c93df7375086679.tar.bz2
* strace.cc (forkdebug): Make true by default.
(attach_process): Use window pid if cygwin pid isn't available (yet). (create_child): Use either DEBUG_ONLY_THIS_PROCESS or DEBUG_PROCESS, exclusively. (Suggested by Conrad.Scott@dsl.pipex.com)
-rw-r--r--winsup/utils/ChangeLog7
-rw-r--r--winsup/utils/strace.cc18
-rw-r--r--winsup/utils/utils.sgml2
3 files changed, 18 insertions, 9 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index fc8df5f..e08295a 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,10 @@
+2002-06-02 Christopher Faylor <cgf@redhat.com>
+
+ * strace.cc (forkdebug): Make true by default.
+ (attach_process): Use window pid if cygwin pid isn't available (yet).
+ (create_child): Use either DEBUG_ONLY_THIS_PROCESS or DEBUG_PROCESS,
+ exclusively. (Suggested by Conrad.Scott@dsl.pipex.com)
+
2002-05-30 Christopher Faylor <cgf@redhat.com>
* mkpasswd.cc (main): Don't reset to binmode if stdout is a terminal.
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index 99664ad..210de3d 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -38,7 +38,7 @@ int _impure_ptr;
static const char *version_string = "@(#)strace V1.0, Copyright (C) 2001, 2002 Red Hat Inc., " __DATE__ "\n";
static const char *pgm;
-static int forkdebug = 0;
+static int forkdebug = 1;
static int numerror = 1;
static int usecs = 1;
static int delta = 1;
@@ -286,7 +286,10 @@ attach_process (pid_t pid)
load_cygwin ();
child_pid = (DWORD) cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid);
if (!child_pid)
- error (0, "no such pid - %d", pid);
+ {
+ warn (0, "no such cygwin pid - %d", pid);
+ child_pid = pid;
+ }
if (!DebugActiveProcess (child_pid))
error (0, "couldn't attach to pid %d<%d> for debugging", pid, child_pid);
@@ -312,11 +315,10 @@ create_child (char **argv)
memset (&si, 0, sizeof (si));
si.cb = sizeof (si);
- /* cygwin32_conv_to_win32_path (exec_file, real_path); */
-
- flags = forkdebug ? 0 : DEBUG_ONLY_THIS_PROCESS;
- flags |= CREATE_DEFAULT_ERROR_MODE | DEBUG_PROCESS;
- flags |= (new_window ? CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP : 0);
+ flags = CREATE_DEFAULT_ERROR_MODE
+ | (forkdebug ? DEBUG_PROCESS : DEBUG_ONLY_THIS_PROCESS);
+ if (new_window)
+ flags |= CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP;
make_command_line (one_line, argv);
@@ -786,7 +788,7 @@ usage ()
Usage: strace [OPTIONS] <command-line>\n\
-b, --buffer-size=SIZE set size of output file buffer\n\
-d, --no-delta don't display the delta-t microsecond timestamp\n\
- -f, --trace-children also trace forked child processes\n\
+ -f, --trace-children trace child processes (toggle - default true)\n\
-h, --help display this help info\n\
-m, --mask=MASK set message filter mask\n\
-o, --output=FILENAME set output file to FILENAME\n\
diff --git a/winsup/utils/utils.sgml b/winsup/utils/utils.sgml
index 53448f2..d9a6049 100644
--- a/winsup/utils/utils.sgml
+++ b/winsup/utils/utils.sgml
@@ -645,7 +645,7 @@ Usage strace [options] program [args...]
-b, --buffer-size=SIZE set size of output file buffer
-d, --no-delta don't display the delta-t microsecond timestamp
- -f, --trace-children also trace forked child processes
+ -f, --trace-children trace child processes (toggle -- default is "true")
-h, --help display help info
-m, --mask=MASK set message filter mask
-n, --crack-error-numbers output descriptive text instead of error