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: [RFC] win32-nat.c 'set new-console' and interruption


On Mon, Jun 23, 2008 at 07:22:10PM +0100, Pedro Alves wrote:
>A Monday 23 June 2008 18:36:20, Christopher Faylor wrote:
>> On Mon, Jun 23, 2008 at 03:41:26PM +0100, Pedro Alves wrote:
>> >Another option is to use SuspendThread on all threads to stop the
>> >process, which is what I believe Visual Studio uses.  gdbserver has
>> >that implemented for systems that don't have DebugBreakProcess.
>>
>> It may be ok in Windows XP and beyond (I haven't checked) but I don't
>> believe you can reliably use SuspendThread otherwise.  If you suspend a
>> thread at the wrong point you can cause problems.
>
>It may have been a problem with earlier Windows versions (maybe deadlocking
>on some global internal lock, but evidence is scarse).  Not sure it's a
>real problem.  Would pretty much make it useless if you can't use it from a
>debugger.  google is riddled with articles claiming not to use it, but
>those are aimed at application developers who confuse it with a locking
>primitive.

Which is not me.

If you want gdb to be usable on systems other than Windows XP and beyond
then you can't use SuspendThread.

I'm not speaking from theory.  I'm speaking from experience.

If this wasn't something that we wanted to do then we shouldn't be
carefully autoloading functions that only exist in XP in win32-nat.c.

cgf


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