* localtime.cc (localtime_r): Call tzset.

* Makefile.in: Make version.h/cygwin.din version check a warning since it is
not foolproof.
* cygheap.h (CYGHEAPSIZE): Bump size down.
* cygtls.h (_threadinfo::stacklock): New element.
(_threadinfo::pop): Make regparm.
(_threadinfo::lock): New function.
(_threadinfo::unlock): New function.
* cygtls.cc (_threadinfo::push): Wait for a lock on the stack before performing
the operation.
(_threadinfo::pop): Move to another file.
* cygwin.din: More SIGFE changes.
* exceptions.cc (try_to_debug): Always display messages on console.
(handle_exceptions): Unwind stack only when actually about to call sig_send.
(setup_handler): Lock stack prior to performing any operations.
* gendef (_sigfe): Ditto.
(_sigbe): Ditto.
(_threadinfo::pop): Ditto.  Move here.
* gen_tlsoffsets: Generate positive offsets.
* tlsoffsets.h: Regenerate.
This commit is contained in:
Christopher Faylor
2004-02-08 19:59:27 +00:00
parent f5133f95b0
commit 6946073e78
11 changed files with 214 additions and 100 deletions

View File

@ -361,8 +361,8 @@ try_to_debug (bool waitloop)
}
}
small_printf ("*** starting debugger for pid %u\n",
cygwin_pid (GetCurrentProcessId ()));
console_printf ("*** starting debugger for pid %u\n",
cygwin_pid (GetCurrentProcessId ()));
BOOL dbg;
dbg = CreateProcess (NULL,
debugger_command,
@ -380,17 +380,18 @@ try_to_debug (bool waitloop)
else
{
if (!waitloop)
return 1;
return dbg;
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
while (!being_debugged ())
Sleep (0);
Sleep (2000);
small_printf ("*** continuing pid %u from debugger call\n",
cygwin_pid (GetCurrentProcessId ()));
}
console_printf ("*** continuing pid %u from debugger call (%d)\n",
cygwin_pid (GetCurrentProcessId ()), dbg);
SetThreadPriority (GetCurrentThread (), prio);
return 0;
return dbg;
}
/* Main exception handler. */
@ -416,10 +417,6 @@ handle_exceptions (EXCEPTION_RECORD *e0, void *frame, CONTEXT *in0, void *)
EXCEPTION_RECORD e = *e0;
CONTEXT in = *in0;
extern DWORD ret_here[];
RtlUnwind (frame, ret_here, e0, 0);
__asm__ volatile (".equ _ret_here,.");
siginfo_t si;
/* Coerce win32 value to posix value. */
switch (e.ExceptionCode)
@ -557,6 +554,10 @@ handle_exceptions (EXCEPTION_RECORD *e0, void *frame, CONTEXT *in0, void *)
signal_exit (0x80 | si.si_signo); // Flag signal + core dump
}
extern DWORD ret_here[];
RtlUnwind (frame, ret_here, e0, 0);
__asm__ volatile (".equ _ret_here,.");
si.si_addr = ebp;
si.si_code = SI_KERNEL;
si.si_errno = si.si_pid = si.si_uid = 0;
@ -766,12 +767,15 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _threadinfo *tls)
__stack_t *retaddr_on_stack = tls->stackptr - 1;
if (retaddr_on_stack >= tls->stack)
{
if (!tls->lock (false))
continue;
__stack_t retaddr = InterlockedExchange ((LONG *) retaddr_on_stack, 0);
if (!retaddr)
continue;
tls->reset_exception ();
tls->interrupt_setup (sig, handler, siga, retaddr);
sigproc_printf ("interrupted known cygwin routine");
tls->unlock ();
interrupted = true;
break;
}