public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: David Blaikie <dblaikie@gmail.com>
To: paul@mad-scientist.net
Cc: gdb <gdb@sourceware.org>
Subject: Re: Why does the prettyprint of std::tuple start with [1]?
Date: Sun, 13 Jun 2021 08:43:49 -0700	[thread overview]
Message-ID: <CAENS6Es6NX-2WJbNBSEj8UG1OYEsvG9ueRxQw7KxUnA6qtZkQA@mail.gmail.com> (raw)
In-Reply-To: <77ad0c73ddd4c4485f2e214b68c8ce474e1c96f8.camel@mad-scientist.net>

Likely it does, yeah.

Probably a bug in libstdc++'s pretty printer:

https://github.com/gcc-mirror/gcc/blob/8a7d54b1e10b8f4fba1358260ed2e7056ed23cbd/libstdc%2B%2B-v3/python/libstdcxx/v6/printers.py#L528

https://github.com/gcc-mirror/gcc/blob/8a7d54b1e10b8f4fba1358260ed2e7056ed23cbd/libstdc%2B%2B-v3/python/libstdcxx/v6/printers.py#L563

Something related to those bits of code.

On Sun, Jun 13, 2021 at 8:37 AM Paul Smith <paul@mad-scientist.net> wrote:

> On Sun, 2021-06-13 at 09:49 -0400, Paul Smith wrote:
> > Am I the only one to be confused by the fact that the pretty-printer
> > for std::tuple values starts indexing at 1 instead of 0?
> >
> > (gdb) p info
> > $1 = (const std::tuple<TestType, DataType> &) @0x7fffffffd550: {
> >   param = std::tuple containing = {
> >     [1] = TestType::OneTest,
> >     [2] = DataType::SomeData
> >   },
> >   index = 2
> > }
> >
> > Why aren't the indexes on the left numbered [0] and [1],
> > corresponding
> > to the values used with std::get(), instead of [1] and [2]?
>
> Hm, maybe this belongs on the GCC mailing list instead of here.
>
>

      reply	other threads:[~2021-06-13 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 13:49 Paul Smith
2021-06-13 15:35 ` Paul Smith
2021-06-13 15:43   ` David Blaikie [this message]

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=CAENS6Es6NX-2WJbNBSEj8UG1OYEsvG9ueRxQw7KxUnA6qtZkQA@mail.gmail.com \
    --to=dblaikie@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=paul@mad-scientist.net \
    /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).