From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id D4DA83858D38 for ; Thu, 25 Jan 2024 12:55:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4DA83858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D4DA83858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706187311; cv=none; b=mJ6v99wdZhtQ+sTXWjD3AbZCkLCP5bhJwR2UU2UOsRIR+5LWnl1KePEsuV+L2WtYel4KF+P6fY13b2viCyMixv/7lGA5RFUSZ6jWAofPX3ApU1MYwV5tq2T502qTq4JmISeJqKMExLJXFCwL1yN88mwgkWL+WQWo+rDGvoc0EOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706187311; c=relaxed/simple; bh=21cnZmr//qW15Y/uGtgF5AFwentmbeVDmIYOqqx0Wm4=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=agzxHWxK9yB9rWhGAm5N1wkExUqF8cphfqMpsOjd0ghTNKJwCojXYyVvw32TLhuGwNaanGKX9LG5NxkYrY5HscmiF2kie09yHoBOeDpC2dnTXXB8MDCNpIxIhS+vJ2vWZbYhrugvbkDrKtVfY/dI2nt/qgvLImgMhXgajU8pVRs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5C9DD1F88B; Thu, 25 Jan 2024 12:55:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706187306; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+3ls/N1ZXq9i8tkbPgzXYhGnk8lHxb+m9xH580eUzDY=; b=yCYzS56swrctpJBi1oioJKc4049vYUf5vl+B/+cPbrNsMQMc2AaC/MqE2zUf5T0q1tPUGV PcykfeM54xnE3Qw2pQFstcUnuZJJ19aAzk/jT2T/PSzW+e0oDEvQ7XqTwcyOWnL9sN39/r TDwUiOWFBpUVKGqkNy493Ywzucfs3HU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706187306; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+3ls/N1ZXq9i8tkbPgzXYhGnk8lHxb+m9xH580eUzDY=; b=XhuU+PEp3Lp5aNleyLdHsji/TG97uPAB+b4ZwgD0p27sFWn2/VI8tYwsdWr2HBdiAQ0+FG Gc+bj31JpWUtvVAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706187306; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+3ls/N1ZXq9i8tkbPgzXYhGnk8lHxb+m9xH580eUzDY=; b=yCYzS56swrctpJBi1oioJKc4049vYUf5vl+B/+cPbrNsMQMc2AaC/MqE2zUf5T0q1tPUGV PcykfeM54xnE3Qw2pQFstcUnuZJJ19aAzk/jT2T/PSzW+e0oDEvQ7XqTwcyOWnL9sN39/r TDwUiOWFBpUVKGqkNy493Ywzucfs3HU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706187306; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+3ls/N1ZXq9i8tkbPgzXYhGnk8lHxb+m9xH580eUzDY=; b=XhuU+PEp3Lp5aNleyLdHsji/TG97uPAB+b4ZwgD0p27sFWn2/VI8tYwsdWr2HBdiAQ0+FG Gc+bj31JpWUtvVAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 46D65134C3; Thu, 25 Jan 2024 12:55:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +Vz9DypasmVyGAAAD6G6ig (envelope-from ); Thu, 25 Jan 2024 12:55:06 +0000 Message-ID: <4e623ea9-7b0a-4776-abe2-1ac3fa450e8c@suse.de> Date: Thu, 25 Jan 2024 13:56:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/exp] Fix printing of out of bounds struct members Content-Language: en-US To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20240122132801.31153-1-tdevries@suse.de> <87h6j5jpqh.fsf@tromey.com> <87ttn2iqlc.fsf@tromey.com> From: Tom de Vries In-Reply-To: <87ttn2iqlc.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=yCYzS56s; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=XhuU+PEp X-Spamd-Result: default: False [-0.58 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-0.28)[74.50%]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Score: -0.58 X-Rspamd-Queue-Id: 5C9DD1F88B X-Spam-Level: X-Spamd-Bar: / X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: On 1/24/24 18:33, Tom Tromey wrote: >>>>>> "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) Yeah, I saw this in gcc's analyze_variants_discr, I wondered if that is related: ... /* Now, try to analyze the predicate and deduce a discriminant for it. */ if (match_expr == boolean_true_node) /* Typically happens for the default variant: it matches all cases that previous variants rejected. Don't output any matching value for this one. */ continue; ... Thanks, - Tom