4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-21 16:26:12 +08:00

* thread.cc (thread_init_wrapper): Use _REENT_INIT to initialize the reent

structure of newlib.
* sigproc.h (sig_send): Add exception parameter to sig_send.
* sigproc.cc (sig_send): Ditto.  Use it when setting frame info.
* exceptions.cc (handle_exceptions): Use exception flag when calling sig_send.
This commit is contained in:
Christopher Faylor 2001-04-27 18:50:59 +00:00
parent 9572ecf979
commit cba63823f8
5 changed files with 18 additions and 11 deletions

View File

@ -1,3 +1,15 @@
2001-04-27 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* thread.cc (thread_init_wrapper): Use _REENT_INIT to initialize the
reent structure of newlib.
Fri Apr 27 14:02:24 2001 Christopher Faylor <cgf@cygnus.com>
* sigproc.h (sig_send): Add exception parameter to sig_send.
* sigproc.cc (sig_send): Ditto. Use it when setting frame info.
* exceptions.cc (handle_exceptions): Use exception flag when calling
sig_send.
2001-04-27 Egor Duda <deo@logos-m.ru> 2001-04-27 Egor Duda <deo@logos-m.ru>
* tty.cc (tty::make_pipes): Set to_slave pipe mode to nonblocking. * tty.cc (tty::make_pipes): Set to_slave pipe mode to nonblocking.

View File

@ -532,7 +532,7 @@ handle_exceptions (EXCEPTION_RECORD *e, void *, CONTEXT *in, void *)
signal_exit (0x80 | sig); // Flag signal + core dump signal_exit (0x80 | sig); // Flag signal + core dump
} }
sig_send (NULL, sig, (DWORD) ebp); // Signal myself sig_send (NULL, sig, (DWORD) ebp, 1); // Signal myself
return 0; return 0;
} }
#endif /* __i386__ */ #endif /* __i386__ */

View File

@ -631,7 +631,7 @@ sigproc_terminate (void)
* completed before returning. * completed before returning.
*/ */
int __stdcall int __stdcall
sig_send (_pinfo *p, int sig, DWORD ebp) sig_send (_pinfo *p, int sig, DWORD ebp, bool exception)
{ {
int rc = 1; int rc = 1;
DWORD tid = GetCurrentThreadId (); DWORD tid = GetCurrentThreadId ();
@ -680,7 +680,7 @@ sig_send (_pinfo *p, int sig, DWORD ebp)
{ {
thiscatch = sigcatch_main; thiscatch = sigcatch_main;
thiscomplete = sigcomplete_main; thiscomplete = sigcomplete_main;
thisframe.set (mainthread, ebp, 1); thisframe.set (mainthread, ebp, exception);
} }
} }
else if (!(thiscatch = getsem (p, "sigcatch", 0, 0))) else if (!(thiscatch = getsem (p, "sigcatch", 0, 0)))

View File

@ -110,7 +110,8 @@ void __stdcall subproc_init ();
void __stdcall sigproc_terminate (); void __stdcall sigproc_terminate ();
BOOL __stdcall proc_exists (_pinfo *) __attribute__ ((regparm(1))); BOOL __stdcall proc_exists (_pinfo *) __attribute__ ((regparm(1)));
BOOL __stdcall pid_exists (pid_t) __attribute__ ((regparm(1))); BOOL __stdcall pid_exists (pid_t) __attribute__ ((regparm(1)));
int __stdcall sig_send (_pinfo *, int, DWORD ebp = (DWORD) __builtin_frame_address (0)) __attribute__ ((regparm(3))); int __stdcall sig_send (_pinfo *, int, DWORD ebp = (DWORD) __builtin_frame_address (0),
bool exception = 0) __attribute__ ((regparm(3)));
void __stdcall signal_fixup_after_fork (); void __stdcall signal_fixup_after_fork ();
void __stdcall signal_fixup_after_exec (bool); void __stdcall signal_fixup_after_exec (bool);

View File

@ -737,7 +737,7 @@ thread_init_wrapper (void *_arg)
pthread *thread = (pthread *) _arg; pthread *thread = (pthread *) _arg;
struct __reent_t local_reent; struct __reent_t local_reent;
struct _winsup_t local_winsup; struct _winsup_t local_winsup;
struct _reent local_clib; struct _reent local_clib = _REENT_INIT(local_clib);
struct sigaction _sigs[NSIG]; struct sigaction _sigs[NSIG];
sigset_t _sig_mask; /* one set for everything to ignore. */ sigset_t _sig_mask; /* one set for everything to ignore. */
@ -748,14 +748,8 @@ thread_init_wrapper (void *_arg)
thread->sigmask = &_sig_mask; thread->sigmask = &_sig_mask;
thread->sigtodo = _sigtodo; thread->sigtodo = _sigtodo;
memset (&local_clib, 0, sizeof (struct _reent));
memset (&local_winsup, 0, sizeof (struct _winsup_t)); memset (&local_winsup, 0, sizeof (struct _winsup_t));
local_clib._errno = 0;
local_clib._stdin = &local_clib.__sf[0];
local_clib._stdout = &local_clib.__sf[1];
local_clib._stderr = &local_clib.__sf[2];
local_reent._clib = &local_clib; local_reent._clib = &local_clib;
local_reent._winsup = &local_winsup; local_reent._winsup = &local_winsup;