From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30762 invoked by alias); 20 Dec 2006 02:40:41 -0000 Received: (qmail 30753 invoked by uid 22791); 20 Dec 2006 02:40:41 -0000 X-Spam-Check-By: sourceware.org Received: from intrepid.190.195.192.in-addr.arpa (HELO intrepid.intrepid.com) (192.195.190.1) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 20 Dec 2006 02:40:32 +0000 Received: from DELORIAN ([10.10.10.10]) by intrepid.intrepid.com (8.13.8/8.13.8) with ESMTP id kBK2eAer008998; Tue, 19 Dec 2006 18:40:11 -0800 From: "Gary Funck" To: Cc: "'Daniel Jacobowitz'" , "'Jim Wilson'" , "'Jim Blandy'" Subject: RE: how to support C type qualifiers applied to arrays? Date: Wed, 20 Dec 2006 02:40:00 -0000 Message-ID: <004901c723e0$303c67a0$0a0a0a0a@DELORIAN> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-reply-to: X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00179.txt.bz2 > From: Jim Blandy > Sent: Friday, December 15, 2006 2:37 PM > > "Gary Funck" writes: > > Here, GCC sets TREE_THIS_VOLATILE in the DECL node of S, > > but does not attempt to clone the type description of > > s_struct, and to populate the volatile qualifier across all > > contained member types. This works for GCC because it > > propagates the qualifiers as it evaluates expressions. > > Thus when evaluating S.c[10], GCC starts with the knowledge > > that S is volatile, thus S.c is volatile, and S.c[1] is > > volatile. > > Okay --- this is a different problem altogether. This one is indeed > GDB's fault: referring to a field of a volatile- or const-qualified > structure should get you a member with the same qualifiers. > [...] > > Typedefs above are used to illustrate that "volatile" must > > be factored to the lowest level types of the components, > > and must also appear at the struct level to accommodate > > operations on the entire structure. > > Just to be clear: GCC should *not* perform the transformation you're > suggesting here and record the result in the DWARF info. GDB should > propagate the qualifiers itself. This leads to the next question: how difficult will it be to teach GDB to properly track type qualifiers when evaluating expressions? Which files/functions will likely need to be changed? Are there mechanisms within GDB already that track various value attributes along with the expression values themselves?