From 3d0ba393dfa79cb4a43a3a753ad64f5caaae37cb Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 14 Jul 2002 19:15:32 +0000 Subject: * dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a compiler warning. * shared.cc (memory_init): Remove debug_init call. * debug.h (handle_list): Change "clexec" to "inherited". * debug.cc: Remove a spurious declaration. (setclexec): Conditionalize away since it is currently unused. (add_handle): Use inherited field rather than clexec. (debug_fixup_after_fork_exec): Ditto. Move debugging output to delete_handle. (delete_handle): Add debugging output. * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting inheritance in debugging table since the handle was never protected anyway. (fhandler_base::fork_fixup): Ditto. * exceptions.cc (debugger_command): Revert. --- winsup/cygwin/dcrt0.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/dcrt0.cc') diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 1ba328f45..da3b5d52f 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -633,9 +633,14 @@ dll_crt0_1 () /* Initialize the cygwin subsystem if this is the first process, or attach to shared data structures if it's already running. */ memory_init (); + ProtectHandle (hMainProc); ProtectHandle (hMainThread); + /* Initialize debug muto, if DLL is built with --enable-debugging. + Need to do this before any helper threads start. */ + debug_init (); + cygheap->fdtab.vfork_child_fixup (); (void) SetErrorMode (SEM_FAILCRITICALERRORS); @@ -807,7 +812,7 @@ initial_env () len = GetModuleFileName (NULL, buf1, MAX_PATH); char *p = strchr (buf, '='); if (!p) - p = "gdb.exe -nw"; + p = (char *) "gdb.exe -nw"; else *p++ = '\0'; if (strstr (buf1, buf)) -- cgit v1.2.3