From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24532 invoked by alias); 1 Oct 2010 13:23:15 -0000 Received: (qmail 24518 invoked by uid 22791); 1 Oct 2010 13:23:14 -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 mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.17.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Oct 2010 13:23:09 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.1/8.13.1) with ESMTP id o91DN6WZ023341 for ; Fri, 1 Oct 2010 13:23:06 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o91DN6AR3416144 for ; Fri, 1 Oct 2010 15:23:06 +0200 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o91DN63g008509 for ; Fri, 1 Oct 2010 15:23:06 +0200 Received: from leonard.localnet (dyn-9-152-224-33.boeblingen.de.ibm.com [9.152.224.33]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o91DN1XI008308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Oct 2010 15:23:06 +0200 From: Ken Werner To: Joel Brobecker Subject: Re: RFA: shrink main_type Date: Fri, 01 Oct 2010 13:23:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-25-generic; KDE/4.4.2; i686; ; ) Cc: gdb-patches@sourceware.org References: <201009151441.43723.ken@linux.vnet.ibm.com> <20100930175518.GA2976@adacore.com> In-Reply-To: <20100930175518.GA2976@adacore.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010011523.00064.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-10/txt/msg00005.txt.bz2 On Thursday, September 30, 2010 7:55:18 pm Joel Brobecker wrote: > I'm sorry about the delay in getting to this. I hope it's something > temporary that we all seem to be busier than usual. Thanks for taking a look at this. > > 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. > It took me a while to figure out why this is necessary. Initially, > I thought that the vector type should have the NOTTEXT bit set, > but that wouldn't be sufficient for the case where we just print > one element of the vector (because we'd end up checking type of > the element and not find the NOTTEXT bit set, and thus print it > as a character rather than an integer. > > Do I understand the situation correctly? If yes, can we add a test > that checks that, if not already there? I think you are right because c_textual_element_type queries the type of the element to be printed. In case a single element of the vector is printed it is the type of the vectors target type. Printing of character vectors is only tested indirectly through gdb.arch/altivec-abi.exp. I think it would be good to add a few tests to gdb.base/gnu_vector.exp. > Based on that understanding, then I agree that the NOTTEXT flag > seems to be more of an instance flag than a type flag. The code > in make_vector_type seems to be confirming that. > > If you make a proper submission for this patch, I will officially > review it. When I first realized that printing of char vectors is awkward I attempted to fix this at c-valprint (http://sourceware.org/ml/gdb- patches/2010-06/msg00573.html) but overlooked that there already is a mechanism for that. Then I learned about the NOTTEXT flag and thought Toms shrink-main_type-patch broke the char vector printing and revived this mail thread. Now I think this never worked because even the initial patch from Jan (http://sourceware.org/ml/gdb-patches/2007-08/msg00467.html) writes the nottext bit into the instance flags (make_vector_type) but the textual_element_type function checks for a type flag. I think that moving nottext flag into to the instance_flags of the type is a good way to fix this. I'll post a proper patch soon. Thanks -ken