From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) by sourceware.org (Postfix) with ESMTPS id AADBE3855004 for ; Sun, 13 Jun 2021 15:44:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AADBE3855004 Received: by mail-vs1-xe34.google.com with SMTP id x8so6544340vso.5 for ; Sun, 13 Jun 2021 08:44:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pLrnY4xH1O23ozLR0Z/W2TZDITg852ghn4Hksa16S7A=; b=jtP1W8ir8vUC/sNim1K6a1Nmx/a1LZhCH9t7b/yxY2/bZAiYYKR56JgaU05QA+jULj fkIsPSrHGq00AM9oi5uUhfGHTzw1P3zj5nC3d8v4yMLx2aRWCLWQcZ/dlx0Shza/Tchf mYRd8vL2ctem0gmWnysB50ewBJ3CU8hpp6IBH8fX3cutrykWzNvEEcllXQs1SY3NpSD6 ln9RxRSudvA0AJN+bvjm58DJ/f5zDWDaqfojq8Y2F8Cr2K5uvObnNrkjHCbcWwIV6j4A +WGjhgtU3Yi+3sdw3S+R+RTHUjBQUC23hp37bet/sJUvyLvI8//rWrGhV8TovJxmTXHD MVAw== X-Gm-Message-State: AOAM532PUA254nL8UilvbJ2xoGY5zITV3D7oBsVvFvRxsarTFGvMgU+J lfEU843PFEUxt3Gt6bxtqomxPAdOjdgM/p+B0PQ3jMfsCNE= X-Google-Smtp-Source: ABdhPJwiAmVpHYRlqvTInuyS4h7D0aQqMkni69rqSOo353ZSu/FMTCYK0pZCLeQ5gvSN60B/qpf4pt67iQn76nxXjJM= X-Received: by 2002:a67:3205:: with SMTP id y5mr15929247vsy.24.1623599040286; Sun, 13 Jun 2021 08:44:00 -0700 (PDT) MIME-Version: 1.0 References: <77ad0c73ddd4c4485f2e214b68c8ce474e1c96f8.camel@mad-scientist.net> In-Reply-To: <77ad0c73ddd4c4485f2e214b68c8ce474e1c96f8.camel@mad-scientist.net> From: David Blaikie Date: Sun, 13 Jun 2021 08:43:49 -0700 Message-ID: Subject: Re: Why does the prettyprint of std::tuple start with [1]? To: paul@mad-scientist.net Cc: gdb X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 15:44:02 -0000 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 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 &) @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. > >