From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by sourceware.org (Postfix) with ESMTPS id 56DF6385781D for ; Wed, 9 Jun 2021 23:30:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 56DF6385781D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f50.google.com with SMTP id i94so22230646wri.4 for ; Wed, 09 Jun 2021 16:30:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ooDxHtUDDlTdCvskLToOXbcXUZBhIC1VDdaLyuVLbTE=; b=N3zsJpYSepHsNZQMvgRVBkqTINxFzXZ90DIDPQrmGiuSmrWke2zEPVcG16Kx1TzS3Z 5lWLk93FkXG6ONb9/QNdrO8MvcpOjzlGlhxxwoyNSpXX9/jKolQ+GIXT8I0dcYeOaRYj hDH12m28ykvcN92L9YOSbxQVEKpNgjh+5qejcG7B3KENMSyLMQL9eu4nBoGjYwhWgwN5 /5eGo3jzsHwqRvUYhoe4clSFtx/TGCwJhSQ7sZqIrb2rwJgNIML0DGPfCjBocob7qfii kHDg+dkFubmBLegqBqlV1ng03vsf8fwevEdZCvjoD4N2lmX/0C4oIrmgDahZ3S/yW0XB A22g== X-Gm-Message-State: AOAM530oqL6DLtOP0TAWYShGFAVMnjqlxhkBHDRaC7mt31Wc+1Q1f97y hl0t+GLGLm1Lvh6k4Qy3cD1wLdss/9TSWw== X-Google-Smtp-Source: ABdhPJxZIDFY6NnJJNf/o6oGCYrsTl4MTwk+TBIVR7qNdJeqNNd4tSRRsebgGkQp90dEmx0q7TwdlQ== X-Received: by 2002:a5d:648a:: with SMTP id o10mr2148021wri.274.1623281430791; Wed, 09 Jun 2021 16:30:30 -0700 (PDT) Received: from ?IPv6:2001:8a0:f932:6a00:46bc:d03b:7b3a:2227? ([2001:8a0:f932:6a00:46bc:d03b:7b3a:2227]) by smtp.gmail.com with ESMTPSA id b8sm8225412wmd.35.2021.06.09.16.30.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 16:30:29 -0700 (PDT) Subject: Re: [PATCH 4/4] gnulib: import select From: Pedro Alves To: Tom Tromey , Mike Frysinger via Gdb-patches References: <20210529172510.16285-1-vapier@gentoo.org> <20210529172510.16285-4-vapier@gentoo.org> <87bl8hn3y5.fsf@tromey.com> <46d0d024-1892-3584-3523-e8f5b2997630@palves.net> <44f44b32-0c9e-cdf0-69fa-f79a89295c04@palves.net> Message-ID: <60800830-8909-07a4-3357-b01ac66b44fc@palves.net> Date: Thu, 10 Jun 2021 00:30:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 09 Jun 2021 23:30:33 -0000 On 2021-06-09 7:32 p.m., Mike Frysinger wrote: > On 09 Jun 2021 19:12, Pedro Alves wrote: >> On 2021-06-09 5:52 p.m., Mike Frysinger wrote: >>> On 09 Jun 2021 13:27, Pedro Alves wrote: >>>> I've always feared that gnulib's select module would conflict with that, >>>> but I don't know for sure. In theory, we should be able to replace all >>>> that code by using gnulib's select instead, though I'm not sure gnulib >>>> handles some particulars like Ctrl-C interruption. >>> >>> why do you think it would conflict ? the file doesn't seem to use select() >>> at all, and ser-mingw is always enabled for mingw targets. seems like the >>> func would just be ignored. >> >> gnulib also sometimes replaces headers with their own incompatible >> definitions. > > good point, but i'm not sure how that matters to ser-mingw specifically. > it isn't including any select.h related headers, just Windows-specific ones. I meant to also point at mingw-hdep.c, which is where gdb_select implementation lives. That of course, includes sys/select.h via gdb_select.h. I misremembered that gdb_select itself was in ser-mingw.c too. mingw's version of gdb_select is built on top of the ser-mingw.c and struct serial, but lives in mingw-hdep.c. Also, the sockets module was pulled in as well as dependency, and I suppose that hides the SOCKET vs int, close vs closesocket, _get_osfhandle, read/write vs send/recv etc. WinSock2 particularities, and don't know whether that can cause issues in the code that we have that assumes native Windows sockets on mingw, which you'll find a lot of if you look for USE_WIN32API, particularly in gdbserver and gdbreplay. If it does, it may not be noticeable with a build-only check. Even if it doesn't, there's now a lot of USE_WIN32API code in gdb, gdbsupport and gdbserver that is now ripe for cleansing. In addition to close vs closesocket, read vs send etc I mentioned above, there should be no need anymore to include the windows/winsock headers to get access to sockets things, we should call gl_sockets_startup instead of WSAStartup, etc. > i haven't gone through that list (and indirect includes) explicitly. but i > would expect the build to at least warn or fail if that were the case. > > did you have any specific concerns here ? or just aiming for due diligence > with the testsuite to assuage general unease ? The latter, but I wasn't thinking of a testsuite run, which is notoriously difficult on Windows. More like a smoke test, run GDB, to make sure you can still debug something. Also, a quick check to make sure remote debugging against a Windows GDBserver built from master still works would be good -- gdbserver also uses gnulib, and uses select (not gdb_select) and sockets. Interestingly, this module import may have put us closer to removing the Windows gdbserver limitation that it only works with tcp/ip socket connections, particularly interesting being pipes, for "target remote | gdbserver" support. Thanks, Pedro Alves