From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8449 invoked by alias); 5 Mar 2007 01:21:50 -0000 Received: (qmail 8437 invoked by uid 22791); 5 Mar 2007 01:21:50 -0000 X-Spam-Check-By: sourceware.org Received: from elrond.portugalmail.pt (HELO elrond.portugalmail.pt) (195.245.179.181) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 05 Mar 2007 01:21:48 +0000 Received: from localhost (localhost [127.0.0.1]) by elrond.portugalmail.pt (Postfix) with ESMTP id ED0F438CDD; Mon, 5 Mar 2007 01:21:42 +0000 (WET) Received: from elrond.portugalmail.pt ([127.0.0.1]) by localhost (elrond.portugalmail.pt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23gV0INLOijk; Mon, 5 Mar 2007 01:21:42 +0000 (WET) Received: from [127.0.0.1] (88.210.67.164.rev.optimus.pt [88.210.67.164]) (Authenticated sender: pedro_alves@portugalmail.pt) by elrond.portugalmail.pt (Postfix) with ESMTP id 6799339125; Mon, 5 Mar 2007 01:21:41 +0000 (WET) Message-ID: <45EB70A3.6060202@portugalmail.pt> Date: Mon, 05 Mar 2007 01:21:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: Pedro Alves CC: Lerele , gdb-patches@sourceware.org Subject: Re: [Patch] Win32 gdbserver new interrupt support, and attach to process fix. References: <45DF7E27.10102@champenstudios.com> <45E211A5.6080905@portugalmail.pt> <45EB4D5A.7070703@champenstudios.com> <45EB6AC8.3090307@portugalmail.pt> In-Reply-To: <45EB6AC8.3090307@portugalmail.pt> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000721-1, 03-03-2007), Outbound message X-Antivirus-Status: Clean 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-03/txt/msg00029.txt.bz2 Pedro Alves wrote: > Lerele wrote: >> Pedro Alves wrote: >> I was wrong, res is not a Win32 BOOL, it's plainly a 0 or a 1. > > Then make it a BOOL, it makes the code clearer anyway. See attachment. > > Or leave it an int, and fix the constants, which looks like what was intended in the first place. - res = DebugActiveProcess (pid) ? 1 : 0; + res = DebugActiveProcess (pid) ? -1 : 0; if (current_process_handle == NULL) { - res = 0; + res = -1; if (DebugActiveProcessStop != NULL) DebugActiveProcessStop (current_process_id); } (...) if (kernel32 != NULL) FreeLibrary (kernel32); - return res? 0:-1; + return res; } Anyway, what I really wanted to say, that I had forgotten, was that if you posted this patch isolated from the rest of the interrupt support, it would be probably be classified as an "obvious" fix, and could go in much faster. Cheers, Pedro Alves