From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by sourceware.org (Postfix) with ESMTPS id D78EE385E449 for ; Wed, 24 Jan 2024 17:33:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D78EE385E449 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D78EE385E449 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d2a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706117606; cv=none; b=riAp0g/8TbGNXjibajZCI3vJg8afcOq/lbTzavcLxAUoRNyhlMiU4YXAt56XJCP/BpxNqYyjBy1ALXfyrDYMI9BXjjKpnnLMOzQtukIgzz4nYaCE5d+MBm9Cwn/E8RdBmuyJiRaqRxHBQrCXRZ6RdW3LzwCf7aq692BP6cu2Nq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706117606; c=relaxed/simple; bh=yzGRdHg3aBmly1TXfWROWdVRGlbieM/NSYqbgR6YBrU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Ia557nSN7xagBf4pIS6XyQDexG4GYSGRZqo/rynlftL+BViiozA5ubArBsxDbsmMHaxRcIwGEt31LogLYg7alo3nTU+tUKIQr+sa6BIJs7Z59c521hZchQuk41cP/ZVYAX41XRwiasNO+E0AjHwJOMoVFS63vQfM67Tu8Z0P5Bk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7ba9c26e14aso135720239f.0 for ; Wed, 24 Jan 2024 09:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1706117601; x=1706722401; darn=sourceware.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ITh/jGvAwGnsor1FQj2vGizGlWAHQOob0XDh/j9TAPk=; b=XfmPgbSzQ2SV1qK2pAClURip1bLxH9i21N/6OcTI2OTUJf6GmH5t1qcdoYASv0ctjz oQSnsV4xXPuCd8rPSGSpCXI8Oz+12R39SWM9nrMpCm1q/sPAu4lsz5DhJ56oHGx/uHl9 h2Ndspx20cwTPM6T4m8UL9cgXLJmxN6TMQ7RBg9e2vun+wtlIvGvRF6LjeNCCZ9YcHBE TGPHXu3F1It0556a3FHNZidMLbTg1dU5eKHgsY76+6LvhMEcoBgl7DTb42Kft6vy5/Dr yj7uzsvIXLupXt2umV2aP580ia9Rd1Bae/OyMMFKlirg8G3MCakwZ4BFKRRWKPms9LEf eflA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706117601; x=1706722401; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ITh/jGvAwGnsor1FQj2vGizGlWAHQOob0XDh/j9TAPk=; b=SloWY2QDaX7jhxOzAIC5WjTDiDMiY2BgV/LfQ7MqRZqdTlYMgVNzspiKG3LXnWTOer 8e8833D3kANyCok9ezIC8X6lQ/iMfJ0U5JSC5YK1KGHltaB9kTC3/mwxJhiCVLyvUBP3 MKlEBU+7GqnzrdPVQAncbyRGlgLGjlbPMsBC+b9/FA5p9XH3r5qR+rkrEJT9MjII2EPJ 71m+RAyx9tyVh6d2NWwdd71zbPa2vdDpa7lA6C+uRIrZDAw0Z5FOv3GSXXLxdFs0k3Kr m+g+iGUPYfQE8Xw5lcurzLWzBZF/55qCdjDiLqhiox7d49TK/HGQIwfkA0q2UXjVYDD0 tdjQ== X-Gm-Message-State: AOJu0YwvscaECodJPjIjUMmdQYJ7ayJTbjgJj7zM8xnL7ipdMo3glnyh jwtHNp0lcAnk/+EMLOJgjX2/7hvwwPgy/2I8g5q/z5E3amgppqaKKED7dCZyww== X-Google-Smtp-Source: AGHT+IF5jHKedNVd7+IUHJ6D8fZovBTwFGelTpKF+Fd24TlJ4YfNOB9mQEp5mAVhTXdu9p4DQEyysQ== X-Received: by 2002:a6b:7307:0:b0:7bc:157c:8aa6 with SMTP id e7-20020a6b7307000000b007bc157c8aa6mr11974ioh.0.1706117601087; Wed, 24 Jan 2024 09:33:21 -0800 (PST) Received: from murgatroyd (97-122-68-157.hlrn.qwest.net. [97.122.68.157]) by smtp.gmail.com with ESMTPSA id g14-20020a056638060e00b0046e80c50d73sm4062934jar.22.2024.01.24.09.33.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 09:33:20 -0800 (PST) From: Tom Tromey To: Tom de Vries Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/exp] Fix printing of out of bounds struct members References: <20240122132801.31153-1-tdevries@suse.de> <87h6j5jpqh.fsf@tromey.com> X-Attribution: Tom Date: Wed, 24 Jan 2024 10:33:19 -0700 In-Reply-To: (Tom de Vries's message of "Wed, 24 Jan 2024 17:15:16 +0100") Message-ID: <87ttn2iqlc.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Tom" == Tom de Vries writes: >> One thing I see here is that y.a is not one of the valid values. So >> I >> wonder if this kind of corruption should be detected at a different >> spot, like throwing an exception from compute_variant_fields_inner. >> Tom> I've looked into that, but I think it requires a cleanup related to Tom> TYPE_CODE_BOOL In this particular test, I would have expect the variants to enumerate the valid values, due to the 'when True' / 'when False'. However, I see the compiler decides not to do that :-( That is, it says: <4><1158>: Abbrev Number: 8 (DW_TAG_variant) <1159> DW_AT_discr_value : 1 <115a> DW_AT_sibling : <0x1169> <5><115e>: Abbrev Number: 1 (DW_TAG_member) [...] <4><1169>: Abbrev Number: 9 (DW_TAG_variant) <5><116a>: Abbrev Number: 1 (DW_TAG_member) Tom