From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39806 invoked by alias); 17 Feb 2017 16:45:25 -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 39455 invoked by uid 89); 17 Feb 2017 16:45:21 -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= 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; Fri, 17 Feb 2017 16:45:20 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 104377FB7F; Fri, 17 Feb 2017 16:45:11 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1HGj219017564; Fri, 17 Feb 2017 11:45:03 -0500 Subject: Re: [pushed][PATCH v3 1/4] Extended-remote follow exec To: Thomas Schwinge , Don Breazeal , gdb-patches@sourceware.org References: <1441996698-12694-1-git-send-email-donb@codesourcery.com> <87vauuiqkj.fsf@euler.schwinge.homeip.net> Cc: bug-hurd@gnu.org, 834575@bugs.debian.org, 834575-forwarded@bugs.debian.org, svante.signell@gmail.com From: Pedro Alves Message-ID: <49527ebd-a1b3-fff2-fc59-bb557e6d0c50@redhat.com> Date: Fri, 17 Feb 2017 16:45:00 -0000 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: <87vauuiqkj.fsf@euler.schwinge.homeip.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00497.txt.bz2 Hi Thomas, Only noticed this patch now. > On GNU/Hurd, there is no "#define PATH_MAX", so this fails to build. > (I'm aware that there is other PATH_MAX usage in GDB sources, which we > ought to fix at some point, for example in gdbserver -- which is not yet > enabled for GNU/Hurd.) > > OK to push the following? (Similar to Svante's patch in > .) > > --- gdb/remote.c > +++ gdb/remote.c > @@ -6927,7 +6927,6 @@ Packet: '%s'\n"), > else if (strprefix (p, p1, "exec")) > { > ULONGEST ignored; > - char pathname[PATH_MAX]; > int pathlen; > > /* Determine the length of the execd pathname. */ > @@ -6936,11 +6935,12 @@ Packet: '%s'\n"), > > /* Save the pathname for event reporting and for > the next run command. */ > + char *pathname = (char *) xmalloc (pathlen + 1); > hex2bin (p1, (gdb_byte *) pathname, pathlen); > pathname[pathlen] = '\0'; hex2bin can throw, so wrap with a cleanup: char *pathname = (char *) xmalloc (pathlen + 1); struct cleanup *old_chain = make_cleanup (xfree, pathname); hex2bin (p1, (gdb_byte *) pathname, pathlen); pathname[pathlen] = '\0'; discard_cleanups (old_chain); OK with that change. Thanks, Pedro Alves