From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2368 invoked by alias); 24 Jun 2008 01:13:57 -0000 Received: (qmail 2360 invoked by uid 22791); 24 Jun 2008 01:13:56 -0000 X-Spam-Check-By: sourceware.org Received: from pool-71-248-179-123.bstnma.fios.verizon.net (HELO ednor.cgf.cx) (71.248.179.123) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jun 2008 01:13:39 +0000 Received: by ednor.cgf.cx (Postfix, from userid 201) id 312D6634008; Mon, 23 Jun 2008 21:13:37 -0400 (EDT) Date: Tue, 24 Jun 2008 02:33:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org, Pedro Alves Subject: Re: [RFC] win32-nat.c 'set new-console' and interruption Message-ID: <20080624011336.GA13397@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org, Pedro Alves References: <000001c8d330$0c6b51f0$2541f5d0$@u-strasbg.fr> <200806231541.26276.pedro@codesourcery.com> <20080623173620.GA10962@ednor.casa.cgf.cx> <200806231922.10798.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200806231922.10798.pedro@codesourcery.com> User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00401.txt.bz2 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