summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc7
1 files changed, 6 insertions, 1 deletions
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))