This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 1/5] Import "glob" and "getcwd" modules from gnulib
- From: Pedro Alves <palves at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>, GDB Patches <gdb-patches at sourceware dot org>
- Date: Wed, 20 Sep 2017 13:17:11 +0100
- Subject: Re: [PATCH v2 1/5] Import "glob" and "getcwd" modules from gnulib
- Authentication-results: sourceware.org; auth=none
- 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 at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C1DA691FC3
- References: <20170912042325.14927-1-sergiodj@redhat.com> <20170919042842.9210-1-sergiodj@redhat.com> <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 <sergiodj@redhat.com>
>
> * 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:
--- 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.
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