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 Mon, Mar 02, 2009 at 11:21:20PM +0200, Eli Zaretskii wrote:
>> Date: Mon, 2 Mar 2009 20:56:25 +0100
>> From: Oswald Buddenhagen <oswald.buddenhagen@trolltech.de>
>> 
>> > As someone who have certainly read the patch, I can assure you that
>> > Chris's question didn't sound like it was answered in the comment.
>> >
>> well, then i would be thankful for questions that somehow indicate what
>> is missing from the comment or why it is entirely irrelevant.
>
>It is not irrelevant, but its wording is obscure and unclear, at least
>to me.  The full comment reads:
>
>  +      /* Resume main thread if we are attaching to a suspended
>  +	 process.
>  +	 Note that we are not trying to handle multi-threaded
>  +	 situations, as these are likely to be too complex anyway.
>  +	 This is primarily meant to cover the case where someone
>  +	 creates a process in suspended state and hands it over
>  +	 to gdb (this is an abstraction - you cannot actually do
>  +	 that due to Windows bugs. You need to start debugging the
>  +	 process yourself, and once it has started up, you suspend
>  +	 it and detach from it). */
>
>Perhaps I read this too naively, but note how you first seem to
>describe a use-case:
>
>    This is primarily meant to cover the case where someone
>    creates a process in suspended state and hands it over
>    to gdb
>
>but then immediately say that it cannot be done:
>
>    this is an abstraction - you cannot actually do
>    that due to Windows bugs.
>
>After reading this, I already become confused.
>
>    You need to start debugging the process yourself,
>    and once it has started up, you suspend it and detach from it
>
>And now I'm _really_ confused: ``detach''? didn't you say ``attach''
>above? why detach from a process if you want to debug it?
>
>Of course, Chris knows much more than I do about debugging on Windows,
>so perhaps his difficulty with your concept was different and more
>deep.  I will let him speak for himself.

Thanks, Eli.  You're right.  Part of my concern about the patch was that
I didn't understand the comment.

I thought I would get to that when I understood when and why someone
would start a process in a suspended state and then want to debug it.
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.

Once the "use case" was explained, I thought I would try to remember why
I had rejected a concept like this in Cygwin many years ago and see if
this was related.  I know that I had many problems when I arbitrarily
suspeded processes, especially on older versions of Windows.

cgf


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