summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
Commit message (Collapse)AuthorAgeFilesLines
* * exceptions.cc (stack_info::walk): Use method to find offset.Christopher Faylor2000-07-031-21/+29
| | | | | | | | (handle_exceptions): Be more assertive in finding ebp for use under W2K. Create a dummy stack frame for cases where program is dying and a stack dump is being output. (sig_handle): Fill out a GetThreadContext for use with a user-generated "core dump".
* * exceptions.cc: Remove unneeded include.Christopher Faylor2000-06-011-3/+0
| | | | | | * dcrt0.cc: Wrap LoadDLLfunc stuff in dummy function. * init.cc: Ditto. * uinfo.cc: Ditto.
* * Makefile.in: Remove libadvapi32.a.Christopher Faylor2000-05-301-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.h: Add additional field to autoload block for handling unimplemented functions. (LoadDLLfuncEx): New function which accepts additional parameter for controlling unimplemented function behavior. (LoadDLLfunc): Use LoadDLLfuncEx. * dcrt0.cc: Use new arguments for LoadDLLfunc. Add advapi32 routines. (noload): Rewrite in assembler. Handle new unimplemented function type. * exceptions.cc: Eliminate another vestige of StackWalk stuff. * net.cc: Use new arguments for LoadDLLfunc. * uinfo.cc: Ditto. * config.h.in: Remove obsolete define. * path.h (isdrive): New macro. * dcrt0.cc (globify): Use new macro to determine if a string refers to an MS-DOS drive. * environ.cc (winenv): Ditto. * spawn.cc (find_exec): Ditto. * path.cc (get_raw_device_number): Ditto. (mount_info::conv_to_posix_path): Ditto. (chdir): Ditto. (cygwin_posix_path_list_p): Ditto. (cygwin_split_path): Ditto. (path_conv::check): Move tmp_buf to beginning of function since it can be used earlier in the loop. Use tmp_buf rather than 'root' to hold root information. (mount_info::conv_to_win32_path): Add trailing slash to end of mount path when it translates to a drive. Add defensive code to avoid writing beyond the end of 'dst'.
* * exceptions.cc (interruptible): Add an argument to control whether functionChristopher Faylor2000-05-201-37/+58
| | | | | | just checks for validity. Flag module handle == 0 as noninterrupible. (call_handler): Always acquire and release ebp lock. Loop for only a fixed amount of time attempting to grab mutos and find an interruptible PC.
* * path.cc (mount_info::cygdrive_posix_path): Don't add trailing slash ifChristopher Faylor2000-05-171-11/+35
| | | | | | | | | | | | | | | | | | | | | | | | | referring to something like c:\. * dcrt0.cc (dll_crt0_1): Move uinfo initialization prior to sig_send initialization to give signal thread a chance to finish. * debug.cc (WFSO): Move to sigproc.cc (WFMO): Ditto. * exceptions.cc (interruptible): Allocate slightly more space for directory just for paranoia's sake. (call_handler): Eliminate nonmain argument. Determine if main thread has set a frame pointer and use it if so. (sig_handle): Eliminate nonmain argument. * net.cc: Record frame information in appropriate routines throughout. * select.cc (select): Ditto. * sigproc.cc: Use sigthread structure to record mainthread id throughout. (sig_send): Record frame information for signal handler. (wait_sig): Reflect argument change in sig_handle. (WFSO): Move here and record frame information for signal handler. (WFMO): Ditto. * sigproc.h: Implement new "sigthread" class. Implement "sigframe" class for manipulating signal frame info. * thread.cc (__pthread_kill): Use standard _kill() function rather than calling sig_send directly. * winsup.h: Eliminate ebp element from signal_dispatch class.
* * dcrt0.cc (insert_file): Eliminate unused parameter.Christopher Faylor2000-05-071-10/+8
| | | | | | | | | | (build_argv): Ditto. * exceptions.cc (stack): Eliminate unused parameters. (stackdump): Ditto. (cygwin_stackdump): Reflect above changes. (sig_handle): Ditto. * fhandler.cc (fhandler_base::set_inheritance): Use kludge to avoid unused parameter warning.
* * exceptions.cc (interruptible): Allocate slightly more space for directoryChristopher Faylor2000-04-261-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | name check. Windows 95 seems to null-terminate the directory otherwise. (interrupt_on_return): Issue a fatal error if we can't find the caller's stack. * spawn.cc (find_exec): Accept a path_conv argument rather than a buffer so that the caller can find things out about a translated path. (perhaps_suffix): Ditto. (spawn_guts): Allocate path_conv stuff here so that we can find out stuff about the translated path (this is work in progress). * environ.cc (environ_init): Accept an as-yet unused argument indicating whether we were invoked from a cygwin parent or not. (winenv): Ditto. (posify): Accept an argument indicating whether the path has already been translated. * dlfcn.cc (check_access): Provide a path_conv buffer to find_exec. * exec.cc (sexecvpe): Ditto. * path.cc (path_conv::check): Rename from path_conv::path_conv. (mount_item::getmntent): Recognize "Cygwin executable" bit. (symlink_info::check): Remove debugging statements. * path.h (class path_conv): Add iscygexec method. Rewrite constructor to call "check" method to allow multiple operations on a path_conv variable. * pinfo.cc (pinfo_init): Pass argument to environ_init. * shared.h: Bump PROC_MAGIC. * winsup.h: Reflect above changes to function arguments. * include/sys/mount.h: Add MOUNT_CYGWIN_EXEC type.
* * exceptions.cc (handle_exceptions): Search further for stack info toChristopher Faylor2000-04-201-1/+1
| | | | accomodate Windows 95.
* * exceptions.cc (sigsave): Copy on fork so that we can restore correct behaviorChristopher Faylor2000-04-081-17/+28
| | | | | | | | | | | | | in forked process. (interruptible): Flag as interruptible when running in main process module. (interrupt_setup): Save return address and address of return address. (signal_fixup_after_fork): New function. Uses above two values to restore proper behavior to forked process. (interrupt_on_return): Pass return address address to interupt_setup. (interrupt_now): Pass NULL for return address address to interrupt_setup. * fork.cc (fork): Call signal_fixup_after_fork. * shared.h: Lint cleanups. * winsup.h: Ditto.
* Pipe changes throughout suggested by Eric Fifer <EFifer@sanwaint.com>Christopher Faylor2000-03-151-13/+5
| | | | | | | | | | | | | | | | | | | | | * debug.cc (threadname_init): Pass name of lock as arg 2 of new_muto. * malloc.cc (malloc_init): Ditto. * sigproc.cc (sigproc_init): Ditto. * exceptions.cc (events_init): Ditto. (call_handler): Eliminate special case for hExeced. Report locked thread in debugging output. * fhandler.cc (fhandker_pipe::fhandler_pipe): Propagate device type to base class. * fhandler.h (fhandler_pipe): Ditto. * hinfo.cc (hinfo::build_fhandler): Pass specific type of pipe to constructor. * spawn.cc (spawn_guts): Eliminate dependency on signal when waiting for subprocess. * strace.cc: Remove obsolete #ifdef. * sync.cc (muto::muto): Save the name of the muto. (muto:~muto): Also release the muto. * sync.h: Add a muto name field. * select.cc (peek_pipe): Avoid doing a PeekNamedPipe on the write end of a pipe.
* * environ.cc: Eliminate oldstack CYGWIN option.Christopher Faylor2000-03-091-137/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * exceptions.cc (sfta): Eliminate obsolete function. (sgmb): Eliminate obsolete function. (class stack_info): Remove MS method for walking the stack. (stack_info::init): Just initialize required fields. (stack_info::brute_force): Rename to stack_info::walk. (handle_exceptions): Pass derived frame pointer to sig_send. (interrupt_setup): Clear saved frame pointer here. (interrupt_on_return): thestack is no longer a pointer. (call_handler): Accept a flag to indicate when a signal was sent from other than the main thread. Use saved frame pointer for determining where to place signal handler call. (sig_handle): Accept "nonmain" argument. Pass it to call_handler. * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Change debugging output slightly. * (fhandler_tty_common::__release_output_mutex): Ditto. (fhandler_tty_slave::read): Fix a comment, remove a goto. * sigproc.cc (sig_send): Accept an optional frame pointer argument for use when suspending the main process. sigcomplete_main is an autoreset event now. Save frame pointer for non-main operation. (wait_sig): Make sigcomplete_main an autoreset event. Eliminate NOSIGQUEUE. Pass rc to sig_handle to signify if this was a nonmain process. * sigproc.h: Reflect change to sig_send argument. * syscalls.cc (swab): Eliminate swab function since it is now available in newlib. * winsup.h (signal_dispatch): Change CONTEXT cx to DWORD ebp.
* * exceptions.cc (call_handler): Streamline to use only one call toChristopher Faylor2000-03-051-5/+9
| | | | | | ResumeThread. * sigproc.cc (sig_send): Use a muto around the ReleaseSemaphore. Remove priority setting since it didn't solve anything.
* * dcrt0.cc (set_os_type): Record OS name string.Christopher Faylor2000-02-281-43/+28
| | | | | | | | | | | | | | | | | | (getprogname): Eliminate obsolete function. (dll_crt0_1): Move initial strace initialization output to set_myself. * exceptions.cc (interruptible): Add debugging output. (interrupt_setup): New function. (interrupt_now): Use interrupt_setup to set up common interrupt handler stuff. (interrupt_on_return): Ditto. (call_handler): Move signal_arrived arm and clear threads to region where signalled thread is suspended or suffer races. * pinfo.cc (set_myself): Output interesting information when strace is first initialized. Initialize progname here. * sigproc.cc (sig_dispatch_pending): Modify to ensure that flush signal are sent synchronously. * strace.cc (strace_vsprintf): Move code into strace program. * uname.cc (uname): Use 'osname' global to construct cygwin name + Windows type + version.
* * exceptions.cc (interruptible): Make a little more structured.Christopher Faylor2000-02-261-30/+45
| | | | | | | | | | | | | (call_handler): Allow signals to be sent even if signalled thread is stopped. Change order of signal_arrived arming/waiting threads clearing to eliminate a race. (reset_signal_arrived): New helper function. * malloc.cc (malloc_init): Use mutos so that signal handler can keep track of who owns the lock. (__malloc_lock): Ditto. (__malloc_unlock): Ditto. * sync.h (new_muto): Actually use a muto for the "buffer". * Makefile.in: Fix a dependency.
* * exceptions.cc (call_handler): Use new muto linked list to look for allChristopher Faylor2000-02-241-6/+12
| | | | | | | | potential mutos owned by suspended thread. Clear waiting threads while thread is stopped. (proc_subproc): Clarify debugging output. * sync.h (class muto): Add 'next' field. (new_muto): Keep linked list alive.
* Fix final round of gcc warnings relating to unused parameters.Christopher Faylor2000-02-241-9/+21
| | | | | | | | | | | | | | * debug.cc (iscygthread): New function. * debug.h: Declare it. * exceptions.cc (set_process_mask): Flush pending signals. (handle_sigsuspend): No need to flush pending signals. (call_handler): Refine previous tests of muto ownership. Only clear wait()'s when we have definitely responded to a signal. * fhandler_console.cc (fhandler_console::read): Don't set EINTR if executing in a "cygwin" thread. * sigproc.cc (proc_subproc): Use second argument to control whether CLEARWAIT actually sets "signalled" flag. * sync.h (muto): Add 'unstable' method.
* * exceptions.cc (interruptible): Change method for determining if something isChristopher Faylor2000-02-241-13/+70
| | | | | | | | | | | | | | interruptible. (call_handler): Avoid suspending a thread if it owns a mutex. Only set signal_arrived if the thread was actually interrupted. (events_init): Initialize module information needed by interruptible(). (sigdelayed): Don't call sig_dispatch_pending since it could screw up * init.cc (dll_entry): Record module handle of main for use by interruptible(). (proc_subproc): Reorganize handling of terminated child so that the bulk of the processing comes from the signal thread. (wait_sig): Force processing of waiting threads if SIGCHLD is not processed. * sync.cc (muto::release): Set tid == 0 after lock is released or signal processor will be confused.
* Respond to more g++ warnings relating to initializing structures.Christopher Faylor2000-02-231-2/+2
|
* Respond to a multitude of g++ warnings.Christopher Faylor2000-02-211-1/+1
|
* import winsup-2000-02-17 snapshotChristopher Faylor2000-02-171-0/+1066