From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64324 invoked by alias); 23 Jun 2015 15:28:31 -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 64274 invoked by uid 89); 23 Jun 2015 15:28:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 23 Jun 2015 15:28:29 +0000 Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id E8DCA3406C0; Tue, 23 Jun 2015 15:28:26 +0000 (UTC) Date: Tue, 23 Jun 2015 15:28:00 -0000 From: Mike Frysinger To: Gary Benson Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb: sim: handle target sysroot prefix Message-ID: <20150623152826.GG17734@vapier> Mail-Followup-To: Gary Benson , gdb-patches@sourceware.org References: <1434910105-7023-1-git-send-email-vapier@gentoo.org> <20150622095026.GA22082@blade.nx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4f28nU6agdXSinmL" Content-Disposition: inline In-Reply-To: <20150622095026.GA22082@blade.nx> X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00471.txt.bz2 --4f28nU6agdXSinmL Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1051 On 22 Jun 2015 10:50, Gary Benson wrote: > Mike Frysinger wrote: > > @@ -715,7 +717,9 @@ gdbsim_open (const char *args, int from_tty) > > } > > /* Pass along gdb's concept of the sysroot. */ > > strcat (arg_buf, " --sysroot=3D"); > > - strcat (arg_buf, gdb_sysroot); > > + if (startswith (sysroot, TARGET_SYSROOT_PREFIX)) > > + sysroot +=3D strlen (TARGET_SYSROOT_PREFIX); > > + strcat (arg_buf, sysroot); > > /* finally, any explicit args */ > > if (args) > > { >=20 > Please use "is_target_filename (sysroot)" rather than startswith. OK > Please also update the "strlen (gdb_sysroot)" in this function. OK > Please note that gdb_sysroot can be NULL. how so ? main.c:captured_main specifically handles that: /* Set the sysroot path. */ gdb_sysroot =3D relocate_gdb_directory (TARGET_SYSTEM_ROOT, TARGET_SYSTEM_ROOT_RELOCATABLE); if (gdb_sysroot =3D=3D NULL || *gdb_sysroot =3D=3D '\0') { xfree (gdb_sysroot); gdb_sysroot =3D xstrdup (TARGET_SYSROOT_PREFIX); } -mike --4f28nU6agdXSinmL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJViXsaAAoJEEFjO5/oN/WB5moQALT3WDcpX5EmkusNpNQV7WZ5 xW5WUUEmpYsjYQ2JYoRcnAPByUks08YlgvdLp0uQJvzBF0CG+hFNry+pu/TXDwto CbCC5DOXpCfLPe+YXG4gDrTqWfTAMNq44t535GGHPi71nzM7BbZA1yNa0xm+WrqL CbnMScQlIIMCBbIujPIhYHYsV07dXpMBS3i/MMnmhKQ8CQl5aJGm5o4rA24qLO4C dm0A5eP4e65aFzPndXb0jL9Ci0LMTf8Rr6gbVZ2MHP+saeyy+ID4oCGHlNYofP5t EFLNozlC8B1vsof/5HhtPZBsyiaVoFja40YAlPn1jrvLnlbnkR9P+prp2L63srT1 e7rjHL+cX41z0gbSHHSvegtyqaKLqyFBvZaxK+R6Xa31OsSxLAiHz9jqakWnNCjy J+ieJmd0mqIUEtHw3zE4Cx+2yaOP4hNByj4oN+pHedk2nat9JbieECTA+XajCYEA HXmzC+tyOm3BIs+ZZeQqLc/ep8ot+M75RgZrnjFJvCj/xT1+00qQ0/gJJMpmlzl/ dqQEWWc/C/ikzSLnNIF5bl0a8bNoQn935BQ2yWRhBNuyjxkQc0EeoU8IHrq2FT8+ ywFfVmIp6KVyDoVQ+GzXt3PGG5HJD2/sjDs4Qg8TBdYc2jaEEGjT6eRMRqUXrrCZ PhN1SfMzBj6xNRuNM7zF =+pRs -----END PGP SIGNATURE----- --4f28nU6agdXSinmL--