From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: Re: [PATCH 1/4] native-gdbserver: Clear isremote flag in board info
Date: Mon, 11 Apr 2016 18:40:00 -0000 [thread overview]
Message-ID: <570BEF8B.70203@redhat.com> (raw)
In-Reply-To: <1459912543-15328-1-git-send-email-simon.marchi@polymtl.ca>
On 04/06/2016 04:15 AM, Simon Marchi wrote:
> There seems to be some confusion globally in the testsuite about what's
> native and what's not, what's remote and what's not. It's probably
> because of the overlap in vocabulary between DejaGnu and GDB.
Yeah. This whole mess, and the confusion it brings in, has been a known
issue for a long time, and I'm very glad someone's doing something about it!
> Because of this confution, a lot of tests in the testsuite don't check
> for the right kind of target remote. For example, some use [is_remote
> target] (which checks whether the DejaGnu target is remote), when what
> they really want to know is whether GDB is using its remote target (e.g.
> because feature X is only available when GDB debugs natively). Those
> should use [gdb_is_target_remote] instead.
Note gdb_is_target_remote is a bit "heavy" in that it runs a gdb
command to check what is the target _right now_. For checks at
the top of testcases that want to bail out early before even
gdb is started, it's cheaper to check:
[target_info gdb_protocol] == "remote" || [target_info gdb_protocol] == "extended-remote"]
(we should have a proc for that...)
My fault for introducing gdb_is_target_remote and using in several
places, when the "cheaper" test would do.
> Also, some of them require careful analysis/discussion. I'd still like
> to submit this patch right now anyway, since I don't want to spend
> countless hours fixing everything and then be told that my approach is
> wrong... I'd like to be told right away, if that's the case :).
I think you're on the right track.
> So, I
> have included a few examples of fixed tests in the following patches,
> but it's by no means comprehensive.
>
> --- a/gdb/testsuite/boards/native-gdbserver.exp
> +++ b/gdb/testsuite/boards/native-gdbserver.exp
> @@ -36,26 +36,6 @@ set_board_info exit_is_reliable 1
> # We will be using the standard GDB remote protocol.
> set_board_info gdb_protocol "remote"
>
> -proc ${board}_spawn { board cmd } {
> - global board_info
> +set baseboard [lindex [split $board "/"] 0]
> +set board_info($baseboard,isremote) 0
OOC, don't we need the "global" declarations as
in native-extended-gdbserver.exp?
You're probably already thinking of doing this, but I'll state it
explicitly anyway: it'd be nice to move this isremote frobbing to
a shared .exp file, so that boards that need it can just
source the file.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-04-11 18:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-06 3:15 Simon Marchi
2016-04-06 3:15 ` [PATCH 2/4] Fix annota-input-while-running.exp remote check Simon Marchi
2016-04-11 18:03 ` Pedro Alves
2016-05-02 17:07 ` Simon Marchi
2016-04-06 3:15 ` [PATCH 3/4] Fix detach.exp " Simon Marchi
2016-04-11 18:16 ` Pedro Alves
2016-05-02 17:11 ` Simon Marchi
2016-04-06 3:15 ` [PATCH 4/4] Fix solib-display.exp " Simon Marchi
2016-04-11 18:27 ` Pedro Alves
2016-04-11 19:26 ` Simon Marchi
2016-04-11 21:32 ` Pedro Alves
2016-04-11 21:38 ` Pedro Alves
2016-05-02 18:20 ` Simon Marchi
2016-05-02 18:28 ` Pedro Alves
2016-05-02 19:52 ` Simon Marchi
2016-05-03 23:19 ` Pedro Alves
2016-04-11 18:40 ` Pedro Alves [this message]
2016-04-11 19:14 ` [PATCH 1/4] native-gdbserver: Clear isremote flag in board info Simon Marchi
2016-04-11 21:29 ` Pedro Alves
2016-04-11 23:14 ` Simon Marchi
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=570BEF8B.70203@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.com \
--cc=simon.marchi@polymtl.ca \
/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