From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113855 invoked by alias); 20 Sep 2017 17:17:37 -0000 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 Received: (qmail 113830 invoked by uid 89); 20 Sep 2017 17:17:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:3230 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Sep 2017 17:17:30 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AFFEAA0BE7 for ; Wed, 20 Sep 2017 17:17:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AFFEAA0BE7 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sergiodj@redhat.com Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 892AE5E1D1; Wed, 20 Sep 2017 17:17:29 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches Subject: Re: [PATCH v2 1/5] Import "glob" and "getcwd" modules from gnulib References: <20170912042325.14927-1-sergiodj@redhat.com> <20170919042842.9210-1-sergiodj@redhat.com> <87y3pbwbgl.fsf@redhat.com> <0f9f2e47-dc17-0bd8-5445-0cf40160929e@redhat.com> Date: Wed, 20 Sep 2017 17:17:00 -0000 In-Reply-To: <0f9f2e47-dc17-0bd8-5445-0cf40160929e@redhat.com> (Pedro Alves's message of "Wed, 20 Sep 2017 13:17:11 +0100") Message-ID: <8760cdp9w7.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00509.txt.bz2 On Wednesday, September 20 2017, Pedro Alves wrote: > On 09/19/2017 05:37 AM, Sergio Durigan Junior wrote: >> [ Resending as the original e-mail got bounced because it is too long to >> be posted here. ] >> >> The full patch can be seen here: >> >> https://git.sergiodj.net/binutils-gdb.git/commit/?h=sergiodj/set-cwd-command&id=acf35a31bac3951f81d0446564b7f910a0fee21c >> >> These two modules are necessary because of the rework that will be >> done in the "change directory" logic on GDB/gdbserver in the next >> commits. >> >> First, we will get rid of the "gdb_dirbuf" global variable and instead >> rely on the fact that "getcwd (NULL, 0)" returns a heap-allocated >> string with the necessary bytes to hold the full path. > > Should mention that that's a GNU extension here. Done. >> As a side note, we no longer need to define "close" on gdb/ser-tcp.c, >> so the patch removes that. >> >> gdb/ChangeLog: >> yyyy-mm-dd Sergio Durigan Junior >> >> * gnulib/aclocal.m4: Regenerate. >> * gnulib/config.in: Likewise. > ... > >> * gnulib/import/unistd-safer.h: Likewise. > > Please say "New file." for new files above, not Likewise->Regenerate. There's actually a "New file." in the middle, and there's also another "Regenerate." (and yet another "New file.") also. But I agree that specifying what happened explicitly is better for such long ChangeLogs. Done. >> * ser-tcp.c: Do not (re)define "close". >> > > This is: > > --- a/gdb/ser-tcp.c > +++ b/gdb/ser-tcp.c > @@ -42,7 +42,6 @@ > #ifndef ETIMEDOUT > #define ETIMEDOUT WSAETIMEDOUT > #endif > -#define close(fd) closesocket (fd) > > Are you sure that the gnulib code that makes close work > for sockets is enabled? I guess it will if WINDOWS_SOCKETS > is defined, but it wasn't obvious to me whether it'll end > up defined with the current set of modules. One of the dependencies of "getcwd" is the "close" module, and whenever I tried to compile this patch with mingw it would fail because of this re-definition of close made by ser-tcp.c. My first approach was to #undef close before ser-tcp.c redefined it, but then I decided to just use "close" from gnulib. I didn't know about this WINDOWS_SOCKETS requirement; maybe we can define it before the inclusion of ? Or maybe choose the safe side and let ser-tcp.c redefine close as needed. > Boy, these modules sure bring in a lot of stuff. Yeah, "getcwd" did. > I noticed that this is bringing in the strerror module, which was > problematic in the past on mingw [1]. Could you please try > cross building gdb for mingw (should be easy since Fedora has > cross compilers handy), to confirm that it's alright now? > It it works, we could get rid of safe_strerror in a follow up > patch. > > [1] https://sourceware.org/ml/gdb-patches/2013-11/msg00597.html > I don't recall whether that's been fixed meanwhile. Before submitting the patch I had compiled it for mingw, and everything worked OK. I did it again just in case, and it's still working. So I believe the issue is fixed. -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/