From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24685 invoked by alias); 24 Sep 2010 16:27:21 -0000 Received: (qmail 24675 invoked by uid 22791); 24 Sep 2010 16:27:18 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate5.uk.ibm.com (HELO mtagate5.uk.ibm.com) (194.196.100.165) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Sep 2010 16:27:07 +0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate5.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o8OGR4f3013637 for ; Fri, 24 Sep 2010 16:27:04 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o8OGR4LH2085020 for ; Fri, 24 Sep 2010 17:27:04 +0100 Received: from d06av03.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o8OGR3ns002534 for ; Fri, 24 Sep 2010 17:27:04 +0100 Received: from leonard.localnet (dyn-9-152-224-33.boeblingen.de.ibm.com [9.152.224.33]) by d06av03.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o8OGR07i002498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Sep 2010 17:27:03 +0100 From: Ken Werner To: Tom Tromey Subject: Re: RFA: shrink main_type Date: Sat, 25 Sep 2010 14:38:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-24-generic; KDE/4.4.2; i686; ; ) References: <201009151441.43723.ken@linux.vnet.ibm.com> In-Reply-To: <201009151441.43723.ken@linux.vnet.ibm.com> Cc: gdb-patches@sourceware.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009241827.00462.ken@linux.vnet.ibm.com> X-IsSubscribed: yes 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: 2010-09/txt/msg00441.txt.bz2 On Wednesday, September 15, 2010 2:41:43 pm Ken Werner wrote: > On Tuesday, August 19, 2008 07:55:37 pm Tom Tromey wrote: > > + /* Flags about this type. These fields appear at this location > > + because they packs nicely here. See the TYPE_* macros for > > + documentation about these fields. */ > > + > > + unsigned int flag_unsigned : 1; > > + unsigned int flag_nosign : 1; > > + unsigned int flag_stub : 1; > > + unsigned int flag_target_stub : 1; > > + unsigned int flag_static : 1; > > + unsigned int flag_prototyped : 1; > > + unsigned int flag_incomplete : 1; > > + unsigned int flag_varargs : 1; > > + unsigned int flag_vector : 1; > > + unsigned int flag_stub_supported : 1; > > + unsigned int flag_nottext : 1; > > + unsigned int flag_fixed_instance : 1; > > Hi Tom, > > This is quite an old change but while debugging gdb I noticed that vector > types do have a strange bit set into their instance_flags and this seems to > go back to this patch. > The snippet above introduces the flag_nottext as a bitfield member of the > type struct while gdbtypes.c:make_vector_type still sets that bit into the > instance_flags. > > The nottext flag is set for the element types of vectors > (gdbtypes.c:make_vector_type) and for the builtin_int8/builtin_int8 types. > The flag is read from the c-valprint.c:c_textual_element_type function > that determines whether arrays of chars should be printed as strings or > not. So, I guess that prior to this patch char vectors were printed just > like integer vectors - plain data. One approach to restore that > functionality would be to move the nottext flag into to the instance_flags > of the type. Attached is an untested patch of what I have in mind. > Comments are welcome. > > This also renders my previous attempt to fix the printing of character > vectors (http://sourceware.org/ml/gdb-patches/2010-06/msg00573.html) > obsolete. > > Regards > Ken Werner Ping. : ) Since I screwed up the recipient list plus the fact that this was a reply to a 2008 post it may be well hidden by the mail reader. Are there any comments on that? Thanks Ken