From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17840 invoked by alias); 11 Oct 2011 17:33:38 -0000 Received: (qmail 17808 invoked by uid 22791); 11 Oct 2011 17:33:30 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Oct 2011 17:33:17 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9BHXADP030897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Oct 2011 13:33:13 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9BH2lTk027640; Tue, 11 Oct 2011 13:02:47 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p9BH2j6K023823; Tue, 11 Oct 2011 13:02:46 -0400 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org, Jan Kratochvil Subject: Re: [patch] Fix internal error on optimized-out values (regression by me) References: <20110926191132.GA30401@host1.jankratochvil.net> <20111010205407.GA5193@host1.jankratochvil.net> <201110102240.28440.pedro@codesourcery.com> Date: Tue, 11 Oct 2011 17:33:00 -0000 In-Reply-To: <201110102240.28440.pedro@codesourcery.com> (Pedro Alves's message of "Mon, 10 Oct 2011 22:40:28 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00316.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> It just happens that today, we only support either wholy Pedro> optimized-out values, or wholly not optimized-out values. A Pedro> compiler can flatten out structures and optimize out just some Pedro> unused fields (of local vars, most usefully). When Pedro> we get to support that, it'll follow naturally that a single Pedro> optimized out flag per value isn't sufficient, and that Pedro> ((struct) ).field will need to be able to Pedro> be . Actually I think GCC can already do all of this, and GDB can (supposedly) handle it. There are a couple of lval_computed methods used to handle this -- check_validity and check_any_valid. I don't remember how value_primitive_field was supposed to work with this exactly, but I think the key is that set_value_component_location on the new value correctly inherits the 'computed' vtable; so the optimized-out status bits are preserved by this operation. Given this I tend to think that the patch that went in is incorrect, in that it may break operations on an SRA'd structure where some bits are optimized away. I thought I added tests for this, not sure though. Tom