* exceptions.cc (stack_info::walk): Use method to find offset.

(handle_exceptions): Be more assertive in finding ebp for use under W2K.
Create a dummy stack frame for cases where program is dying and a stack dump is
being output.
(sig_handle): Fill out a GetThreadContext for use with a user-generated "core
dump".
This commit is contained in:
Christopher Faylor
2000-07-03 20:14:06 +00:00
parent 4bedf498d6
commit 8366e93be9
6 changed files with 68 additions and 37 deletions

View File

@ -445,13 +445,13 @@ fork ()
MALLOC_CHECK;
rc = fork_copy (pi, "dll data", dll_data_start, dll_data_end,
dll_bss_start, dll_bss_end, NULL);
rc = fork_copy (pi, "user/cygwin data",
user_data->data_start, user_data->data_end,
user_data->bss_start, user_data->bss_end,
ch.heapbase, ch.heapptr,
stack_here, ch.stackbottom,
dll_data_start, dll_data_end,
dll_bss_start, dll_bss_end, NULL);
NULL);
MALLOC_CHECK;
if (!rc)
@ -526,14 +526,22 @@ fork ()
}
sync_with_parent ("after longjmp.", TRUE);
ProtectHandle (hParent);
#ifdef DEBUGGING
char c;
if (GetEnvironmentVariable ("FORKDEBUG", &c, 1))
try_to_debug ();
char buf[80];
if (GetEnvironmentVariable ("CYGWIN_FORK_SLEEP", buf, sizeof (buf)))
{
small_printf ("Sleeping %d after fork, pid %u\n", atoi (buf), GetCurrentProcessId ());
Sleep (atoi(buf));
}
#endif
heap_init ();
ProtectHandle (hParent);
/* If we've played with the stack, stacksize != 0. That means that
fork() was invoked from other than the main thread. Make sure that
when the "main" thread exits it calls do_exit, like a normal process.