diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-08-30 21:35:23 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-08-30 21:39:19 +0200 |
commit | e3de6b0a4d7fc1f00b5961edc9e8e5a7a9e0a09e (patch) | |
tree | 8cb4a3fbb9a202811b74cac9522f28c103a25b71 /winsup/utils | |
parent | 6fbb37b3fa329c8bd5bf55302e0c5ab790d438a8 (diff) | |
download | newlib-e3de6b0a4d7fc1f00b5961edc9e8e5a7a9e0a09e.zip newlib-e3de6b0a4d7fc1f00b5961edc9e8e5a7a9e0a09e.tar.gz newlib-e3de6b0a4d7fc1f00b5961edc9e8e5a7a9e0a09e.tar.bz2 |
cygcheck.cc: Fix debugger problem
* cygcheck.cc (load_cygwin): Only unload cygwin DLL if not running
under a debugger. Explain why.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/utils')
-rw-r--r-- | winsup/utils/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/utils/cygcheck.cc | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 080502e..d60691a 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,5 +1,10 @@ 2015-08-30 Corinna Vinschen <corinna@vinschen.de> + * cygcheck.cc (load_cygwin): Only unload cygwin DLL if not running + under a debugger. Explain why. + +2015-08-30 Corinna Vinschen <corinna@vinschen.de> + * cygcheck.cc (dump_sysinfo): Correctly handle Windows 10/Server 2016. Add missing product types. diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 1cf4875..4538e1b 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -2340,7 +2340,8 @@ load_cygwin (int& argc, char **&argv) char **av = (char **) cygwin_internal (CW_ARGV); if (av && ((uintptr_t) av != (uintptr_t) -1)) { - /* Copy cygwin's idea of the argument list into this Window application. */ + /* Copy cygwin's idea of the argument list into this Window + application. */ for (argc = 0; av[argc]; argc++) continue; argv = (char **) calloc (argc + 1, sizeof (char *)); @@ -2352,8 +2353,8 @@ load_cygwin (int& argc, char **&argv) char **envp = (char **) cygwin_internal (CW_ENVP); if (envp && ((uintptr_t) envp != (uintptr_t) -1)) { - /* Store path and revert to this value, otherwise path gets overwritten - by the POSIXy Cygwin variation, which breaks cygcheck. + /* Store path and revert to this value, otherwise path gets + overwritten by the POSIXy Cygwin variation, which breaks cygcheck. Another approach would be to use the Cygwin PATH and convert it to Win32 again. */ char *path = NULL; @@ -2371,7 +2372,10 @@ load_cygwin (int& argc, char **&argv) putenv (path); } } - FreeLibrary (h); + /* GDB chokes when the DLL got unloaded and, for some reason, fails to set + any breakpoint after the fact. */ + if (!IsDebuggerPresent ()) + FreeLibrary (h); } int |