summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* * winsup.h (cygwin_hmodule): Declare.Christopher Faylor2006-02-231-8/+12
| | | | | | | | | * exceptions.cc (inside_kernel): Reverse return values to reflect function name. Return true if we're in cygwin1.dll or if we're executing in dll_entry. (_cygtls::interrupt_now): Reflect reversal of inside_kernel return value. * hookapi.cc (cygwin_hmodule): Remove declaration. * init.cc (dll_entry): Use in_dllentry global to record that we are executing in dllentry.
* * exceptions.cc (_cygtls::interrupt_now): Reorder conditionalCorinna Vinschen2006-02-221-1/+1
| | | | to call inside_kernel only if this isn't locked.
* * exceptions.cc (stackdump): Avoid dumping more than once.Christopher Faylor2006-02-201-1/+4
|
* * cygwin.din: Export sigignore and sigset.Corinna Vinschen2006-02-161-0/+44
| | | | | | | | | * exceptions.cc (sigset): New function. (sigignore): New function. * include/cygwin/signal.h (SIG_HOLD): Define. (sigignore): Declare. (sigset): Declare. * include/cygwin/version.h: Bump API minor number to 154.
* Always zero all elements of siginfo_t throughout.Christopher Faylor2006-02-061-25/+47
| | | | | | | | | | | | | | | | | | | | | | | | | * cygtls.h (_cygtls::thread_context): Declare new field. (_cygtls::thread_id): Ditto. (_cygtls::signal_exit): Move into this class. (_cygtls::copy_context): Declare new function. (_cygtls::signal_debugger): Ditto. * cygtls.cc (_cygtls::init_thread): Fill out thread id field. * exceptions.cc (exception): Change message when exception info is unknown. Copy context to thread local storage. (_cygtls::handle_exceptions): Avoid double test for fault_guarded. Reflect move of signal_exit to _cygtls class. (sigpacket::process): Copy context to thread local storage. (_cygtls::signal_exit): Move to _cygtls class. Call signal_debugger to notify debugger of exiting signal (WIP). Call stackdump here (WIP). (_cygtls::copy_context): Define new function. (_cygtls::signal_debugger): Ditto. * tlsoffsets.h: Regenerate. * include/cygwin.h (_fpstate): New internal structure. (ucontext): Declare new structure (WIP). (__COPY_CONTEXT_SIZE): New define. * exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field when there is no sigwaiting thread. (setup_handler): Move event handling into interrupt_setup.
* * exceptions.cc (inside_kernel): Fix to return true if we can't get the name ofChristopher Faylor2006-01-271-1/+1
| | | | the DLL for the given memory block since we are not in kernel code.
* add copyrightChristopher Faylor2006-01-021-1/+1
|
* * exceptions.cc (sigpacket::process): Pass actual reference to signal'sChristopher Faylor2006-01-011-2/+3
| | | | sigaction structure to setup_handler.
* * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.Christopher Faylor2006-01-011-0/+2
| | | | | * include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK. * dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
* * exceptions.cc (_cygtls::handle_exceptions): Drop redundant `break'.Corinna Vinschen2005-12-271-1/+0
|
* * exceptions.cc (inside_kernel): Rename from interruptible.Corinna Vinschen2005-12-271-3/+3
| | | | Accommodate change throughout file.
* * exceptions.cc (interruptible): New function, code stripped fromCorinna Vinschen2005-12-271-28/+64
| | | | | | | | | | _cygtls::interrupt_now. (_cygtls::handle_exceptions): Handle STATUS_DATATYPE_MISALIGNMENT as SIGBUS error. Differ between unmapped memory (SEGV_MAPERR) and access violation (SEGV_ACCERR) in case of STATUS_ACCESS_VIOLATION. Write kernel log message in case of uncatched STATUS_ACCESS_VIOLATION. (_cygtls::interrupt_now): Just call interruptible now instead of evaluating interruptibility here.
* * cygtls.cc (_cygtls::handle_threadlist_exception): Make an error fatal.Christopher Faylor2005-12-231-7/+7
| | | | | | | | | | | | | | | | | | | | | * cygtls.h (sockaddr_in): Use header rather than defining our own structure. * exceptions.cc (_cygtls::interrupt_setup): Use exact contents of sa_mask rather than assuming tht current sig should be masked, too. (_cygtls::call_signal_handler): Use more aggressive locking. * gendef (_sigbe): Wait until later before releasing incyg. (_sigreturn): Remove more arguments to accommodate quasi-sa_sigaction support. (_sigdelayed): Push arguments for sa_sigaction. More work needed here. * signal.cc (sigaction): Implement SA_NODEFER. * tlsoffsets.h: Regenerate. * sigproc.cc (wait_sig): Use default buffer size of Windows 9x complains. * pinfo.cc (_onreturn::dummy_handle): Remove. (_onreturn::h): Make this a pointer. (_onreturn::~_onreturn): Detect whether pointer is NULL rather than value is NULL. (_onreturn::_onreturn): Set h to NULL initially. (_onreturn::no_close_p_handle): Set h to NULL. (winpids::add): Initialize onreturn with value from p.hProcess immediately.
* whitespace cleanup to force snapshot.Christopher Faylor2005-12-221-7/+7
|
* * cygtls.h (_cygtls::interrupt_now): Subsume interruptible().Christopher Faylor2005-12-201-18/+20
| | | | | | (interruptible): Delete. (setup_handler): Remove interruptible call and just use return from interrupt_now.
* * winsup.h (child_copy): Change prototype to match new functionality.Christopher Faylor2005-12-171-11/+6
| | | | | | | | | | | | | | | | | | | | | | | * cygheap.cc (cygheap_fixup_in_child): Accommodate new child_copy arguments. * dcrt0.cc (dll_data_start): Move definition here from fork. (dll_data_end): Ditto. (dll_bss_start): Ditto. (dll_bss_end): Ditto. (handle_fork): New function. Called when forked to deal with fork issues and copy data to this process from the parent. (dll_crt0_0): Call handle_fork when _PROC_FORK condition. (dll_crt0): Don't copy user_data when we've forked. Don't zero first element of main_environment ever. (cygwin_dll_init): Ditto. * fork.cc (child_copy): Rename from fork_copy and change arguments so that each pair of things to copy gets its own descriptor. (frok::child): Remove fixup_mmaps_after_fork call here. Move to handle_fork in dcrt0.cc. (frok::parent): Use child_copy rather than fork_copy and accommodate changes in parameters. * exceptions.cc (setup_handler): Delay test of whether we're locked until after GetThreadContext has been called since there are apparently cases where SuspendThread does not cause an immediate thread suspension.
* * exceptions.cc (_cygtls::handle_exceptions): In case of aCorinna Vinschen2005-12-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STATUS_ACCESS_VIOLATION, check if the page is a mmaped page beyond a file's EOF. Generate SIGBUS instead of SIGSEGV then. * mmap.cc (__PROT_ATTACH): New define. (__PROT_FILLER): Ditto. (fh_anonymous): Rename from fh_paging_file; (fh_disk_file): New global static variable. (attached): New inline function. (filler): Ditto. (gen_create_protect): Split off from gen_protect to use the file's access mode to create mapping always with maximum allowed protections. (gen_protect): Accomodate pages attached beyond EOF. Use symbolic values instead of numerics when possible. Drop create parameter. (gen_access): Use file's access mode instead of protection. (CreateMapping9x): Create named mapping names so that different creation access modes result in different mappings. (CreateMappingNT): Only reserve attached pages, don't commit them. (MapViewNT): Ditto. Set AT_ROUND_TO_PAGE for all non-NULL base addresses. (mmap_func_t): Define CreateMapping and MapView function pointers with additional openflags parameter. (class mmap_record): Add openflags member. (mmap_record::mmap_record): Add openflags parameter. (mmap_record::get_openflags): New accessor. (mmap_record::attached): Call global attached function. (mmap_record::filler): Call global filler function. (mmap_record::gen_create_protect): Call global gen_create_protect function. (mmap_record::gen_protect): Drop create parameter. (mmap_record::alloc_fh): Set fhandler's access flags. (list::search_record): Accomodate filler pages. (list::set): Use inode number as hash value. (map::get_list_by_fd): Check hash value against file's inode number. (mmap_is_attached_page): New function to evaluate if a given address is on a attached page. Called from _cygtls::handle_exceptions. (mmap_worker): New function to do mapping and bookkeeping in a single call. (mmap64): Use roundup2 to round length to pagesize alignment. Initialize global fhandlers. Simplify anonymous initialization. Add SUSv3 compatible check of file open mode vs. requested protection. Try creating new file handles to allow maximum page protection. Allow creating attached pages in case of mapping beyond EOF. Close new file handle if one has been created. (munmap): Align len to pagesize. (msync): Rework argument checks. Align len to pagesize. (mprotect): Ditto. Accomodate attached pages. (mlock): Use roundup/rounddown macros instead of homemade expressions. (munlock): Add page alignment as in mlock. (fhandler_dev_zero::munmap): Fix unmapping of non-private mappings. (fhandler_dev_zero::fixup_mmap_after_fork): Accomodate filler pages. (fixup_mmaps_after_fork): Don't fail if attached pages couldn't be created in child. Avoid superfluous call to VirtualFree. Check for original allocation protection to fix PAGE_WRITECOPY protection. * ntdll.h: Revert deletion of AT_ROUND_TO_PAGE define. * winsup.h (mmap_is_attached_page): Declare.
* Remove unneeded whitespace.Christopher Faylor2005-12-051-11/+11
| | | | | | | | | | | | | | | | | * cygtls.cc (_cygtls::set_state): Delete. (_cygtls::reset_exception): Ditto. (_cygtls::init_thread): Set initialized state directly here. (_cygtls::push): Remove exception argument. Don't treat exceptions specially. * cygtls.h (_cygtls::push): Ditto. (_cygtls::isinitialized): Don't treat exceptions specially. (_cygtls::reset_exception): Delete. (_cygtls::set_state): Ditto. (_cygtls::handle_exceptions): Don't push ebp on the stack prior to calling sig_send. Just set incyg instead. (_cygtls::interrupt_setup): Accommodate _cygtls::push argument change. (_cygtls::interrupt_now): Ditto. (setup_handler): Don't treat exceptions specially. * gendef (longjmp): Always zero incyg flag.
* * include/exceptions.h (exception_list): Revert previous change. WindowsChristopher Faylor2005-12-031-3/+4
| | | | | | | | | | | | | | | | doesn't care. (exception_handler): Use real exception_list parameter type rather than void * * tlsoffsets.h: Regenerate. * cygtls.h (_cygtls::handle_exceptions): Use real exception_list parameter type rather than void *. (handle_threadlist_exception): Ditto. (init_exception_handler): Ditto. * cygtls.cc (_cygtls::handle_threadlist_exception ): Ditto. (_cygtls::init_exception_handler): Add kludge to terminate linked list with a loop, which seems to solve problem of RtlUnwind causing problems * exceptions.cc (rtl_unwind): Use real exception_list parameter type rather than void *. (_cygtls::handle_exceptions): Ditto.
* * cygtls.h (_cygtls::el): New field.Christopher Faylor2005-12-031-44/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (_cygtls::handle_exceptions): New function declaration. (_cygtls::handle_threadlist_exception): Ditto. (_cygtls::init_exception_handler): Ditto. (_cygtls::init_threadlist_exceptions): Remove arg from declaration. * cygtls.cc (_cygtls::call2): Don't initialize exceptions here. (_cygtls::init_thread): Do it here instead and use member function. (_cygtls::handle_threadlist_exception): Move into _cygtls class. (_cygtls::init_exception_handler): Ditto. Rely on existence of 'el' memmber in _cygtls. (_cygtls::init_threadlist_exceptions): Ditto. * dcrt0.cc (dll_crt0_1): Remove exception_list definition and setting since it now commonly resides in the tls. * exceptions.cc (init_exception_handler): Move to cygtls.cc. (init_exceptions): Ditto. (rtl_unwind): New, safe wrapper function for RtlUnwind. (_cygtls::handle_exceptions): Move to _cygtls. Call rtl_unwind to unwind frames and eliminate copying of structures. Put address of failing instruction in si_addr, not the address on the stack. Return 0 to indicate that we've handled this exception. * external.cc (cygwin_internal): Make CW_INIT_EXCEPTIONS a no-op. * sigproc.cc (wait_sig): Accommodate argument change to _cygtls::init_threadlist_exceptions. * tlsoffsets.h: Regenerate. * include/exceptions.h (exception_list): Add more stuff to the exception list. Apparently windows needs this? (init_exceptions): Remove bogus declaration. * include/cygwin/signal.h (SI_USER): Redefine as zero as per SUSv3. * thread.cc (pthread_kill): Set si_pid and si_uid. * timer.cc (timer_thread): Set si_code to SI_TIMER.
* * exceptions.cc (handle_exceptions): Translate a guard page exception to aChristopher Faylor2005-12-011-1/+5
| | | | "SIGBUS".
* * heap.cc: Remove spurious getpagesize declaration.Christopher Faylor2005-11-251-1/+6
| | | | | * exceptions.cc (ctrl_c_handler): Distinguish CTRL-BREAK from CTRL-C in some cases.
* * include/sys/elf64.h: Fix types to reflect linux usage.Christopher Faylor2005-11-141-0/+2
|
* * include/sys/cygwin.h: Define CYGWIN_SIGNAL_STRING.Christopher Faylor2005-11-011-5/+6
| | | | | * exceptins.cc (sigpacket::process): Send a _CYGWIN_SIGNAL_STRING to gdb if the process is being debugged. A WIP.
* * exceptions.cc (signal_exit): Eliminate setting of main thread priority sinceChristopher Faylor2005-10-291-4/+2
| | | | | | | | process lock should make that unnecessary. * fork.cc (stack_base): Eliminate. (frok::parent): Subsume stack_base and just set stack stuff here. Report on priority class in debugging output. * spawn.cc (spawn_guts): Report on priority class in debugging output.
* Change process_lock to lock_process throughout. Change all calls to newChristopher Faylor2005-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | cygthread to handle extra argument, throughout. * cygthread.h (cygthread::callproc): Declare new method. (cygthread::cygthread): Add optional length argument to allow copying arguments to executing thread. * cygthread.cc (cygthread::callproc): Define new method. (cygthread::stub): Use callfunc to invoke thread func to allow potentially allocating stack memory which will be returned. (cygthread::simplestub): Ditto. (cygthread::cygthread): Accept arglen argument. Reset ev here prior to activating thread. Wait for ev after activating thread if we're copying contents to the thread. Wait until the end before setting h, to allow thread synchronization. (cygthread::release): Don't reset ev here. Rely on that happening the next time the thread is activated. * pinfo.h (commune_process): Rename declaration from _pinfo::commune_process. * pinfo.cc (commune_process): Ditto for definition. Modify slightly to allow running as a separate cygthread. * sigproc.cc (child_info::sync): Always wait for both subproc_ready and any hProcess if we have a cygwin parent. (talktome): Change argument to be a pointer to siginfo_t. Contiguously allocate whole siginfo_t structure + any needed extra for eventual passing to commune_process thread. (wait_sig): Accommodate change in talktome argument. * pipe.cc (fhandler_pipe::fixup_after_exec): Remove debugging.
* * cygheap.h (class process_lock): New class.Christopher Faylor2005-10-031-1/+5
| | | | | | | | | | | | | | | * dtable.h (class dtable): Add class process_lock as a friend. * dcrt0.cc (get_exit_lock): Delete. (do_exit): Use process_lock class instead of get_exit_lock. * exceptions.cc (signal_exit): Ditto. * pinfo.cc (pinfo::exit): Ditto. (_pinfo::commune_process): Set process lock around this whole function. (_pinfo::commune_request): Use process_lock rather than myself.lock. * pinfo.h (pinfo::_lock): Delete. (pinfo::initialize_lock): Delete. (pinfo::lock): Delete. (pinfo::unlock): Delete. * winsup.h (get_exit_lock): Delete declaration.
* * dcrt0.cc (get_exit_lock): Use myself.lock rather than exit_lock.Christopher Faylor2005-10-021-3/+0
| | | | | | | | | | * exceptions.cc (exit_lock): Delete. (events_init): Don't init exit_lock. * (_pinfo::commune_process): Add per-PICOM debugging. * sigproc.cc (talktome): Add some temporary debugging statements. * fhandler_proc.cc (format_proc_cpuinfo): Cosmetic change. (format_proc_partitions): Ditto. * syscalls.cc (locked_append): Ditto.
* * dcrt0.cc (do_exit): Don't set ES_SET_MUTO here. Call get_exit_lock()Christopher Faylor2005-09-301-3/+9
| | | | | | | | | | | | instead. (get_exit_lock): New function. Grabs the lock and sets initial exit_state. * exceptions.cc (try_to_debug): Use low_priority_sleep. (sigpacket::process): Avoid handler if this is an exec stub. (signal_exit): Use get_exit_lock rather than manipulating the exit_lock critical section directly. * pinfo.cc (pinfo::exit): Ditto. * winsup.h (get_exit_lock): Declare. (exit_lock): Delete declaration.
* * exceptions.cc (_cygtls::call_signal_handler): Minor cleanup.Christopher Faylor2005-09-261-3/+5
|
* * exceptions.cc (handle_exceptions): Just si_code to SI_KERNEL first and let itChristopher Faylor2005-09-261-5/+10
| | | | | | | | | | be overridden. * exceptions.cc (_cygtls::call_signal_handler): Call signal handler with extra siginfo_t * and void * parameters when SA_SIGINFO flag is set. * signal.cc (signal): Clear SA_SIGINFO flag. (sigqueue): Fix incorrect setting of si_code. * sigproc.cc (signal_fixup_after_exec): Clear SA_SIGINFO flag when setting handler to SIG_DFL.
* * exceptions.cc (handle_exceptions): Properly fill out si_code.Christopher Faylor2005-09-261-13/+14
|
* Semi-reversion of always-exit-from-sigthread change of 2005-09-15.Christopher Faylor2005-09-231-6/+3
| | | | | | | | | | | | | * exceptions.cc (sigpacket::process): Eliminate return after call to reinstated noreturn function. (signal_exit): Allow function to exit when a captive process has been terminated. * pinfo.cc (pinfo::exit): Enter exit_lock here. Once again exit here under control of exit_lock. * sigproc.cc (sig_send): Don't wait for completion if process is exiting. Remove special __SIGEXIT accommodations. (wait_sig): Just exit the thread when a __SIGEXIT has been detected. Don't exit the process.
* * cygheap.cc (cygheap_fixup_in_child): It's not just for exec.Christopher Faylor2005-09-231-0/+1
| | | | | | | | | | | | | | * cygtls.h (struct _cygtls::thread_handle): New field. * dcrt0.cc (exit_lock): Remove declaration. * winsup.h (exit_lock): Add declaration. * exceptions.cc (sigpacket::process): Properly return after signal_exit. * pinfo.cc (pinfo::exit): Only exit the process if _my_tls.thread_handle has not been filled out -- which should be an impossible event. * sigproc.cc (sigproc_terminate): Fillout _my_tls.thread_handle to provide something for wait_sig to wait for. Use the siginfo_t version of sig_send and fill out the tls argument with _my_tls. (wait_sig): Wait for the thread specified in pack.tls or (for now) complain bitterly if it doesn't exit.
* * dcrt0.cc (do_exit): Only call sigproc_terminate from one location --Christopher Faylor2005-09-201-9/+11
| | | | | | | | | | | | | | | | | | pinfo::exit. * pinfo.cc (pinfo::exit): Move sigproc_terminate later so that signals can be processed while waiting for hExeced child. (pinfo::maybe_set_exit_code_from_windows): Set exit code from sigExeced if it is non-zero. Set exit_state to ES_EXEC_EXIT prior to waiting for captive process exit code. * exceptions.cc (sigExeced): New global variable. (signal_exit): Remove noreturn attribute from declaration. (signal_exit): Just terminate captive process and return if hExeced on the theory that the exit will be subsequently handled in the main thread. * sigproc.cc (sigproc_terminate): Eliminate test for ES_SIGPROCTERMINATE and use ES_FINAL instead. (sig_send): Use no_signals_available instead of duplicate test. * winsup.h (ES_EXEC_EXIT): New enum. (ES_SIGPROCTERMINATE): Delete.
* * exceptions.cc (sigtid): Remove declaration.Christopher Faylor2005-09-141-4/+2
| | | | | | | | | | | | | | | | | | | | | | | (handle_exceptions): Use _sig_tls rather than sigtid to determine if this is the signal thread. (set_signal_mask): Ditto for conditionalized CGF code. * pinfo.cc (pinfo::exit): Exit the thread if we forcefully terminated the main thread * sigproc.cc (sigtid): Delete. (_sig_tls): Define. (sig_clear): Use _sig_tls rather than sigtid to determine if this is the signal thread. (sig_dispatch_pending): Ditto. (wait_sig): Set _sig_tls here. * dcrt0.cc (do_exit): Move sigproc_terminate call later since signal handling was still needed for subsequent stuff. Call sigproc_terminate with new exit_state value. * pinfo.cc (pinfo::exit): Call sigproc_terminate with new exit_state value. * sigproc.cc (proc_terminate): Remove unnecessary (void) parameter. (sigproc_terminate): Ditto. Add new argument to accept exit state to be set. (wait_sig): Reorganize __SIGEXIT handling. Add more debugging output. * winsup.h (sigproc_terminate): Declare with new exit_state argument. (exit_states): Reorganize to reflect new exit ordering of sigproc_terminate.
* * dcrt0.cc (do_exit): Rely on sigproc_terminate to set exit_stateChristopher Faylor2005-09-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appropriately. * pinfo.cc (pinfo::exit): Always call sigproc_terminate here. Rely on sigproc_terminate to signal signal thread to handle eventual process exit. * sigproc.cc (no_signals_available): Change criteria for determining if this process can handle signals to itself. (my_sendsig): New variable. Copy of my sendsig handle. (proc_can_be_signalled): Don't send signals if exit code is set. (sigproc_terminate): Use and set exit_state appropriately to determine when to do anything. Send __SIGEXIT to self to control process exit. (sig_send): Use my_sendsig for sending signals. Don't call proc_can_be_signalled for myself since the criteria is now different for sending signals to myself. (wait_sig): Copy myself->sendsig to my_sendsig for future use. Exit signal loop when __SIGEXIT is received. Wait for main thread to exit and use its exit status to actually exit process. * sigproc.h (__SIGEXIT): New enum. * dcrt0.cc (alloc_stack): Eliminate superfluous "return;". * debug.cc (add_handle): Ditto. * devices.in (device::parse): Ditto. * dtable.cc (dtable::vfork_parent_restore): Ditto. (dtable::vfork_child_fixup): Ditto. * environ.cc (parse_options): Ditto. * errno.cc (seterrno_from_win_error): Ditto. * exceptions.cc (sig_handle_tty_stop): Ditto. (set_signal_mask): Ditto. * fhandler.cc (fhandler_base::read): Ditto. (fhandler_base::operator delete): Ditto. (fhandler_base::seekdir): Ditto. (fhandler_base::rewinddir): Ditto. * fhandler_console.cc (fhandler_console::read): Ditto. (fhandler_console::fixup_after_exec): Ditto. * sigproc.cc (sigproc_init): Ditto. (sigproc_terminate): Ditto. * devices.cc: Regenerate.
* * exceptions.cc (ctrl_c_handler): Disable any special CTRL_LOGOFF_EVENTCorinna Vinschen2005-09-081-0/+14
| | | | handling and add longish comment about the reasons.
* * dcrt0.cc (initial_env): Don't attempt stracing if dynamically loaded.Christopher Faylor2005-09-071-2/+12
| | | | | | | | | | | | | | | (dll_crt0_0): Move console initialization earlier. * init.cc (dll_entry): Move console initialization here. * exceptions.cc (init_console_handler): Fully remove any old console handler. * spawn.cc (spawn_guts): Don't fill out windows argv if we've deduced that this is a cygwin-using program. (av::fixup): Always check executables to see if they are using cygwin1.dll. Don't consider .com files to be scripts. * hookapi.cc (rvadelta): New function. (PEHeaderFromHModule): Simplify slightly. (hook_or_detect_cygwin): Use passed in name argument for "HMODULE" rather than incorrectly reading current program. Calculate delta needed to read image data and file names if this isn't a real "HMODULE".
* Grr. REVERT erroneous checkin. AGAIN.Christopher Faylor2005-09-021-8/+1
|
* * Makefile.in (CXXFLAGS): Use 'override' to correctly set flags to generateChristopher Faylor2005-09-021-1/+8
| | | | dependencies when invoked from top-level make.
* revert inexplicable previous checkinChristopher Faylor2005-09-021-8/+1
|
* bad_addressesChristopher Faylor2005-09-021-1/+8
|
* * exceptions.cc (set_process_mask_delta): Conditionalize debugging output.Christopher Faylor2005-08-291-0/+2
| | | | * sigproc.cc (proc_subproc): Make strace output a little more verbose.
* * cygtls.h (__ljfault): Declare.Christopher Faylor2005-08-281-1/+3
| | | | | | | | (_cygtls::return_from_fault): Use __ljfault. * exceptions.cc (set_signal_mask): Revert previous checkin. * gendef (__sjfault): Split out into a separate function which doesn't bother with any special signal locking. routines. (_ljfault): Return from a __sjfault without bothering with signals.
* * cygwin.din: Correct readdir_r typo.Christopher Faylor2005-08-281-1/+1
|
* * exceptions.cc (handle_sigsuspend): Just sleep forever if called from non-mainChristopher Faylor2005-08-251-16/+21
| | | | | | | | thread. (sigpacket:process): Simplify logic which determines when and how a signal is masked. Don't trigger sigwait if there is a signal handler. * sigproc.cc (wait_sig): Update comment. Try to process a signal which is in the queue if it isn't queued for the target thread (this is still not right).
* * sigproc.h (set_signal_mask): Remove default on second parameter and make passChristopher Faylor2005-08-231-7/+7
| | | | | | | | | | | | | | | | by reference. * signal.cc (abort): Accommodate change to set_signal_mask. * select.cc (pselect): Ditto. * exceptions.cc (handle_sigsuspend): Ditto. (ctrl_c_handler): Ditto. (sighold): Ditto. (sigrelse): Ditto. (set_process_mask_delta): Ditto. (_cygtls::call_signal_handler): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::readdir): Return ENMFILE if __handle is not set. Set __handle to NULL when out of files. (fhandler_disk_file::rewinddir): Don't close handle if it's NULL. (fhandler_disk_file::closedir): Ditto.
* * child_info.h (child_info::sync): Pass pid and HANDLE rather than using pinfo.Christopher Faylor2005-07-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | (child_info::child_info): Accept an argument controlling whether to create proc_subproc. (child_info_spawn::child_info_spawn): Ditto. * sigproc.cc (child_info::child_info): Ditto. (child_info_spawn::child_info_spawn): Ditto. (child_info::sync): Use passed in pid and HANDLE. * fork.cc (fork_parent): Reflect additional arguments required for child_info::sync. * hookapi.cc (hook_or_detect_cygwin): Rename. Change so that NULL 'fn' argument just returns "true", indicating that program uses cygwin1.dll. * spawn.cc (av::win16_exe): New element. * spawn.cc (av::iscygwin): New element. (av::fixup): New function. (spawn_guts): Protect against SEGV. Use fixup function to detect when it is safe to wait for a spawned (as opposed to an execed) program. Reflect changes in child_info::sync arguments. * external.cc (cygwin_internal): Reflect function renaming to hook_or_detect_cygwin. * cygheap.cc (cygheap_fixup_in_child): Close handle after debug fixup has been done to prevent false positives in handle collision. * exceptions.cc (try_to_debug): Notify debugger if already being debugged.
* Eliminate (void) cast on standalone function calls throughout.Christopher Faylor2005-07-061-8/+8
|