public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, testsuite] Add cc-with-dwz.exp add cc-with-dwz-m.exp
@ 2019-04-10  9:40 Tom de Vries
  2019-04-10 12:12 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Tom de Vries @ 2019-04-10  9:40 UTC (permalink / raw)
  To: gdb-patches

Hi,

While we can use CC_WITH_TWEAKS_FLAGS like this:
...
$ cd $objdir/gdb
$ make check \
    RUNTESTFLAGS='--target_board=cc-with-tweaks' \
    CC_WITH_TWEAKS_FLAGS='-z'
...
this doesn't work:
...
$ cd $objdir
$ make check-gdb \
    RUNTESTFLAGS='--target_board=cc-with-tweaks' \
    CC_WITH_TWEAKS_FLAGS='-z'
...

Add cc-with-dwz.exp add cc-with-dwz-m.exp, that can be used like this:
...
$ cd $objdir
$ make check-gdb \
    RUNTESTFLAGS='--target_board=cc-with-dwz'
...

Tested on x86_64-linux.

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Add cc-with-dwz.exp add cc-with-dwz-m.exp

gdb/testsuite/ChangeLog:

2019-04-10  Tom de Vries  <tdevries@suse.de>

	* boards/cc-with-dwz-m.exp: New file.
	* boards/cc-with-dwz.exp: New file.
	* boards/cc-with-tweaks.exp: Note that check-gdb doesn't work.

---
 gdb/testsuite/boards/cc-with-dwz-m.exp  | 28 ++++++++++++++++++++++++++++
 gdb/testsuite/boards/cc-with-dwz.exp    | 28 ++++++++++++++++++++++++++++
 gdb/testsuite/boards/cc-with-tweaks.exp |  3 +++
 3 files changed, 59 insertions(+)

diff --git a/gdb/testsuite/boards/cc-with-dwz-m.exp b/gdb/testsuite/boards/cc-with-dwz-m.exp
new file mode 100644
index 0000000000..f5348508a1
--- /dev/null
+++ b/gdb/testsuite/boards/cc-with-dwz-m.exp
@@ -0,0 +1,28 @@
+# Copyright 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is a dejagnu "board file" and is used to run the testsuite
+# with contrib/cc-with-tweaks.sh -m.
+#
+# NOTE: We assume dwz is in $PATH.
+#
+# Example usage:
+# bash$ cd $objdir
+# bash$ make check-gdb \
+#   RUNTESTFLAGS='--target_board=cc-with-dwz-m' \
+#
+
+set CC_WITH_TWEAKS_FLAGS "-m"
+load_board_description "cc-with-tweaks"
diff --git a/gdb/testsuite/boards/cc-with-dwz.exp b/gdb/testsuite/boards/cc-with-dwz.exp
new file mode 100644
index 0000000000..dcf44f48c3
--- /dev/null
+++ b/gdb/testsuite/boards/cc-with-dwz.exp
@@ -0,0 +1,28 @@
+# Copyright 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is a dejagnu "board file" and is used to run the testsuite
+# with contrib/cc-with-tweaks.sh -z.
+#
+# NOTE: We assume dwz is in $PATH.
+#
+# Example usage:
+# bash$ cd $objdir
+# bash$ make check-gdb \
+#   RUNTESTFLAGS='--target_board=cc-with-dwz' \
+#
+
+set CC_WITH_TWEAKS_FLAGS "-z"
+load_board_description "cc-with-tweaks"
diff --git a/gdb/testsuite/boards/cc-with-tweaks.exp b/gdb/testsuite/boards/cc-with-tweaks.exp
index 59a53a87f9..2fac669453 100644
--- a/gdb/testsuite/boards/cc-with-tweaks.exp
+++ b/gdb/testsuite/boards/cc-with-tweaks.exp
@@ -19,10 +19,13 @@
 # NOTE: If using dwz, We assume it is in $PATH.
 #
 # Example usage:
+# bash$ cd $objdir/gdb
 # bash$ make check \
 #   RUNTESTFLAGS='--target_board=cc-with-tweaks' \
 #   CC_WITH_TWEAKS_FLAGS='-z'
 #
+# Note: this does not work from $objdir with make check-gdb.
+#
 # The default value of CC_WITH_TWEAKS_FLAGS is "".
 
 if ![info exists CC_WITH_TWEAKS_FLAGS] {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, testsuite] Add cc-with-dwz.exp add cc-with-dwz-m.exp
  2019-04-10  9:40 [PATCH, testsuite] Add cc-with-dwz.exp add cc-with-dwz-m.exp Tom de Vries
@ 2019-04-10 12:12 ` Pedro Alves
  2019-04-11  9:35   ` Tom de Vries
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2019-04-10 12:12 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 4/10/19 10:40 AM, Tom de Vries wrote:
> Hi,
> 
> While we can use CC_WITH_TWEAKS_FLAGS like this:
> ...
> $ cd $objdir/gdb
> $ make check \
>     RUNTESTFLAGS='--target_board=cc-with-tweaks' \
>     CC_WITH_TWEAKS_FLAGS='-z'
> ...
> this doesn't work:
> ...
> $ cd $objdir
> $ make check-gdb \
>     RUNTESTFLAGS='--target_board=cc-with-tweaks' \
>     CC_WITH_TWEAKS_FLAGS='-z'
> ...

Took me a bit to understand the difference here.  I think
spelling it out in English helps.  So, in the first case,
you're cd-ing to the gdb subdir and using "make check".
While in the second case, you're cd-ing to the top build dir,
and using "make check-gdb".

> 
> Add cc-with-dwz.exp add cc-with-dwz-m.exp, that can be used like this:
> ...
> $ cd $objdir
> $ make check-gdb \
>     RUNTESTFLAGS='--target_board=cc-with-dwz'
> ...

Sorry for being dense, but I was completely confused by this
description for a bit.  I didn't really understand what the
conclusion (new board) files had to do with the premise
("while this works, this does not").  And why does check-gdb
vs check make a difference?  I suspect that it's because CC_WITH_TWEAKS_FLAGS
is not passed down from the top level?  If so, or even if it's
something else, could you clarify both the proposed git commit
log, and the "does not work" comment added to the existing 
.exp file (add a "because CC_WITH_TWEAKS_FLAGS is not passed
down from the top level Makefile" or something like that), please?

Would passing down CC_WITH_TWEAKS_FLAGS from the top level be
a bad idea?

I do wonder why not just do the "cd $objdir/gdb" version instead.
Hope we don't grow into combinatorial explosion. :-D

Thanks,
Pedro Alves

> 
> Tested on x86_64-linux.
> 
> OK for trunk?
> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Add cc-with-dwz.exp add cc-with-dwz-m.exp
> 
> gdb/testsuite/ChangeLog:
> 
> 2019-04-10  Tom de Vries  <tdevries@suse.de>
> 
> 	* boards/cc-with-dwz-m.exp: New file.
> 	* boards/cc-with-dwz.exp: New file.
> 	* boards/cc-with-tweaks.exp: Note that check-gdb doesn't work.
> 
> ---
>  gdb/testsuite/boards/cc-with-dwz-m.exp  | 28 ++++++++++++++++++++++++++++
>  gdb/testsuite/boards/cc-with-dwz.exp    | 28 ++++++++++++++++++++++++++++
>  gdb/testsuite/boards/cc-with-tweaks.exp |  3 +++
>  3 files changed, 59 insertions(+)
> 
> diff --git a/gdb/testsuite/boards/cc-with-dwz-m.exp b/gdb/testsuite/boards/cc-with-dwz-m.exp
> new file mode 100644
> index 0000000000..f5348508a1
> --- /dev/null
> +++ b/gdb/testsuite/boards/cc-with-dwz-m.exp
> @@ -0,0 +1,28 @@
> +# Copyright 2019 Free Software Foundation, Inc.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +# This file is a dejagnu "board file" and is used to run the testsuite
> +# with contrib/cc-with-tweaks.sh -m.
> +#
> +# NOTE: We assume dwz is in $PATH.
> +#
> +# Example usage:
> +# bash$ cd $objdir
> +# bash$ make check-gdb \
> +#   RUNTESTFLAGS='--target_board=cc-with-dwz-m' \
> +#
> +
> +set CC_WITH_TWEAKS_FLAGS "-m"
> +load_board_description "cc-with-tweaks"
> diff --git a/gdb/testsuite/boards/cc-with-dwz.exp b/gdb/testsuite/boards/cc-with-dwz.exp
> new file mode 100644
> index 0000000000..dcf44f48c3
> --- /dev/null
> +++ b/gdb/testsuite/boards/cc-with-dwz.exp
> @@ -0,0 +1,28 @@
> +# Copyright 2019 Free Software Foundation, Inc.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +# This file is a dejagnu "board file" and is used to run the testsuite
> +# with contrib/cc-with-tweaks.sh -z.
> +#
> +# NOTE: We assume dwz is in $PATH.
> +#
> +# Example usage:
> +# bash$ cd $objdir
> +# bash$ make check-gdb \
> +#   RUNTESTFLAGS='--target_board=cc-with-dwz' \
> +#
> +
> +set CC_WITH_TWEAKS_FLAGS "-z"
> +load_board_description "cc-with-tweaks"
> diff --git a/gdb/testsuite/boards/cc-with-tweaks.exp b/gdb/testsuite/boards/cc-with-tweaks.exp
> index 59a53a87f9..2fac669453 100644
> --- a/gdb/testsuite/boards/cc-with-tweaks.exp
> +++ b/gdb/testsuite/boards/cc-with-tweaks.exp
> @@ -19,10 +19,13 @@
>  # NOTE: If using dwz, We assume it is in $PATH.
>  #
>  # Example usage:
> +# bash$ cd $objdir/gdb
>  # bash$ make check \
>  #   RUNTESTFLAGS='--target_board=cc-with-tweaks' \
>  #   CC_WITH_TWEAKS_FLAGS='-z'
>  #
> +# Note: this does not work from $objdir with make check-gdb.
> +#
>  # The default value of CC_WITH_TWEAKS_FLAGS is "".
>  
>  if ![info exists CC_WITH_TWEAKS_FLAGS] {
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, testsuite] Add cc-with-dwz.exp add cc-with-dwz-m.exp
  2019-04-10 12:12 ` Pedro Alves
@ 2019-04-11  9:35   ` Tom de Vries
  2019-04-11 15:59     ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Tom de Vries @ 2019-04-11  9:35 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 3144 bytes --]

On 10-04-19 14:11, Pedro Alves wrote:
> On 4/10/19 10:40 AM, Tom de Vries wrote:
>> Hi,
>>
>> While we can use CC_WITH_TWEAKS_FLAGS like this:
>> ...
>> $ cd $objdir/gdb
>> $ make check \
>>     RUNTESTFLAGS='--target_board=cc-with-tweaks' \
>>     CC_WITH_TWEAKS_FLAGS='-z'
>> ...
>> this doesn't work:
>> ...
>> $ cd $objdir
>> $ make check-gdb \
>>     RUNTESTFLAGS='--target_board=cc-with-tweaks' \
>>     CC_WITH_TWEAKS_FLAGS='-z'
>> ...
> 

Hi Pedro,

thanks for the review.

> Took me a bit to understand the difference here.  I think
> spelling it out in English helps.  So, in the first case,
> you're cd-ing to the gdb subdir and using "make check".
> While in the second case, you're cd-ing to the top build dir,
> and using "make check-gdb".
> 

Done.

>>
>> Add cc-with-dwz.exp add cc-with-dwz-m.exp, that can be used like this:
>> ...
>> $ cd $objdir
>> $ make check-gdb \
>>     RUNTESTFLAGS='--target_board=cc-with-dwz'
>> ...
> 
> Sorry for being dense, but I was completely confused by this
> description for a bit.

No problem, my bad, it's one of those things were I spent some time
investigating what's going whilst not having a clue, and after I find
out what's wrong it seems so obvious I fail to mention it in the
submission...

> I didn't really understand what the
> conclusion (new board) files had to do with the premise
> ("while this works, this does not").  And why does check-gdb
> vs check make a difference?  I suspect that it's because CC_WITH_TWEAKS_FLAGS
> is not passed down from the top level?

Indeed.

> If so, or even if it's
> something else, could you clarify both the proposed git commit
> log, and the "does not work" comment added to the existing 
> .exp file (add a "because CC_WITH_TWEAKS_FLAGS is not passed
> down from the top level Makefile" or something like that), please?
> 

Done.

> Would passing down CC_WITH_TWEAKS_FLAGS from the top level be
> a bad idea?

I know toplevel stuff in GNU repository has special status, being copied
from there to there, so I tend to avoid touching that.

> I do wonder why not just do the "cd $objdir/gdb" version instead.

I tend to stick to the toplevel build dir, my experience is that the
further down in the tree I type make, the more likely I run into trouble
(this issue of course being an example of the opposite).

> Hope we don't grow into combinatorial explosion. :-D

I've not run cc-with-tweaks with several options at once, I did not
realize that that was possible, but I agree that it wouldn't make too
much sense to make board files for the combinations.

I think though that exposing this basic functionality with an easy
interface is not bad (FWIW, I'd be happy to add similar board files for
the other cc-with-tweaks.sh options).

Also, I had to be informed about this option to run gdb with dwz, and
hopefully these new files advertise it a little bit better:
...
$ find gdb/ | grep dwz
gdb/testsuite/boards/cc-with-dwz.exp
gdb/testsuite/boards/cc-with-dwz-m.exp
gdb/testsuite/gdb.dwarf2/dwz.exp
gdb/testsuite/gdb.dwarf2/dwzbuildid.exp
$
...

[ Also, fixed several typos here and there. ]

Updated patch OK for trunk?

Thanks,
- Tom

[-- Attachment #2: 0001-gdb-testsuite-Add-cc-with-dwz.exp-and-cc-with-dwz-m.exp.patch --]
[-- Type: text/x-patch, Size: 4553 bytes --]

[gdb/testsuite] Add cc-with-dwz.exp and cc-with-dwz-m.exp

We can use CC_WITH_TWEAKS_FLAGS when cd-ing into the gdb build subdir and
invoking make check:
...
$ cd $objdir/gdb
$ make check \
    RUNTESTFLAGS='--target_board=cc-with-tweaks' \
    CC_WITH_TWEAKS_FLAGS='-z'
...

But when cd-ing into the top-level build dir and invoking make check-gdb
instead:
...
$ cd $objdir
$ make check-gdb \
    RUNTESTFLAGS='--target_board=cc-with-tweaks' \
    CC_WITH_TWEAKS_FLAGS='-z'
...
using CC_WITH_TWEAKS_FLAGS has no effect, because CC_WITH_TWEAKS_FLAGS is not
passed down from the top level Makefile.

Add cc-with-dwz.exp and cc-with-dwz-m.exp, that don't require
CC_WITH_TWEAKS_FLAGS to be set in the make invocation, allowing us to run these
test configurations from the toplevel build dir:
...
$ cd $objdir
$ make check-gdb \
    RUNTESTFLAGS='--target_board=cc-with-dwz'
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-04-10  Tom de Vries  <tdevries@suse.de>

	* boards/cc-with-dwz-m.exp: New file.
	* boards/cc-with-dwz.exp: New file.
	* boards/cc-with-tweaks.exp: Note that check-gdb doesn't work.

---
 gdb/testsuite/boards/cc-with-dwz-m.exp  | 28 ++++++++++++++++++++++++++++
 gdb/testsuite/boards/cc-with-dwz.exp    | 28 ++++++++++++++++++++++++++++
 gdb/testsuite/boards/cc-with-tweaks.exp |  4 ++++
 3 files changed, 60 insertions(+)

diff --git a/gdb/testsuite/boards/cc-with-dwz-m.exp b/gdb/testsuite/boards/cc-with-dwz-m.exp
new file mode 100644
index 0000000000..dd15c36f44
--- /dev/null
+++ b/gdb/testsuite/boards/cc-with-dwz-m.exp
@@ -0,0 +1,28 @@
+# Copyright 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is a dejagnu "board file" and is used to run the testsuite
+# with contrib/cc-with-tweaks.sh -m.
+#
+# NOTE: We assume dwz is in $PATH.
+#
+# Example usage:
+# bash$ cd $objdir
+# bash$ make check-gdb \
+#   RUNTESTFLAGS='--target_board=cc-with-dwz-m'
+#
+
+set CC_WITH_TWEAKS_FLAGS "-m"
+load_board_description "cc-with-tweaks"
diff --git a/gdb/testsuite/boards/cc-with-dwz.exp b/gdb/testsuite/boards/cc-with-dwz.exp
new file mode 100644
index 0000000000..7329da32b2
--- /dev/null
+++ b/gdb/testsuite/boards/cc-with-dwz.exp
@@ -0,0 +1,28 @@
+# Copyright 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This file is a dejagnu "board file" and is used to run the testsuite
+# with contrib/cc-with-tweaks.sh -z.
+#
+# NOTE: We assume dwz is in $PATH.
+#
+# Example usage:
+# bash$ cd $objdir
+# bash$ make check-gdb \
+#   RUNTESTFLAGS='--target_board=cc-with-dwz'
+#
+
+set CC_WITH_TWEAKS_FLAGS "-z"
+load_board_description "cc-with-tweaks"
diff --git a/gdb/testsuite/boards/cc-with-tweaks.exp b/gdb/testsuite/boards/cc-with-tweaks.exp
index 59a53a87f9..11ec6a2850 100644
--- a/gdb/testsuite/boards/cc-with-tweaks.exp
+++ b/gdb/testsuite/boards/cc-with-tweaks.exp
@@ -19,10 +19,14 @@
 # NOTE: If using dwz, We assume it is in $PATH.
 #
 # Example usage:
+# bash$ cd $objdir/gdb
 # bash$ make check \
 #   RUNTESTFLAGS='--target_board=cc-with-tweaks' \
 #   CC_WITH_TWEAKS_FLAGS='-z'
 #
+# Note: this does not work from $objdir with make check-gdb because
+# CC_WITH_TWEAKS_FLAGS is not passed down from the top level Makefile.
+#
 # The default value of CC_WITH_TWEAKS_FLAGS is "".
 
 if ![info exists CC_WITH_TWEAKS_FLAGS] {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, testsuite] Add cc-with-dwz.exp add cc-with-dwz-m.exp
  2019-04-11  9:35   ` Tom de Vries
@ 2019-04-11 15:59     ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2019-04-11 15:59 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 4/11/19 10:35 AM, Tom de Vries wrote:
> On 10-04-19 14:11, Pedro Alves wrote:

>> Sorry for being dense, but I was completely confused by this
>> description for a bit.
> No problem, my bad, it's one of those things were I spent some time
> investigating what's going whilst not having a clue, and after I find
> out what's wrong it seems so obvious I fail to mention it in the
> submission...

Yeah, an easy trap to fall into.  We have a note about that in the
contribution checklist. :-)

> Updated patch OK for trunk?

Yes.  The new description looks beautifully clear, thanks!

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-11 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10  9:40 [PATCH, testsuite] Add cc-with-dwz.exp add cc-with-dwz-m.exp Tom de Vries
2019-04-10 12:12 ` Pedro Alves
2019-04-11  9:35   ` Tom de Vries
2019-04-11 15:59     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).