summaryrefslogtreecommitdiffstats
path: root/winsup/utils/strace.cc
Commit message (Collapse)AuthorAgeFilesLines
* * strace.cc (proc_child): Don't right-shift exit value.Christopher Faylor2012-01-311-4/+3
| | | | (main): Call ExitProcess() to exit exactly the same way as any straced child.
* Clean up whitespace.Christopher Faylor2011-12-171-22/+22
|
* * strace.cc (attach_process): Use NT_SUCCESS to figure out ifChristopher Faylor2011-11-241-3/+7
| | | | | | | | NtSetInformationProcess succeeded. (handle_output_debug_string): Put back DebugActiveProcess since it seems to still be needed (on my system at least). Detect new format _STRACE_INTERFACE_ACTIVATE_ADDR which informs whether this is a forked process or not. Use that to decide if forkdebug should be handled.
* * strace.cc (handle_output_debug_string): Disable code which attempted to addChristopher Faylor2011-11-141-0/+4
| | | | | stuff in between '****' blocks since they no longer are the first thing output by an straced process.
* * Align usage output, version output, as well as usage and versionCorinna Vinschen2011-10-101-30/+21
| | | | | | | | | option handling to use the same style throughout all Cygwin utils. Throughout use program_invocation_short_name to refer to current process name in Cygwin executables. * utils.sgml: Align documentation to above change. Add missing sections for getconf, ldd, and setmetamode. * strace.cc (proc_child): Avoid compiler warning.
* * strace.cc (attach_process): Try to turn off DEBUG_ONLY_THIS_PROCESSJon TURNEY2011-09-151-3/+21
| | | | | | | if Attaching to a process with the trace-children flag set. (handle_output_debug_string): Apparently we don't need to explicitly attach for debugging when a child process starts * Makefile.in (strace.exe): Link with ntdll
* * loadlib.h: New header implementing safe LoadLibrary calls.Corinna Vinschen2010-08-281-0/+1
| | | | | | | | | | | | Include throughout files using LoadLibrary function. * cygcheck.cc (dump_sysinfo): Retrieve kernel32.dll handle via GetModuleHandle, rather than using LoadLibrary. * cygpath.cc (get_long_name): Ditto. (do_sysfolders): Append .dll suffix in LoadLibrary call. * ldh.cc (WinMain): Use LoadLibraryExW with DONT_RESOLVE_DLL_REFERENCES to avoid loading malicious library code. * locale.cc (print_locale_with_codeset): Change way to retrieve kernel32.dll path.
* * strace.cc (mnemonic_table): Add "special" mask option.Christopher Faylor2010-02-221-19/+22
| | | | | (usage): Document it. * utils.sgml: Ditto.
* Update copyrightChristopher Faylor2010-02-191-1/+1
|
* utils/ChangeLog:Christopher Faylor2010-02-191-0/+2
| | | | | | | | | | * strace.cc (mnemonic_table): Add pthread mask option. (usage): Document strace pthread mask option. * utils.sgml: Ditto. cygwin/ChangeLog: * include/sys/strace.h: Remove old code. Add support for ptrace tracing.
* * cygcheck.cc (cygwin_dll_path): New global variable.Corinna Vinschen2009-11-041-0/+2
| | | | | | | | (load_cygwin): Fetch cygwin DLL path and store in cygwin_dll_path. * strace.cc: Full ditto. * path.cc (read_mounts): First use the path stored in cygwin_dll_path, if available. Then fall back to fetching own path. Add comment. Drop printing warnings since they look funny in strace output.
* * strace.cc (main): Open trace output file in UNIX mode.Corinna Vinschen2009-07-151-2/+3
|
* * strace.cc (create_child): Set CYGWIN=noglob when starting new process so thatChristopher Faylor2009-04-221-1/+11
| | | | Cygwin will leave already-parsed the command line alonw.
* * cygcheck.cc (dump_sysinfo): Fix compiler warning in printf.Corinna Vinschen2009-03-241-1/+1
| | | | | * strace.cc (proc_child): Ditto. * ldd.cc: Remove now useless undef wcscasecmp.
* * cygcheck.cc (pathlike::check_existence): Remove class name from declaration.Christopher Faylor2008-09-121-3/+3
| | | | | | | | | | | | | | | | | | | | | (display_internet_error): Use proper format specifier for DWORD. (environ): Remove unneeded declaration. (main): Use brace around nested if to avoid an overly-helpful compiler warning. * dump_setup.cc (parse_filename): Reorganize nested if to avoid an overly-helpful compiler warning. * path.cc (GUID_shortcut): Use braces around part of initializer which needs them. (conv_fstab_spaces): Parenthesize assignment in while loop to avoid a compiler warning. (struct opt): Make static. * ps.cc (main): Reorganize nested if to avoid an overly-helpful compiler warning. * regtool.cc: Make some anonymous structs static to avoid a compiler warning. * ssp.c (lookup_thread_id): Initialize *tix to zero to avoid potential uninitialized use. * strace.cc (add_child): Use proper format specifier for DWORD. (remove_child): Ditto. (proc_child): Ditto.
* * strace.cc (create_child): Don't convert a path from cygwin format unless itChristopher Faylor2007-07-231-1/+2
| | | | has a slash.
* * strace.cc (usage): Add missing description for -q.Christopher Faylor2007-07-101-1/+2
|
* * strace.cc (proc_child): Propagate return code from child process.Christopher Faylor2006-05-241-5/+10
| | | | | (dostrace): Ditto. (main): Ditto.
* *** cygwin DLL Changes:Christopher Faylor2005-12-291-42/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. (child_info::dwProcessId): Delete. (child_info::straced): New variable. (child_info::handle_fork): New member function. * dcrt0.cc (in_forkee): New global variable. (__cygwin_user_data::forkee): Mark as obsolete. (do_global_ctors): Use in_forkee rather than user_data->forkee. (get_cygwin_startup_info): Ditto. Deal with new straced field to allow strace to deal with children of attached processes. (initial_env): Accommodate changes to strace::hello. (child_info_fork::handle_fork): Rename from plain old 'handle_fork'. Move alloc_stack() call elsewhere. (dll_crt0_0): Fill out more of user_data. Reference handle_fork via fork_info. Add some debugging output. (_dll_crt0): Don't wait for sync thread if sync_startup is invalid. Zero sync_startup here. Call alloc_stack() here, if appropriate. (dll_crt0_1): Use in_forkee rather than user_data->forkee. (dll_crt0): Ditto. * malloc_wrapper.cc (malloc_init): Ditto. * dll_init.cc (in_forkee): Remove local static version of this variable. (dll_list::load_after_fork): Don't set in_forkee here. * external.cc (cygwin_internal): Use strace method rather than accessing field directly. * fhandler.cc (fhandler_base::read): Ditto. * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto. * fork.cc (frok::parent): Invoke strace write_childpid to communicate with potential strace. (child_copy): Add more detail to debugging output. * init.cc (calibration_id): New static variable. (prime_threads): Set sync_startup to invalid handle if we already know about thread_func_ix. Use static calibration_id to hold calibration thread id. * munge_threadfunc (munge_threadfunc): Don't try to debug if we don't find threadfunc_ix. (dll_entry): Avoid calling munge_threadfunc and _cygtls::remove on non-cygwin threads invoked during process startup. * pinfo.cc (set_myself): Always call strace.hello here regardless of DEBUGGING. * sigproc.cc (child_info::child_info): Remove spurious handling of dwProcessId. Set straced as appropriate. * spawn.cc (spawn_guts): Rename ciresrv to ch. Invoke strace write_childpid to communicate with potential strace. * strace.cc: Include child_info.h. (strace::hello): Remove inited test. Use active() method to test if strace has been activated. Handle case where we are started before (mypid): New function. (strace::vsprntf): Try to deal more intelligently with case where progname may not be filled out. Put pid in parentheses if it is a windows pid rather than a cygwin pid. myself has been filled out. (strace::write_childpid): New function for notifying strace about the creation of children. (strace::vprntf): Use strace method rather than accessing field directly. (strace_printf): Ditto. (strace::wm): Ditto. * winsup.h (in_forkee): Declare. * include/sys/strace.h (strace::write_childpid): Declare new function. (strace::attached): Define new function. (strace::active): Ditto. (strace::active_val): Ditto. (_STRACE_ON): Delete. (_STRACE_OFF): Ditto. (define_strace0): Use strace method rather than accessing field directly. (strace_printf_wrap): Ditto. (strace_printf_wrap1): Ditto. *** cygwin utils changes: * strace.cc (nprocesses): Make static global. (quiet): New variable. (strace_active): Ditto. (add_child): Increment nprocesses here. Don't add a child if it is already added (windows bug?). Report on child if not quiet. (get_child): Just return NULL if child not found. (remove_child): Report on child if not quiet. (attach_process): Don't complain if given a windows process. Use windows pid in error. (handle_output_debug_string): Issue error if trying to manipulate a process that we don't know about. Handle _STRACE_CHILD_PID - attach to reported child when we get this. (proc_child): Move nprocesses to file scope. Report on exceptions. (longopts): Implement "--quiet". (opts): Implement "-q". (main): Manipulate quiet flag. * utils.sgml (strace): Add words describing '-q'.
* * strace.cc (show_usecs): Renamed from 'usecs'.Christopher Faylor2005-12-051-4/+6
| | | | | | | (main): Use show_usecs rather than usecs. Toggle delta if '-u' is specified. (handle_output_debug_string): Avoid printing microsecond timestamp if show_usecs == 0. * utils.sgml (strace): Add words to describe '-u'.
* revert erroneous checkinChristopher Faylor2005-10-111-5/+2
|
* * Makefile.common (CFLAGS_COMMON): Add -Wstrict-aliasing.Christopher Faylor2005-10-111-2/+5
|
* * cygcheck.cc (load_cygwin): Make half-hearted attempt to work with older DLLs.Christopher Faylor2005-05-271-1/+1
| | | | * strace.cc (load_cygwin): Ditto.
* * cygcheck.cc (cygwin_internal): Define as a "C" function.Christopher Faylor2005-05-171-1/+3
| | | | | * strace.cc (cygwin_internal): Ditto. * cygpath.cc (print_version): Update copyright.
* * cygcheck.cc (load_cygwin): Don't touch $PATH for now.Corinna Vinschen2005-05-151-1/+1
| | | | | (print_version): Fix copyright. * strace.cc (print_version): Ditto.
* * strace.cc (attach_process): Don't call load_cygwin(). Assume that it'sChristopher Faylor2005-05-091-3/+9
| | | | | | already happened. (dotoggle): Ditto. (main): Set argv from cygwin environment, if it exists.
* * strace.cc (handle_output_debug_string): Fix compiler warning.Corinna Vinschen2005-03-071-2/+2
|
* * kill (getsig): Avoid buffer overflow when generating a signal name.Christopher Faylor2005-02-271-2/+2
| | | | * strace.cc (handle_output_debug_string): Make error a little more specific.
* * ps.cc (main): Eliminate use of PID_ZOMBIE.Christopher Faylor2005-01-161-2/+13
| | | | | | | * strace.cc (main): Recognize new option for displaying hex value of strace type. (handle_output_debug_string): Prepend output with hex value of strace message if -H is specified.
* * strace.cc (_impure_ptr): Remove.Corinna Vinschen2004-10-061-6/+0
|
* * Makefile.in (build_dumper): Detect missing iconv library.Christopher Faylor2004-02-211-1/+1
| | | | | | * cygpath.cc (dowin): Report on filename conversion errors. (doit): Ditto. * strace.cc (main): Use symbolic constant for _STRACE_ALL when setting mask.
* * strace.cc (opts): Add leading '+' to force posixly correctCorinna Vinschen2004-02-111-6/+1
| | | | | behaviour. (main): Revert POSIXLY_CORRECT manipulations.
* * strace.cc (main): Guard against previous setting of POSIXLY_CORRECT.Christopher Faylor2004-02-111-1/+5
|
* * strace.cc: Update copyrights.Christopher Faylor2004-02-101-2/+2
| | | | * cygcheck.cc: Update copyrights.
* * strace.cc (main): Ensure POSIXLY_CORRECT argument ordering.Christopher Faylor2004-02-101-0/+1
| | | | * cygcheck.cc (main): Ditto.
* * cygcheck.cc (usage) Add description output.Joshua Daniel Franklin2003-04-261-0/+2
|
* * Makefile.in (strace.exe): Include mingw_getopt.o in link line.Christopher Faylor2003-03-041-3/+5
| | | | | | | | * cygcheck.cc (print_version): Update copyright. * strace.cc (print_version): Ditto. (main): Allow cygwin paths for -o option. (create_child): Allow cygwin path as argv[0]. * path.cc (path.cc): Allow UNC paths.
* * mount.cc (usage): Correctly report default mode.Christopher Faylor2002-10-191-2/+2
|
* Add final newlines to utilsJoshua Daniel Franklin2002-09-151-1/+2
|
* * strace.cc (main): Make toggle a local variable.Christopher Faylor2002-06-071-1/+1
|
* * strace.cc (toggle): New global variable.Christopher Faylor2002-06-071-18/+48
| | | | | | | | | | | | | (error): Use exit instead of ExitProcess so that stdio buffers get flushed. (create_child): Remove command line error checking. (dostrace): Ditto. (dotoggle): New function. (usage): Add entry for new option -T|--toggle. Alphabetize. (longopts): Add new option -T|--toggle. (opts): Ditto. (main): Handle new -T|--toggle option. Move all command line checking here from other functions. * utils.sgml: Update section for strace.
* * strace.cc (version): New global variable.Christopher Faylor2002-06-061-20/+43
| | | | | (usage): Accomodate stdout output. (print_version): New function.
* * strace.cc (forkdebug): Make true by default.Christopher Faylor2002-06-021-8/+10
| | | | | | (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)
* * strace.cc (attach_process): Don't tell process to start stracing here.Christopher Faylor2002-05-271-3/+8
| | | | | | (proc_child): Do it here, instead, after first debug event. This should work around inexplicable races with DebugActiveProcess. (dostrace): Pass any pid argument to proc_child.
* * strace.cc (add_child): Use calloc since new requires working libstdc++.a.Christopher Faylor2002-05-181-2/+2
| | | | (fhandler_disk_file::fstat): Ditto for delete/free.
* update copyrightChristopher Faylor2002-02-251-2/+2
|
* * strace.cc (attach_process): Change CW_STRACE_ON to CW_STRACE_TOGGLE.Christopher Faylor2002-02-141-1/+1
|
* * Makefile.in (MINGW_INCLUDES): Change cygwin include.Christopher Faylor2002-01-291-34/+90
| | | | | | | | | | | | | * strace.cc: Use specific cygwin includes, as required. (load_cygwin): New function. Loads cygwin DLL, if necessary. (attach_process): Attaches strace to a running process. (dostrace): Accept pid argument. Attach to pid if supplied. (usage): Describe -p option. Correct system description. (longopts): Alphabetize. (opts): Ditto. (main): Ditto. Handle -p option. * Makefile.in (CXXFLAGS): Ensure that important settings are preserved even when overriden by command line.
* * Makefile.in: Build intermediate cygcheck.o to force use of MINGW_CXXFLAGS.Christopher Faylor2002-01-221-3/+2
| | | | | | | | * cygcheck.cc (cygwin_info): Intitialize variable to quiet g++ warning. (dump_sysinfo): Make variables unsigned to quiet g++ warnings. * strace.cc (version_string): Rename from SCCSid. (add_child): Remove unused variable. (version): Use version_string. Avoid use of fprintf.
* * cygcheck.cc (usage): Add -c description.Christopher Faylor2001-12-041-14/+13
| | | | | * cygpath.cc (usage): Alphabetize options. * strace.cc (usage): Ditto.