From: Pedro Alves <palves@redhat.com>
To: Mike Frysinger <vapier@gentoo.org>, gdb-patches@sourceware.org
Cc: gbenson@redhat.com
Subject: Re: [PATCH v2] gdb: sim: handle target sysroot prefix
Date: Wed, 24 Jun 2015 13:47:00 -0000 [thread overview]
Message-ID: <558AB4D2.5030905@redhat.com> (raw)
In-Reply-To: <1435073379-30787-1-git-send-email-vapier@gentoo.org>
On 06/23/2015 04:29 PM, Mike Frysinger wrote:
> gdb/remote-sim.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
> index fd2fd58..0c43379 100644
> --- a/gdb/remote-sim.c
> +++ b/gdb/remote-sim.c
> @@ -21,6 +21,7 @@
> along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> #include "defs.h"
> +#include "gdb_bfd.h"
> #include "inferior.h"
> #include "infrun.h"
> #include "value.h"
> @@ -669,6 +670,7 @@ gdbsim_open (const char *args, int from_tty)
> int len;
> char *arg_buf;
> struct sim_inferior_data *sim_data;
> + const char *sysroot = gdb_sysroot;
> SIM_DESC gdbsim_desc;
>
> if (remote_debug)
> @@ -688,7 +690,7 @@ gdbsim_open (const char *args, int from_tty)
> len = (7 + 1 /* gdbsim */
> + strlen (" -E little")
> + strlen (" --architecture=xxxxxxxxxx")
> - + strlen (" --sysroot=") + strlen (gdb_sysroot) +
> + + strlen (" --sysroot=") + strlen (sysroot) +
> + (args ? strlen (args) : 0)
> + 50) /* slack */ ;
> arg_buf = (char *) alloca (len);
> @@ -715,7 +717,9 @@ gdbsim_open (const char *args, int from_tty)
> }
> /* Pass along gdb's concept of the sysroot. */
> strcat (arg_buf, " --sysroot=");
> - strcat (arg_buf, gdb_sysroot);
> + if (is_target_filename (sysroot))
> + sysroot += strlen (TARGET_SYSROOT_PREFIX);
Please do this skipping above the "len = " computation. As is
we'll just oversize arg_bug, but there's no good reason
for the discrepancy.
OK with that change.
(it would be easy to get rid of all that using reconcat.)
Thanks you; thanks Gary.
--
Pedro Alves
next prev parent reply other threads:[~2015-06-24 13:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-21 18:08 [PATCH] " Mike Frysinger
2015-06-22 9:50 ` Gary Benson
2015-06-23 15:28 ` Mike Frysinger
2015-06-24 10:30 ` Gary Benson
2015-06-25 8:35 ` [OB PATCH] Remove gdb_sysroot NULL checks Gary Benson
2015-06-23 15:29 ` [PATCH v2] gdb: sim: handle target sysroot prefix Mike Frysinger
2015-06-24 10:31 ` Gary Benson
2015-06-24 13:47 ` Pedro Alves [this message]
2015-06-24 14:32 ` Mike Frysinger
2015-06-23 15:29 ` [PATCH] gdb: microblaze: delete useless stubs Mike Frysinger
2015-06-23 15:31 ` Mike Frysinger
2015-06-23 17:39 ` Michael Eager
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=558AB4D2.5030905@redhat.com \
--to=palves@redhat.com \
--cc=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox