public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@embecosm.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 4/6] Add `set print repeats' tests for C/C++ arrays
Date: Sat, 8 Jan 2022 16:26:35 +0000 (GMT)	[thread overview]
Message-ID: <alpine.DEB.2.20.2201061502170.22504@tpp.orcam.me.uk> (raw)
In-Reply-To: <20211215153313.GL175541@redhat.com>

On Wed, 15 Dec 2021, Andrew Burgess wrote:

> > Add `set print repeats' tests for C/C++ arrays, complementing one for 
> > Fortran arrays and covering the different interpretation of the `set 
> > print elements' setting in particular where the per-dimension count of 
> > the elements handled is matched against the trigger rather than the 
> > total element count as with Fortran arrays.
> 
> I know we disagree on this topic, but I would, one day, like to see
> the C/C++ array printing behave as the Fortran array printing does, as
> that makes much more sense to me.

 I'm not sure if there's much disagreement between us really.  I just 
think there may be use cases, including existing ones, where the C/C++ 
printer's interpretation is required.  It must have been made this way for 
a reason after all -- if not for one, this code wouldn't have been written 
in the first place, would it?

 So what I think we're ultimately after it is a way to switch between the 
two variants regardless of the language being handled, possibly with the 
defaults remaining as they are now.

> But, adding tests for GDB's current behaviour is definitely a good
> thing, so I'm happy to see this going in, with one change...

 Well, I think we need coverage either way, because otherwise we can't 
easily see if things continue working the way intended.

> Given that the C and C++ tests are almost identical, I think you
> should consider just adding one copy in gdb.base and compiling it as
> both C and C++.
> 
> For inspiration you can look at these files:
> 
>   gdb/testsuite/gdb.base/infcall-nested-structs-c.exp
>   gdb/testsuite/gdb.base/infcall-nested-structs-c++.exp
>   gdb/testsuite/gdb.base/infcall-nested-structs.exp.tcl

 Thanks for the hint.  I chose to keep the C++ test in gdb.cp/ as I think 
it's the way it should be (and any existing mess ought to be cleaned up 
too) so that say "RUNTESTFLAGS=gdb.cp/*.exp" selects all the C++ testing, 
but otherwise followed the approach.

  Maciej

  reply	other threads:[~2022-01-08 16:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11 11:46 [PATCH 0/6] Make Fortran support respect more `set print' settings Maciej W. Rozycki
2021-12-11 11:47 ` [PATCH 1/6] Initialize `m_ndimensions' in the member initializer list Maciej W. Rozycki
2021-12-15 13:18   ` Andrew Burgess
2021-12-17 15:03     ` Maciej W. Rozycki
2021-12-11 11:47 ` [PATCH 2/6] Avoid redundant operations in `fortran_array_walker' Maciej W. Rozycki
2021-12-15 13:19   ` Andrew Burgess
2021-12-17 15:04     ` Maciej W. Rozycki
2021-12-11 11:47 ` [PATCH 3/6] Respect `set print repeats' with Fortran arrays Maciej W. Rozycki
2021-12-15 15:18   ` Andrew Burgess
2022-01-08 16:25     ` Maciej W. Rozycki
2021-12-11 11:47 ` [PATCH 4/6] Add `set print repeats' tests for C/C++ arrays Maciej W. Rozycki
2021-12-15 15:33   ` Andrew Burgess
2022-01-08 16:26     ` Maciej W. Rozycki [this message]
2021-12-11 11:47 ` [PATCH 5/6] Respect `set print array-indexes' with Fortran arrays Maciej W. Rozycki
2021-12-15 16:49   ` Andrew Burgess
2022-01-08 16:27     ` Maciej W. Rozycki
2021-12-11 11:48 ` [PATCH 6/6] Add `set print array-indexes' tests for C/C++ arrays Maciej W. Rozycki
2021-12-15 16:51   ` Andrew Burgess
2022-01-08 16:27     ` Maciej W. Rozycki

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=alpine.DEB.2.20.2201061502170.22504@tpp.orcam.me.uk \
    --to=macro@embecosm.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).