From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4403 invoked by alias); 24 Jun 2008 18:08:44 -0000 Received: (qmail 4393 invoked by uid 22791); 24 Jun 2008 18:08:44 -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 18:08:21 +0000 Received: by ednor.cgf.cx (Postfix, from userid 201) id C71F667B0A1; Tue, 24 Jun 2008 14:08:19 -0400 (EDT) Date: Tue, 24 Jun 2008 18:29:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org Subject: Re: [RFC] win32-nat.c 'set new-console' and interruption Message-ID: <20080624180819.GB8439@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org References: <000001c8d330$0c6b51f0$2541f5d0$@u-strasbg.fr> <200806231922.10798.pedro@codesourcery.com> <20080624011336.GA13397@ednor.casa.cgf.cx> <200806241331.23092.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200806241331.23092.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/msg00411.txt.bz2 On Tue, Jun 24, 2008 at 01:31:22PM +0100, Pedro Alves wrote: >A Tuesday 24 June 2008 02:13:37, Christopher Faylor wrote: > >> Which is not me. > >I know. I really didn't mean to imply you were one of them. > >> 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. > >As I said, I know you have been all over this before. I'm not >trying to be picky on you. :-) > >Wasn't the conclusion that calling GetThreadContext blocks >until the thread really suspends, or that GetThreadContext fails >if the thread hasn't suspend yet? Like here: > >http://cygwin.com/ml/cygwin-developers/2005-12/msg00005.html > >What was the outcome of that? I have no idea. Cygwin does use SuspendThread but only when it has no other alternative. And, it can still cause problems on older windows. >I really would like to know of a problem it has caused by using >it from a debugger, that is, from a process which isn't the >owner of the thread; instead of a problem caused by calling >SuspendThread on a thread of the current process. > >> 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. > >Right, but that's a bit of a different issue. SuspendThread has >been available in win32 since ever. DebugBreakProcess hasn't. This has nothing to do with the availability of SuspendThread. It has to do with how well SuspendThread works. Once again: we go out of the way to make sure that gdb works on older windows. That means that you can't assume that something that works on newer windows is ok to use. SuspendThread does not work reliably on older windows. If the consensus here is that we can give up on Windows NT4 (and maybe even Windows 2000) and before that's fine. Otherwise, either SuspendThread calls have to be guarded with OS tests or not used at all. cgf