Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Mark Wielaard <mark@klomp.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/testsuite: ISO C++17 does not allow register storage class specifier.
Date: Sat, 22 Aug 2020 10:54:14 -0400	[thread overview]
Message-ID: <f54fcacf-8907-ec47-c708-7e2530383f1e@simark.ca> (raw)
In-Reply-To: <20200822121935.6086-1-mark@klomp.org>

On 2020-08-22 8:19 a.m., Mark Wielaard wrote:
> g++ enables -Wregister when defaulting to C++17. Disable it for those
> tests that explicitly use register.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* gdb.cp/classes.exp (prepare_for_testing): Add
> 	additional_flags=-Wno-register.
> 	* gdb.cp/inherit.exp (prepare_for_testing): Likewise.
> 	* gdb.cp/misc.exp (prepare_for_testing): Likewise.
> ---
>  gdb/testsuite/ChangeLog          | 7 +++++++
>  gdb/testsuite/gdb.cp/classes.exp | 2 +-
>  gdb/testsuite/gdb.cp/inherit.exp | 2 +-
>  gdb/testsuite/gdb.cp/misc.exp    | 2 +-
>  4 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
> index 7976dd76306..c55c9a71415 100644
> --- a/gdb/testsuite/ChangeLog
> +++ b/gdb/testsuite/ChangeLog
> @@ -1,3 +1,10 @@
> +2020-08-22  Mark Wielaard  <mark@klomp.org>
> +
> +	* gdb.cp/classes.exp (prepare_for_testing): Add
> +	additional_flags=-Wno-register.
> +	* gdb.cp/inherit.exp (prepare_for_testing): Likewise.
> +	* gdb.cp/misc.exp (prepare_for_testing): Likewise.
> +
>  2020-08-20  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
>  
>  	* gdb.base/print-file-var.exp: Fix typo "breapoint".
> diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp
> index 4a2287a8704..89e64c47cf9 100644
> --- a/gdb/testsuite/gdb.cp/classes.exp
> +++ b/gdb/testsuite/gdb.cp/classes.exp
> @@ -25,7 +25,7 @@ load_lib "cp-support.exp"
>  standard_testfile .cc
>  
>  if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
> -	 {debug c++ additional_flags=-Wno-deprecated-register}]} {
> +	{debug c++ additional_flags=-Wno-deprecated-register additional_flags=-Wno-register}]} {
>      return -1
>  }

The register keyword in this test is used here:

  629   /* We don't call any methods for v, so gcc version cygnus-2.3.3-930220
  630      might put this variable in a register.  This is a lose, though, because
  631      it means that GDB can't call any methods for that variable.  */
  632   register small v;

Can we first check if we can simply remove the register keyword from the test?

I don't understand the comment above: do we want v to be in a register or not?  It sounds
like we don't, we want it to be in memory so we can call a method on it, from GDB.  So why
use the register keyword?

>  
> diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp
> index 2d4635c96ad..677d9ee5476 100644
> --- a/gdb/testsuite/gdb.cp/inherit.exp
> +++ b/gdb/testsuite/gdb.cp/inherit.exp
> @@ -27,7 +27,7 @@ load_lib "cp-support.exp"
>  standard_testfile misc.cc
>  
>  if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
> -	 {debug c++ additional_flags=-Wno-deprecated-register}]} {
> +	{debug c++ additional_flags=-Wno-deprecated-register additional_flags=-Wno-register}]} {
>      return -1
>  }
>  
> diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp
> index 61034bf8088..94acbd0b493 100644
> --- a/gdb/testsuite/gdb.cp/misc.exp
> +++ b/gdb/testsuite/gdb.cp/misc.exp
> @@ -20,7 +20,7 @@ if { [skip_cplus_tests] } { continue }
>  standard_testfile .cc
>  
>  if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
> -	 {debug c++ additional_flags=-Wno-deprecated-register}]} {
> +	{debug c++ additional_flags=-Wno-deprecated-register additional_flags=-Wno-register}]} {
>      return -1
>  }

These last two tests use misc.cc, from which classes.cc was copied.  So can we first check if it
would make sense to just drop the register keyword?

Simon


  reply	other threads:[~2020-08-22 14:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-22 12:19 Mark Wielaard
2020-08-22 14:54 ` Simon Marchi [this message]
2020-08-22 17:08   ` [PATCH] Move "register" test out of classes.exp to a separate testcase (Re: [PATCH] gdb/testsuite: ISO C++17 does not allow register storage class specifier.) Pedro Alves
2020-08-22 17:11     ` [PATCH] Remove stale "register" bits from gdb.cp/misc.cc (Re: [PATCH] Move "register" test out of classes.exp to a separate testcase) Pedro Alves
2020-08-22 18:53       ` Mark Wielaard
2020-08-22 19:01         ` Simon Marchi
2020-08-22 19:01           ` Simon Marchi
2020-09-13 16:40         ` 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=f54fcacf-8907-ec47-c708-7e2530383f1e@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=mark@klomp.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