From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17754 invoked by alias); 29 May 2013 09:26:16 -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 17740 invoked by uid 89); 29 May 2013 09:26:15 -0000 X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,TW_XS autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 29 May 2013 09:26:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 721452EB25; Wed, 29 May 2013 05:26:13 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BsgNL7CDjXoF; Wed, 29 May 2013 05:26:13 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id BE5B22E485; Wed, 29 May 2013 05:26:12 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id BBE34C278A; Wed, 29 May 2013 13:26:06 +0400 (RET) Date: Wed, 29 May 2013 09:26:00 -0000 From: Joel Brobecker To: Svante Signell Cc: Sergio Durigan Junior , Pedro Alves , gdb-patches@sourceware.org Subject: Re: Small patch to enable build of gdb-7.6 for GNU/Hurd Message-ID: <20130529092606.GD5751@adacore.com> References: <519F2A7A.4050002@redhat.com> <1369386446.8127.51.camel@s1499.it.kth.se> <1369654913.8127.84.camel@s1499.it.kth.se> <20130527121028.GB5751@adacore.com> <1369657278.8127.90.camel@s1499.it.kth.se> <1369662500.8127.97.camel@s1499.it.kth.se> <1369663027.8127.99.camel@s1499.it.kth.se> <20130527143053.GC5751@adacore.com> <1369670373.8127.116.camel@s1499.it.kth.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1369670373.8127.116.camel@s1499.it.kth.se> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-05/txt/msg00984.txt.bz2 > 2013-05-27 Svante Signell > > * nto-tdep.c (nto_init_solib_absolute_prefix): Solve build > problems for systems not defining PATH_MAX by using xstrprintf > followed by a cleanup. As noticed by Thomas, he's right that we are introducing extra quoting of the command's argument, and I don't think we should be doing that in this patch. We can discuss the need to do so, but it should be done separately. Other than that, the patch looks good to me. Just give it a few more days (say until Monday) before we commit the patch. Do you have an FSF copyright assignment on file? > --- a/gdb/nto-tdep.c > +++ b/gdb/nto-tdep.c > @@ -147,9 +147,10 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname) > void > nto_init_solib_absolute_prefix (void) > { > - char buf[PATH_MAX * 2], arch_path[PATH_MAX]; > + char *buf; > char *nto_root, *endian; > const char *arch; > + struct cleanup *old_chain; > > nto_root = nto_target (); > if (strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name, "i386") == 0) > @@ -172,10 +173,11 @@ nto_init_solib_absolute_prefix (void) > == BFD_ENDIAN_BIG ? "be" : "le"; > } > > - xsnprintf (arch_path, sizeof (arch_path), "%s/%s%s", nto_root, arch, endian); > - > - xsnprintf (buf, sizeof (buf), "set solib-absolute-prefix %s", arch_path); > + buf = xstrprintf ("set solib-absolute-prefix \"%s/%s%s\"", > + nto_root, arch, endian); > + old_chain = make_cleanup (xfree, buf); > execute_command (buf, 0); > + do_cleanups (old_chain); > } > > char ** -- Joel