From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2AckH9snxmAIHgAAWB0awg (envelope-from ) for ; Sun, 13 Jun 2021 11:44:27 -0400 Received: by simark.ca (Postfix, from userid 112) id 7C0401F163; Sun, 13 Jun 2021 11:44:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AAC091E54D for ; Sun, 13 Jun 2021 11:44:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 460F4386187B for ; Sun, 13 Jun 2021 15:44:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 460F4386187B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1623599066; bh=MqoV73mZiWSn8vOjpjM2MDMNY4u/PbNx9u0lfDG2xJM=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=MndyMqBHdf6q2xQC4vy+AIZVNm1ukI8bsV2SgBdZtWAtcH2dFZ8uJ4HzNCFgNkzBG GsSiF3W9E4taOmWfRCKMSrVMtCLNnC4jJ+45MgKLEWjdEbanpcY9zldruV5Gj0jcto lnGQhprkRsTnBZyXIbgBvoPvvPEotp0JfCRggbUg= 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> 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 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: , From: David Blaikie via Gdb Reply-To: David Blaikie Cc: gdb Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" 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. > >