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

@ -209,10 +209,9 @@ _pinfo::kill (siginfo_t& si)
}
else if (sendSIGCONT)
{
siginfo_t si2;
siginfo_t si2 = {0};
si2.si_signo = SIGCONT;
si2.si_code = SI_KERNEL;
si2.si_pid = si2.si_uid = si2.si_errno = 0;
sig_send (this, si2);
}
@ -251,20 +250,18 @@ kill0 (pid_t pid, siginfo_t& si)
int
killsys (pid_t pid, int sig)
{
siginfo_t si;
siginfo_t si = {0};
si.si_signo = sig;
si.si_code = SI_KERNEL;
si.si_pid = si.si_uid = si.si_errno = 0;
return kill0 (pid, si);
}
int
kill (pid_t pid, int sig)
{
siginfo_t si;
siginfo_t si = {0};
si.si_signo = sig;
si.si_code = SI_USER;
si.si_pid = si.si_uid = si.si_errno = 0;
return kill0 (pid, si);
}
@ -538,7 +535,7 @@ sigwaitinfo (const sigset_t *set, siginfo_t *info)
extern "C" int
sigqueue (pid_t pid, int sig, const union sigval value)
{
siginfo_t si;
siginfo_t si = {0};
pinfo dest (pid);
if (!dest)
{
@ -547,7 +544,6 @@ sigqueue (pid_t pid, int sig, const union sigval value)
}
si.si_signo = sig;
si.si_code = SI_QUEUE;
si.si_pid = si.si_uid = si.si_errno = 0;
si.si_value = value;
return sig_send (dest, si);
}