From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26824 invoked by alias); 21 Nov 2007 15:08:28 -0000 Received: (qmail 26814 invoked by uid 22791); 21 Nov 2007 15:08:26 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.191) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 21 Nov 2007 15:08:19 +0000 Received: by nf-out-0910.google.com with SMTP id b11so2183549nfh for ; Wed, 21 Nov 2007 07:08:16 -0800 (PST) Received: by 10.86.70.8 with SMTP id s8mr7401742fga.1195657696558; Wed, 21 Nov 2007 07:08:16 -0800 (PST) Received: by 10.86.27.20 with HTTP; Wed, 21 Nov 2007 07:08:16 -0800 (PST) Message-ID: <4053daab0711210708o607018b9n8b63147a8498a207@mail.gmail.com> Date: Wed, 21 Nov 2007 15:08:00 -0000 From: "Pedro Alves" To: "Pierre Muller" Subject: Re: [win32] Fix suspend count handling Cc: gdb-patches@sourceware.org In-Reply-To: <000401c82c48$a450df10$ecf29d30$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47437D3A.3000107@portugalmail.pt> <000001c82c31$4a57b220$df071660$@u-strasbg.fr> <4053daab0711210543w4b241e1ek2371e887f3c4f7d2@mail.gmail.com> <000401c82c48$a450df10$ecf29d30$@u-strasbg.fr> X-Google-Sender-Auth: 6d5ad9cc44573f13 X-IsSubscribed: yes 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/msg00397.txt.bz2 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 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? Cheers, Pedro Alves