* Win32 GDB specific problem
@ 2001-08-03 5:23 Pierre Muller
2001-08-03 6:01 ` Robert Collins
0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2001-08-03 5:23 UTC (permalink / raw)
To: 'cygwin@cygwin.com'
I am one of the persons that wrote the
Text Mode IDE for Free Pascal Compiler.
This Text Mode IDE includes GDB inside the executable
and it can both compile, run noramlly and debug a
given pascal source.
For go32v2 (based on DJGPP) and Linux
the repetition of compilation, debugging, editing, recompilation
works without problems, but this fails for Win32 version.
Once a file as been run under the internal debugger,
there is no way to recompile it !
Cygwin GDB does have the same problem.
Peter Vreman did some tests and
came to the conclusion that this is not really
GDB specific but that if some program calls
CreateProcess with DEBUG_PROCESS option,
then the OS leaves one handle open for this file
until the whole debugger executable is terminated.
Each run seems to open one handle more for
the file and it's used DLLs.
Peter also tested it without DEBUG_PROCESS and using CREATE_SUSPEND
instead. This will start the child without letting it run. Then terminating
the
process will close all handles correct. So this might
be a "feature" of Windows debugging ?
Is this a known limitation/feature of the WinAPI ?
Does anyone know of another possible fix to the problem ?
(Apart from copying the executable to a temp name
and running that temp, which will work but will consume
megabytes of disk space really fast :( )
If it is indeed a OS feature,
does anyone know how the commercial IDEs
do solve this problem?
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Win32 GDB specific problem
2001-08-03 5:23 Win32 GDB specific problem Pierre Muller
@ 2001-08-03 6:01 ` Robert Collins
2001-08-03 6:24 ` Pierre Muller
2001-08-03 8:49 ` Christopher Faylor
0 siblings, 2 replies; 5+ messages in thread
From: Robert Collins @ 2001-08-03 6:01 UTC (permalink / raw)
To: Pierre Muller; +Cc: 'cygwin@cygwin.com'
On 03 Aug 2001 14:15:14 +0200, Pierre Muller wrote:
> I am one of the persons that wrote the
> Text Mode IDE for Free Pascal Compiler.
>
> This Text Mode IDE includes GDB inside the executable
> and it can both compile, run noramlly and debug a
> given pascal source.
>
> For go32v2 (based on DJGPP) and Linux
> the repetition of compilation, debugging, editing, recompilation
> works without problems, but this fails for Win32 version.
> Once a file as been run under the internal debugger,
> there is no way to recompile it !
> Cygwin GDB does have the same problem.
Have you tried detaching from the process? once the debugger detach's
the file handle should be rreleased.
Rob
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Win32 GDB specific problem
2001-08-03 6:01 ` Robert Collins
@ 2001-08-03 6:24 ` Pierre Muller
2001-08-03 8:49 ` Christopher Faylor
1 sibling, 0 replies; 5+ messages in thread
From: Pierre Muller @ 2001-08-03 6:24 UTC (permalink / raw)
To: Robert Collins; +Cc: 'cygwin@cygwin.com'
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]
At 15:04 03/08/01 , Robert Collins a écrit:
>On 03 Aug 2001 14:15:14 +0200, Pierre Muller wrote:
> > I am one of the persons that wrote the
> > Text Mode IDE for Free Pascal Compiler.
> >
> > This Text Mode IDE includes GDB inside the executable
> > and it can both compile, run noramlly and debug a
> > given pascal source.
> >
> > For go32v2 (based on DJGPP) and Linux
> > the repetition of compilation, debugging, editing, recompilation
> > works without problems, but this fails for Win32 version.
> > Once a file as been run under the internal debugger,
> > there is no way to recompile it !
> > Cygwin GDB does have the same problem.
>Have you tried detaching from the process? once the debugger detach's
>the file handle should be rreleased.
No this doesn't change anything !
Reading carefully the WinAPI documentation,
I saw that only the calling thread can access WaitForDebugEvent.
Maybe if we start a new threead for each run and exit that thread
after the program is terminated, that would release all handles ?
I am too bad C and WinAPI programmer to test this out myself :(
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Win32 GDB specific problem
2001-08-03 6:01 ` Robert Collins
2001-08-03 6:24 ` Pierre Muller
@ 2001-08-03 8:49 ` Christopher Faylor
2001-08-03 10:14 ` Corinna Vinschen
1 sibling, 1 reply; 5+ messages in thread
From: Christopher Faylor @ 2001-08-03 8:49 UTC (permalink / raw)
To: cygwin
On Fri, Aug 03, 2001 at 11:04:43PM +1000, Robert Collins wrote:
>On 03 Aug 2001 14:15:14 +0200, Pierre Muller wrote:
>> I am one of the persons that wrote the
>> Text Mode IDE for Free Pascal Compiler.
>>
>> This Text Mode IDE includes GDB inside the executable
>> and it can both compile, run noramlly and debug a
>> given pascal source.
>>
>> For go32v2 (based on DJGPP) and Linux
>> the repetition of compilation, debugging, editing, recompilation
>> works without problems, but this fails for Win32 version.
>> Once a file as been run under the internal debugger,
>> there is no way to recompile it !
>> Cygwin GDB does have the same problem.
>Have you tried detaching from the process? once the debugger detach's
>the file handle should be rreleased.
There is no such thing as a detach command in the Win32 API, so...
cgf
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Win32 GDB specific problem
2001-08-03 8:49 ` Christopher Faylor
@ 2001-08-03 10:14 ` Corinna Vinschen
0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2001-08-03 10:14 UTC (permalink / raw)
To: cygwin
On Fri, Aug 03, 2001 at 11:49:45AM -0400, Christopher Faylor wrote:
> On Fri, Aug 03, 2001 at 11:04:43PM +1000, Robert Collins wrote:
> >On 03 Aug 2001 14:15:14 +0200, Pierre Muller wrote:
> >> I am one of the persons that wrote the
> >> Text Mode IDE for Free Pascal Compiler.
> >>
> >> This Text Mode IDE includes GDB inside the executable
> >> and it can both compile, run noramlly and debug a
> >> given pascal source.
> >>
> >> For go32v2 (based on DJGPP) and Linux
> >> the repetition of compilation, debugging, editing, recompilation
> >> works without problems, but this fails for Win32 version.
> >> Once a file as been run under the internal debugger,
> >> there is no way to recompile it !
> >> Cygwin GDB does have the same problem.
> >Have you tried detaching from the process? once the debugger detach's
> >the file handle should be rreleased.
>
> There is no such thing as a detach command in the Win32 API, so...
Oh, just FYI, I think this is interesting for GDB in future:
Under Whistler a debugger _can_ detach from a process now.
It has two new functions in the Debugger API:
DebugSetProcessKillOnExit()
DebugActiveProcessStop()
Sigh, why did it take so long to develop that feature?!?
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin@cygwin.com
Red Hat, Inc.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-08-03 10:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-03 5:23 Win32 GDB specific problem Pierre Muller
2001-08-03 6:01 ` Robert Collins
2001-08-03 6:24 ` Pierre Muller
2001-08-03 8:49 ` Christopher Faylor
2001-08-03 10:14 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).