* exceptions.cc (call_signal_handler): Only bother to construct
the ucontext for signal handlers with SA_SIGINFO set. Set
mcontext.oldmask.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* exceptions.cc (call_signal_handler): Zero initialize context and set
context flags, as RlCaptureContext doesn't.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Selectively using -fomit-frame-pointer when -O is used doesn't make sense
anymore, apparently since gcc 4.6, -O implies -fomit-frame-pointer.
exceptions.cc must be compiled with -fno-omit-frame-pointer on x86, as it uses
RtlCaptureContext, which requires a frame pointer.
* Makefile.in : Remove setting -fomit-frame-pointer for compiling
various files, it is already the default. Set
-fno-omit-frame-pointer for exceptions.cc on x86.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of
"readlen" not to use "bytes_in_pipe" value directly.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* faq-setup.xml: Document how Cygwin secures installation and
update against man-in-the-middle (MITM) attacks. Note that
setup embeds a public key to check the signature of setup.ini,
and that setup.ini includes SHA-512 cryptographic hashes.
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
On x86_64, RtlCaptureContext() uses fxsave to save FPU/MMX/SSE state.
fxsave requires that the destination address is 16-byte aligned, or it will
fault.
CONTEXT is already annotated __attribute__ ((aligned (16))), do the same with
struct _mcontext.
Rearrange ucontext_t so that it's struct _mcontext element is also correctly
aligned.
* include/cygwin/signal.h (struct __mcontext): 16-byte align.
* include/sys/ucontext.h (ucontext_t): Ditto.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* include/cygwin/types.h: Include sys/_stdint.h rather than stdint.h.
* include/stdint.h: Drop in favor of newlib version.
* include/inttypes.h: Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Add ucontext.h header, defining ucontext_t and mcontext_t types.
Provide sigaction sighandlers with a ucontext_t parameter, containing stack and
context information.
* include/sys/ucontext.h : New header.
* include/ucontext.h : Ditto.
* exceptions.cc (call_signal_handler): Provide ucontext_t
parameter to signal handler function.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* external.cc (cygwin_internal): Add operation to retrieve a copy
of the EXCEPTION_RECORD from a siginfo_t *.
* include/sys/cygwin.h (cygwin_getinfo_types): Ditto.
* exception.h (cygwin_exception): Add exception_record accessor.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
* include/cygwin/signal.h : Rename struct ucontext to struct
__mcontext. Fix layout differences from the Win32 API CONTEXT
type. Remove unused member _internal. Rename member which
corresponds to ContextFlags. Add cr2 member.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
winsup/cygwin/
* common.din (__gnu_basename): Export.
* path.cc (__gnu_basename): New function.
winsup/doc/
* posix.xml (std-gnu): Add basename.
(std-notes): Add note about two forms of basename.
* cygheap.h (cygheap_domain_info::add_domain): Add prototype.
* uinfo.cc (cygheap_domain_info::add_domain): New method.
(pwdgrp::fetch_account_from_windows): Try to add domain explicitely
if it was not in the original list of trusted domains and go ahead
rather than bailing out. Add comment to explain why.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT.
* exceptions.cc (_cygtls::signal_debugger): Use sizeof (CONTEXT) for
size of CONTEXT copied for GDB's digestion.
* include/cygwin/signal.h: Add a preliminary comment.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* tty.h (class tty_min): Remove variable "write_error" to which any
errors are not currently set at anywhere.
(class tty): Add variable "column" for handling ONOCR.
* tty.cc (tty::init): Add initialization code for variable "column".
* fhandler.h (class fhandler_pty_master): Remove variable "need_nl"
which is not necessary any more. "need_nl" was needed by OPOST process
in fhandler_pty_master::process_slave_output().
(class fhandler_pty_common): Add function process_opost_output() for
handling post processing for OPOST in write process.
* fhandler_tty.cc (fhandler_pty_master::process_slave_output): Count
TIOCPKT control byte into length to be read in TIOCPKT mode. Move
post processing for OPOST to write process. Remove code related to
variable "write_error". Return with EIO error if slave is already
closed.
(fhandler_pty_master::fhandler_pty_master): Remove initialization
code for variable "need_nl".
(fhandler_pty_common::process_opost_output): Add this function for
handling of OPOST in write process. Add code to avoid blocking in
non-blocking mode when output is suspended by ^S.
(fhandler_pty_slave::write): Call fhandler_pty_common::
process_opost_output() instead of WriteFile(). Remove code related to
variable "write_error".
(fhandler_pty_master::doecho): Call fhandler_pty_common::
process_opost_output() instead of WriteFile().
* select.cc (peek_pipe): Remove code related to variable "need_nl".
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Per glibc BZ #15366:
* inttypes.h: Drop __STDC_FORMAT_MACROS consideration.
* stdint.h: Drop __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS
consideration.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
By default, docdir and htmldir are defined in terms of prefix, so make sure to
define it, so their values are prefix-relative.
Without this, 'make install' installs the documentation into /share/doc/ unless
configured otherwise.
* Makefile.in (prefix): Define.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This improves how stackinfo::dumpstack() dumps _sigbe and sigdelayed frames
* exceptions.cc (stack_info): Add sigstackptr member.
(walk): Unwind sigstackptr inside _sigbe and sigdelayed.
* gendef (_sigdelayed_end): Add symbol to mark end of sigdelayed.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>