From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3265 invoked by alias); 21 Nov 2007 15:32:08 -0000 Received: (qmail 3256 invoked by uid 22791); 21 Nov 2007 15:32:07 -0000 X-Spam-Check-By: sourceware.org Received: from ics.u-strasbg.fr (HELO ics.u-strasbg.fr) (130.79.112.250) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 21 Nov 2007 15:31:56 +0000 Received: from ICSMULLER (laocoon.u-strasbg.fr [130.79.112.72]) by ics.u-strasbg.fr (Postfix) with ESMTP id 5A5C718701A; Wed, 21 Nov 2007 16:36:28 +0100 (CET) From: "Pierre Muller" To: "'Pedro Alves'" Cc: References: <47437D3A.3000107@portugalmail.pt> <000001c82c31$4a57b220$df071660$@u-strasbg.fr> <4053daab0711210543w4b241e1ek2371e887f3c4f7d2@mail.gmail.com> <000401c82c48$a450df10$ecf29d30$@u-strasbg.fr> <4053daab0711210708o607018b9n8b63147a8498a207@mail.gmail.com> In-Reply-To: <4053daab0711210708o607018b9n8b63147a8498a207@mail.gmail.com> Subject: RE: [win32] Fix suspend count handling Date: Wed, 21 Nov 2007 15:32:00 -0000 Message-ID: <001501c82c53$b0125bc0$10371340$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us 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: 2007-11/txt/msg00399.txt.bz2 > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of Pedro Alves > Sent: Wednesday, November 21, 2007 4:08 PM > To: Pierre Muller > Cc: gdb-patches@sourceware.org > Subject: Re: [win32] Fix suspend count handling > > On Nov 21, 2007 2:13 PM, Pierre Muller wrote: > > > Your patch does indeed correct this to 3, which is what is wanted. > > But if you use 'continue' instead of 'next' when you are at line > > 37, you will get '4' printed out instead of three, because > > the main thread will have call SuspendThread before gdb does. > > This is at least what happens on my computer. > > > > Are you sure this was from a gdb with this patch installed? I get 4 > without the patch, but with this patch (*without* the other > watchpoint patch on top) I still get 3 no matter how I try it: > > $ gdb/gdb.exe main.exe > GNU gdb 6.7.50.20071121 > Copyright (C) 2007 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show > copying" > and "show warranty" for details. > This GDB was configured as "i686-pc-cygwin"... > (gdb) b 37 > Breakpoint 1 at 0x40119a: file main.c, line 37. > (gdb) r > Starting program: /d/gdb/build/main.exe > > Breakpoint 1, main (argc=1, argv=0x6b3270) at main.c:37 > 37 suspend_count = ResumeThread (h); /* set breakpoint here */ > (gdb) c > Continuing. > 3 You need to switch to the thread that is suspended to get '4' as a result, otherwise you get '3'. > Program exited normally. > (gdb) > > > > > OK, in that case it is indeed correct to do all the ResumeThread > calls > > before ContinueDebugEvent is called, and thus the suspend_count can > be > > replaced > > by suspended Boolean value. > > Not a boolean, its a three state -- suspend_count also accepted -1, and > I've > kept that. > > > But only the combination of the two patches will ensure to > > always obtain '3' using 'continue' or 'next'. > > That's not what I see here. Can you show me a run where you get 4 > only this patch applied? Just add a 'thread 3' after the breakpoint is trigged and 'continue'. Pierre