From patchwork Wed Sep 20 12:17:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 22970 Received: (qmail 20971 invoked by alias); 20 Sep 2017 12:17:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 20961 invoked by uid 89); 20 Sep 2017 12:17:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=boy, it'll, itll, sergiodj 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 12:17:15 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1DA691FC3 for ; Wed, 20 Sep 2017 12:17:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C1DA691FC3 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEBEE60BE2; Wed, 20 Sep 2017 12:17:11 +0000 (UTC) Subject: Re: [PATCH v2 1/5] Import "glob" and "getcwd" modules from gnulib To: Sergio Durigan Junior , GDB Patches References: <20170912042325.14927-1-sergiodj@redhat.com> <20170919042842.9210-1-sergiodj@redhat.com> <87y3pbwbgl.fsf@redhat.com> From: Pedro Alves Message-ID: <0f9f2e47-dc17-0bd8-5445-0cf40160929e@redhat.com> Date: Wed, 20 Sep 2017 13:17:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87y3pbwbgl.fsf@redhat.com> 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. > 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. > * ser-tcp.c: Do not (re)define "close". > This is: is defined, but it wasn't obvious to me whether it'll end up defined with the current set of modules. Boy, these modules sure bring in a lot of stuff. 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. Thanks, Pedro Alves --- 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