aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-05-17 01:21:06 +0000
committerChristopher Faylor <me@cgf.cx>2005-05-17 01:21:06 +0000
commit5c8e6fbd8cba2653984ca48d8a1872b3e6974a2c (patch)
tree4e30129e6b969d33e959b90a7fcc09946e8d8c98 /winsup
parentb55ba2f3da13dc697c57d7efe3b98c75da2a87b5 (diff)
downloadnewlib-5c8e6fbd8cba2653984ca48d8a1872b3e6974a2c.zip
newlib-5c8e6fbd8cba2653984ca48d8a1872b3e6974a2c.tar.gz
newlib-5c8e6fbd8cba2653984ca48d8a1872b3e6974a2c.tar.bz2
* include/sys/cygwin.h (enum cygwin_getinfo_types): Add CW_DEBUG_SELF.
* external.cc (cygwin_internal): Implement CW_DEBUG_SELF. * init.cc (dll_entry): Minor rearrangement of code.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/external.cc8
-rw-r--r--winsup/cygwin/include/sys/cygwin.h3
-rw-r--r--winsup/cygwin/init.cc2
4 files changed, 16 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 70573a8..c2bba38 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,12 @@
2005-05-16 Christopher Faylor <cgf@timesys.com>
+ * include/sys/cygwin.h (enum cygwin_getinfo_types): Add CW_DEBUG_SELF.
+ * external.cc (cygwin_internal): Implement CW_DEBUG_SELF.
+
+ * init.cc (dll_entry): Minor rearrangement of code.
+
+2005-05-16 Christopher Faylor <cgf@timesys.com>
+
* path.cc (path_conv::check): Remove embedded dots before slashes.
2005-05-16 Corinna Vinschen <corinna@vinschen.de>
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index 5268b86..6d618c9 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -311,13 +311,17 @@ cygwin_internal (cygwin_getinfo_types t, ...)
case CW_ARGV:
{
child_info_spawn *ci = (child_info_spawn *) get_cygwin_startup_info ();
- return (DWORD) (ci ? ci->moreinfo->argv : NULL);
+ return (unsigned long) (ci ? ci->moreinfo->argv : NULL);
}
case CW_ENVP:
{
child_info_spawn *ci = (child_info_spawn *) get_cygwin_startup_info ();
- return (DWORD) (ci ? ci->moreinfo->envp : NULL);
+ return (unsigned long) (ci ? ci->moreinfo->envp : NULL);
}
+ case CW_DEBUG_SELF:
+ error_start_init (va_arg (arg, const char *));
+ try_to_debug ();
+ break;
default:
return (DWORD) -1;
}
diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h
index 30ec178..7fa6263 100644
--- a/winsup/cygwin/include/sys/cygwin.h
+++ b/winsup/cygwin/include/sys/cygwin.h
@@ -82,7 +82,8 @@ typedef enum
CW_GET_BINMODE,
CW_HOOK,
CW_ARGV,
- CW_ENVP
+ CW_ENVP,
+ CW_DEBUG_SELF
} cygwin_getinfo_types;
#define CW_NEXTPID 0x80000000 /* or with pid to get next one */
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index 3d7a91c..a0d34f5 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -119,6 +119,7 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
{
case DLL_PROCESS_ATTACH:
cygwin_hmodule = (HMODULE) h;
+ dynamically_loaded = (static_load == NULL);
/* Is the stack at an unusual high address? Check if we're running on
a 64 bit machine. If so, respawn. */
if (&is_64bit_machine >= (PBOOL) 0x400000
@@ -127,7 +128,6 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
respawn_wow64_process ();
prime_threads ();
- dynamically_loaded = (static_load == NULL);
dll_crt0_0 ();
break;
case DLL_PROCESS_DETACH: