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: make attaching to stopped processes work under windows


On Tue, Mar 03, 2009 at 01:05:04PM +0100, Oswald Buddenhagen wrote:
>On Tue, Mar 03, 2009 at 12:21:30AM -0500, Christopher Faylor wrote:
>>In my definition of "use case", you don't just theorize that something
>>could be done, you explain that "Package X does this all of the time
>>because of Y and that makes it hard for me to debug things." You don't
>>just assert that you want to change the code because it is
>>theoretically possible.
>>
>well, to me, the idea of being able to attach to a suspended process
>seems to have enough merit of its own.  after all, why should it matter
>whether the process is suspended in the first place?

Because you may be debugging a situation where you want precise control
over the process's suspend count.  The process may be suspended for
reasons other than the way that you are specifically using it.

For instance, if this code was invoked at the wrong time on a cygwin
process it could screw up cygwin's signal handling which tries to (very
carefully) use SuspendThread/SetThreadContext/ResumeThread to send
signals when running in user code.

>anyway, i use that to implement a "debug in separate terminal" mode.
>for that, i launch a stub with controlled process flags.  that stub
>launches the debuggee.  for gdb to be able to attach to it without a
>race, the debuggee needs to be launched in suspended state.  once the
>debuggee ends, the stub prints a "enter to continue" message, waits and
>terminates.

Thank you for explaining.

Unfortunately, I am not comfortable accepting this patch as is.  I would
consider a variation of the patch which implemented either a command line
option (assuming that the rest of the gdb developers agree) or a gdb
command ("set always-resume-thread on"?) so that this behavior was not
the default, however.

This would mean that you'd need to have an assignment on file with the
FSF so if you are willing to pursue that alternative it would make sense
to start that process ASAP.

(I'm hoping that someone will provide you with a pointer to the necessary
paperwork since I don't have it handy right now)

cgf


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