From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0vTTEeueamPtWBUAWB0awg (envelope-from ) for ; Tue, 08 Nov 2022 13:24:43 -0500 Received: by simark.ca (Postfix, from userid 112) id 3CD831E124; Tue, 8 Nov 2022 13:24:43 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=GaLtV6kI; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E6CE21E0D3 for ; Tue, 8 Nov 2022 13:24:42 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F3A3338582A0 for ; Tue, 8 Nov 2022 18:24:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3A3338582A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667931881; bh=Xxo6wRlXBHKhf7jrKRJJqzy2IAFPm6H9W1tQe8Yq6Fk=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=GaLtV6kIp77Ku9qurkKbfif0NqzBDUQuEPK6SZVmHWNkvXkT44tLIstNMfHbQhk5Q aLX8MmIVRPtL08y3+2O6+kZtDTPQaGo5A0+HIi9c3Z4kumEvmbRUz2HylgviTjuus8 n1fdH0Ok31eb8aZXPB1O3krmG56bZ/M7WA2OEH50= Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by sourceware.org (Postfix) with ESMTPS id 1703D385828C for ; Tue, 8 Nov 2022 18:24:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1703D385828C Received: by mail-io1-xd34.google.com with SMTP id r81so12142571iod.2 for ; Tue, 08 Nov 2022 10:24:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Xxo6wRlXBHKhf7jrKRJJqzy2IAFPm6H9W1tQe8Yq6Fk=; b=arojImPiuatzUwhELvN/y1U0czCOEPCZwkg5JjpWO1+awSdrX51s4eY/JzK0R7z7KW RqnKuSKIecahl/c1ITTZCuTLJP6/UdZn+oYJ7QD87m0bhaKUJd2yflb3hBVARY7Edsmw X7Zq3DXRuHBUJPKqrvPycnbowlcmMoZODxm598ku2nrTMt0MhzHKEVWz+ldi3yXfNUHU WmAj0g6Mh69f1D3cjhvcw/6XdAVjo5KZZBlVIyH5T4DDsM3iKSK4SDG0O7Q5IPtZsgZz 1+be+Gm/Jq4+BgwybY+lQGO/wtnYLBO+Vhr1UDqDlOS6BINODX2Suv426o9kQE91Gy5N nV9Q== X-Gm-Message-State: ACrzQf0xgHILquN2dSEjHhL1WNY532t/dw6SubtKiWhXWQ9AqLu05gNz kbUfL7mArAHu3nvXVGpLA1dU0WUpzFRC1w== X-Google-Smtp-Source: AMsMyM59kbfhq5huySmZIRi1lk6Zd8I5ewzLMZ8BiCqk6BT569SzKadbVUkOKbhmeSgV8K+Pj010WQ== X-Received: by 2002:a02:7a19:0:b0:375:41a7:4fb with SMTP id a25-20020a027a19000000b0037541a704fbmr31375103jac.235.1667931859248; Tue, 08 Nov 2022 10:24:19 -0800 (PST) Received: from murgatroyd (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id b13-20020a026f4d000000b003743cc92b27sm3964914jae.157.2022.11.08.10.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:24:18 -0800 (PST) To: Jon Turney Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Use strwinerror in gdb/windows-nat.c References: <20220728170555.85143-1-tromey@adacore.com> <877d38e1f7.fsf@tromey.com> X-Attribution: Tom Date: Tue, 08 Nov 2022 11:24:18 -0700 In-Reply-To: (Jon Turney's message of "Fri, 4 Nov 2022 14:21:04 +0000") Message-ID: <87k045484t.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom Tromey via Gdb-patches Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" >>>>> "Jon" == Jon Turney writes: >> I'm checking this in now. Jon> As is traditional by now, this breaks the Cygwin build. Sorry about that. I don't break Cygwin on purpose, but I also don't have any way to do a test build. Jon> I'd suggest the attached to fix this, but I don't think this qualifies Jon> as obvious, since it's not obvious what USE_WIN32API is supposed to Jon> mean, so a review would be useful. I don't fully know either, but this is what gdbsupport/common.m4 says: case ${host} in *mingw32*) AC_DEFINE(USE_WIN32API, 1, [Define if we should use the Windows API, instead of the POSIX API. On Windows, we use the Windows API when building for MinGW, but the POSIX API when building for Cygwin.]) WIN32APILIBS="-lws2_32" Jon> Commit 02d04eac "Use strwinerror in gdb/windows-nat.c" also moves Jon> strwinerror() under the USE_WIN32API conditional, which is not defined Jon> for Cygwin (and looks like it shouldn't be, as appears to imply Jon> non-POSIX and MiNGW and WinSock...) Jon> Also enable the declaration and definition of strwinerror() when Jon> __CYGWIN__ is defined. I'm not sure how this area ought to work on Cygwin. The goal here is to get a better error message when some Windows API fails. If Cygwin can use strwinerror, then this seems fine. If not, I could write a patch to stub this out for Cygwin, which would be the status quo ante. Tom