[win32] Fix suspend count handling

Lerele lerele@champenstudios.com
Sun Nov 25 20:34:00 GMT 2007


Christopher Faylor escribió:
> On Sun, Nov 25, 2007 at 03:44:31PM +0100, Lerele wrote:
>   
>> What do you think?
>>     
>
> There is some code in win32-nat.c which was a result of my uncertainty
> about the Windows debugging API.  I thought that since we have a couple
> more eyes on this now someone might know a bit more about how this
> works.  Understanding the foundations is never a bad idea.
>
> I'm not interested in gdbserver or what you think may be happening in
> the future.  If the SuspendThread/ResumeThread code can be eliminated
> from win32-nat.c along with all of the bookkeeping that is required to
> avoid races then it may be a good idea to do so.  Whether it is a good
> idea in light of future enhancements is a decision I can make but,
> personally, I rarely see a good reason to keep code complication around
> for the future unless someone is actually planning to do the work.
>
> We can stop talking about this now since it is apparent that no one
> actually knows the answer to my question.
>
> cgf
>
>   

Okay.
Derived from my previous messages, which by the way I do not really know 
if you read/undestood, is that for the third time I'm saying 
SuspendThread I think is safer (as you did think once) and does not 
really hurt, and it's not such a complication keeping it around, in my 
opinion.
The only problem I see is that a small bug has been detected, that's all.

If win32-nat.c is going to give control back to gdb in response to a 
Win32 debug event only, it's obvious SuspendThread is not needed.
When WaitForDebugEvent returns an event, all child threads are stopped, 
so yes, SuspendThread is *not* needed.
Is this the short answer you were looking for???

Also, may you be interested in the fact that currently interrupting a 
running program using gdb 6.7 does *not* seem to work?  Either if you 
run gdb alone (not gdbserver) or using a front-end?
To my point, as gdbserver win32 code is win32-nat.c based, funtionality 
is very similar.  One such functionality could be the latest 
SuspendThread interruption that has been added to gdbserver (but not to 
win32-nat.c).  As such, could you be interested in this for win32-nat.c?
If this functionality is of interest, then that's another reason to keep 
thread_rec/SuspendThread.




More information about the Gdb-patches mailing list