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>
This commit is contained in:
parent
6fbb37b3fa
commit
e3de6b0a4d
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2015-08-30 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* cygcheck.cc (dump_sysinfo): Correctly handle Windows 10/Server 2016.
|
* cygcheck.cc (dump_sysinfo): Correctly handle Windows 10/Server 2016.
|
||||||
|
|
|
@ -2340,7 +2340,8 @@ load_cygwin (int& argc, char **&argv)
|
||||||
char **av = (char **) cygwin_internal (CW_ARGV);
|
char **av = (char **) cygwin_internal (CW_ARGV);
|
||||||
if (av && ((uintptr_t) av != (uintptr_t) -1))
|
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++)
|
for (argc = 0; av[argc]; argc++)
|
||||||
continue;
|
continue;
|
||||||
argv = (char **) calloc (argc + 1, sizeof (char *));
|
argv = (char **) calloc (argc + 1, sizeof (char *));
|
||||||
|
@ -2352,8 +2353,8 @@ load_cygwin (int& argc, char **&argv)
|
||||||
char **envp = (char **) cygwin_internal (CW_ENVP);
|
char **envp = (char **) cygwin_internal (CW_ENVP);
|
||||||
if (envp && ((uintptr_t) envp != (uintptr_t) -1))
|
if (envp && ((uintptr_t) envp != (uintptr_t) -1))
|
||||||
{
|
{
|
||||||
/* Store path and revert to this value, otherwise path gets overwritten
|
/* Store path and revert to this value, otherwise path gets
|
||||||
by the POSIXy Cygwin variation, which breaks cygcheck.
|
overwritten by the POSIXy Cygwin variation, which breaks cygcheck.
|
||||||
Another approach would be to use the Cygwin PATH and convert it to
|
Another approach would be to use the Cygwin PATH and convert it to
|
||||||
Win32 again. */
|
Win32 again. */
|
||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
|
@ -2371,6 +2372,9 @@ load_cygwin (int& argc, char **&argv)
|
||||||
putenv (path);
|
putenv (path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* GDB chokes when the DLL got unloaded and, for some reason, fails to set
|
||||||
|
any breakpoint after the fact. */
|
||||||
|
if (!IsDebuggerPresent ())
|
||||||
FreeLibrary (h);
|
FreeLibrary (h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue