From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29105 invoked by alias); 11 Sep 2012 17:12:56 -0000 Received: (qmail 29089 invoked by uid 22791); 11 Sep 2012 17:12:53 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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 Sep 2012 17:12:35 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8BHCXY9016525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Sep 2012 13:12:33 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8BHCVWS011993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 11 Sep 2012 13:12:32 -0400 From: Tom Tromey To: Yao Qi Cc: Jan Kratochvil , Doug Evans , Subject: Re: [RFC] Don't allow setting register in non-innermost frame References: <1345170040-25959-1-git-send-email-yao@codesourcery.com> <87hartpodt.fsf@fleche.redhat.com> <20120907164544.GA18234@host2.jankratochvil.net> <504D49DA.6070006@codesourcery.com> Date: Tue, 11 Sep 2012 17:12:00 -0000 In-Reply-To: <504D49DA.6070006@codesourcery.com> (Yao Qi's message of "Mon, 10 Sep 2012 10:00:58 +0800") Message-ID: <87ehm8a3gg.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (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: 2012-09/txt/msg00163.txt.bz2 >>>>> "Yao" == Yao Qi writes: Yao> I checked the difference of value of register and value of variable Yao> (saved in register), TYPE_OBJFILE_OWNED (value_type (toval)) is the Yao> only difference between them. IIUC, type of variable is owned by an Yao> objfile, while type of register is not (alloc_type vs. alloc_type_arch), Yao> so looks we can use it to differentiate values in register and values Yao> in variables. I would rather not use this approach. My reason is that there is no obvious connection between TYPE_OBJFILE_OWNED and register-ness -- and it is the sort of invariant that is very difficult to ensure will remain true over time. If lval_register can't work, then another choice would be a new flag on struct value. This would be somewhat ugly but, I think, more robust. As Jan points out, it does seem strange to warn about the set rather than query. A warning comes too late. After re-reading the whole thread I wonder whether pressing forward with this patch is best. IIUC this didn't arise from any user complaint but rather just thinking about the problem. And, while I agree it could be confusing in some situations, in practice it seems that perhaps it has never actually bitten anybody. Tom