From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: "Wei-cheng Wang" <cole945@gmail.com>, Tom Tromey <tromey@redhat.com>
Subject: Re: [testsuite] setting sysroot for target-board
Date: Fri, 06 May 2011 09:47:00 -0000 [thread overview]
Message-ID: <201105061047.24349.pedro@codesourcery.com> (raw)
In-Reply-To: <BANLkTikS7hoC=Lh4gZKODmt1JxnYwgqWyQ@mail.gmail.com>
On Friday 06 May 2011 03:24:08, Wei-cheng Wang wrote:
> Here is the update :-)
>
> 2011-05-06 Wei-cheng Wang <cole945@gmail.com>
>
> * lib/gdbserver-support.exp: Add support for setting sysroot for
> target system.
>
> --- a/gdb/testsuite/lib/gdbserver-support.exp
> +++ b/gdb/testsuite/lib/gdbserver-support.exp
> @@ -36,6 +36,10 @@
> # Port id to use for socket connection. If not set explicitly,
> # it will start at "2345" and increment for each use.
> #
> +# set_board_info gdb,sysroot
> +# System root for the target to find shared libraries.
> +# If target and host are different, this should be properly set.
> +#
>
> #
> # gdb_target_cmd
> @@ -44,6 +48,11 @@
> proc gdb_target_cmd { targetname serialport } {
> global gdb_prompt
Doing this here assumes you'll only need the sysroot after connecting.
How have you tested this? It seems you forgot the MI equivalent.
I think a better place would be right after spawning
gdb (default_gdb_start/default_mi_gdb_start). If since you
already have a board file anyway, you could also override *gdb_start
and do it there instead of adding a new flag.
>
> + if [target_info exists gdb,sysroot] {
> + set gdb_sysroot [target_info gdb,sysroot]
> + send_gdb "set sysroot $gdb_sysroot\n"
This leaves a gdb prompt in the expect buffer, which is a recipe
for trouble. I guess it doesn't cause trouble as it, because
the "target foo" command below doesn't happen to have
a '-re ".*$gdb_prompt"' match, but that's fragile.
(actually it may cause trouble afterwards if the -notransfer regex
matches)
> + }
>
> Wei-cheng
>
> On Fri, May 6, 2011 at 1:36 AM, Tom Tromey <tromey@redhat.com> wrote:
> >>>>>> ">" == Wei-cheng Wang <cole945@gmail.com> writes:
> >
> >>> When testing remote cross-target, libc and other shared libraries
> >>> will not be compatible with the one on host.
> >
> >>> This patch adds support for setting sysroot in target-board files, e.g.,
> >>> set_board_info gdb,sysroot "/path/to/target/libc",
> >>> so that testsuite can be used for remote cross-target.
> >
> > I think this looks reasonable.
> >
> > There is a comment just above the definition of gdb_target_cmd that
> > needs an update for this new parameter.
> >
> > This patch also needs a ChangeLog entry.
> >
> > Tom
> >
>
--
Pedro Alves
next prev parent reply other threads:[~2011-05-06 9:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 8:09 Wei-cheng Wang
2011-05-05 17:37 ` Tom Tromey
2011-05-06 2:24 ` Wei-cheng Wang
2011-05-06 9:47 ` Pedro Alves [this message]
2011-05-08 17:01 ` Wei-cheng Wang
2011-05-09 11:39 ` Pedro Alves
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=201105061047.24349.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=cole945@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/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