This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Cygwin] Fix for: detaching crashes the inferior.


On 4/10/07, Christopher Faylor wrote:

Are you sure you aren't seeing problems when you attach/detach more than
once?  I know that there is someplace that isn't getting cleared in that
scenario.  I have thought that I fixed that problem a few times but it
still seems to be there in the latest cygwin release.


I tried that many times, with the following test program:


$ cat main.c
#include <stdio.h>
#include <windows.h>

int
main(int argc, char** argv)
{
 int count = 0;
 while (1)
   {
     printf ("count = %d\n", count++);
     fflush (stdout);
     Sleep (1000);
   }
}

I attached with gdb --pid <pid>, set a break on line 9, continue,
breakpoint is hit, hit next a couple of times, detach, reattach without
restarting gdb, continue till the breakpoint, step a couple times,
remove breakpoint, detach, restart gdb, attach, do the same, but
letting gdb start the inferior as a child, redo the testing a couple of
times, and nothing bad happens...

... except that once, I saw for this warning:
(gdb) attach 2396
Warning: Failed to get SE_DEBUG_NAME privilege
This can cause attach to fail on Windows NT/2K/XP
Attaching to program `/cygdrive/d/gdb-20070402/build/main.exe', process 2396
Loaded symbols for /cygdrive/c/WINNT/system32/ntdll.dll
Loaded symbols for /cygdrive/c/WINNT/system32/kernel32.dll
Loaded symbols for /usr/bin/cygwin1.dll
Loaded symbols for /cygdrive/c/WINNT/system32/advapi32.dll
Loaded symbols for /cygdrive/c/WINNT/system32/rpcrt4.dll
Loaded symbols for /cygdrive/c/WINNT/system32/secur32.dll
Loaded symbols for /cygdrive/c/WINNT/system32/user32.dll
Loaded symbols for /cygdrive/c/WINNT/system32/gdi32.dll
[Switching to thread 2396.0xe3c]

Have no idea if that is really a problem, but it should be a
separate patch.

Cheers,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]