From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-io1-xd34.google.com with SMTP id r81so12142571iod.2 for ; Tue, 08 Nov 2022 10:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Xxo6wRlXBHKhf7jrKRJJqzy2IAFPm6H9W1tQe8Yq6Fk=; b=LTdanzOYP98VbkQsANhgbYAdGrAOiWQIg/3f0IpMz3O7CKGTyOFD+4C1F6IHb1ReV0 KK/EOCsJTlRA22bZxtZn8I6rtW2CIdK+eO1iVAajpzburjp/ek2MDW1oPv2v8MveQoFK mCz8ALYUgTWgHE9ovXzJvODdOQysc4K6aweUihwvkV+L61f//vXOnhN+U+kgLKAmtLLe Mn89dZFzpHPCp/p8Lg9Fh3MS7dW58xRJ+Vq3APyMg3AsJVZe+zRM2NoR4Ybzm8NTpBQu jxdrArGLZcBonAic9gBxE4FBfO7hlmBKZZkPEuxVyoEaTkr6Hg5UzDGqmE/Iia4MboSp Js2g== 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) From: Tom Tromey 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-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "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