Always zero all elements of siginfo_t throughout.

* 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.
This commit is contained in:
Christopher Faylor
2006-02-06 18:24:11 +00:00
parent 125ff9be63
commit 985d0e68c5
13 changed files with 201 additions and 118 deletions

View File

@ -1,6 +1,6 @@
/* signal.h
Copyright 2004, 2006 Red Hat, Inc.
Copyright 2004, 2005, 2006 Red Hat, Inc.
This file is part of Cygwin.
@ -14,17 +14,50 @@
#ifdef __cplusplus
extern "C" {
#endif
struct _fpstate
{
unsigned long cw;
unsigned long sw;
unsigned long tag;
unsigned long ipoff;
unsigned long cssel;
unsigned long dataoff;
unsigned long datasel;
unsigned char _st[80];
unsigned long nxst;
};
#if 0
struct ucontext
{
unsigned long uc_flags;
void *uc_link;
stack_t uc_stack;
struct sigcontext uc_mcontext;
sigset_t uc_sigmask;
unsigned long cr2;
unsigned long dr0;
unsigned long dr1;
unsigned long dr2;
unsigned long dr3;
unsigned long dr6;
unsigned long dr7;
struct _fpstate fpstate;
unsigned long gs;
unsigned long fs;
unsigned long es;
unsigned long ds;
unsigned long edi;
unsigned long esi;
unsigned long ebx;
unsigned long edx;
unsigned long ecx;
unsigned long eax;
unsigned long ebp;
unsigned long eip;
unsigned long cs;
unsigned long eflags;
unsigned long esp;
unsigned long ss;
unsigned char _internal;
unsigned long oldmask;
};
#endif
#define __COPY_CONTEXT_SIZE ((unsigned) &((struct ucontext *) 0)->_internal)
typedef union sigval
{