From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19581 invoked by alias); 23 Apr 2005 00:13:40 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 19508 invoked from network); 23 Apr 2005 00:13:27 -0000 Received: from unknown (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org with SMTP; 23 Apr 2005 00:13:27 -0000 Received: from mailgate2.apple.com (a17-128-100-204.apple.com [17.128.100.204]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id j3N0DRS8026118 for ; Fri, 22 Apr 2005 17:13:27 -0700 (PDT) Received: from relay2.apple.com (relay2.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.3.17) with ESMTP id ; Fri, 22 Apr 2005 17:13:26 -0700 Received: from greed.local ([17.219.197.153]) by relay2.apple.com (8.12.11/8.12.11) with ESMTP id j3N0DJrk009957; Fri, 22 Apr 2005 17:13:20 -0700 (PDT) Received: by greed.local (Postfix, from userid 501) id F1E3F434F88; Fri, 22 Apr 2005 17:14:07 -0700 (PDT) To: Devang Patel Cc: gcc-patches@gcc.gnu.org, gdb@sources.redhat.com Subject: Re: [PATCH] Debugging Vector Types References: <547BC9E3-4C03-4724-8BB5-BB1A99BB3625@apple.com> From: Geoffrey Keating Date: Sat, 23 Apr 2005 00:13:00 -0000 In-Reply-To: <547BC9E3-4C03-4724-8BB5-BB1A99BB3625@apple.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2005-04/txt/msg00158.txt.bz2 Devang Patel writes: > GCC encodes Vector Types as an array of N elements (at least, in > STABS format). This means, GDB is not able to distinguish it from a > normal Array. And these may lead to confusing output from GDB. One of > our user reported that for > > vector unsigned char a = (vector unsigned char) ( > 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 ); > > gdb prints > > (gdb) print a > $1 = "\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020" > > If following is used > > vector unsigned char a = (vector unsigned char) ( > 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p' ); > > then gdb prints > > (gdb) print a > $1 = "abcdefghijklmnop" > > but, it's not vector! > > If GCC provides GDB some kind of hints then GDB may be able to > display something meaningful. This patch attaches "attribute vector" > to the stabs string used to represent vector types. I am told that > GDB ignores attributes that it does not recognize. So we can update > GCC independently. I tested small test cases and our darwin GDB does > not get offended by this additional attribute. > > * dbxout.c (dbxout_type): Emit attribute vector. > * config/darwin.h (DBX_USE_VECTOR_ATTRIBUTE): Define. > * doc/tm.texi (DBX_USE_VECTOR_ATTRIBUTE): Document. > > * gcc.dg/stabs-attrib-vect.c: New test. > > Bootstrapped and tested on powerpc-darwin. > OK for mainline ? - I don't think this should be Darwin-specific. Shouldn't everyone have it? It's not like it can break Solaris dbx or something, unless people are using vector types, in which case IMO they should just use GDB. - You need to update stabs.texi, which I think lives in GDB. (It's the only stabs documentation we have, so keeping it up-to-date is important!) Other than that the patch seems reasonable enough to me. The GDB people may have some more comments, so I've CCed them. GDB people: As I understand the patch, what it does is add '@V;' to the end to the stab for the type, so it looks like "vi:(0,16)=@V;".