From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22483 invoked by alias); 26 Apr 2002 20:08:50 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22438 invoked from network); 26 Apr 2002 20:08:47 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 26 Apr 2002 20:08:47 -0000 Received: from localhost.redhat.com (remus.sfbay.redhat.com [172.16.27.252]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id NAA07616 for ; Fri, 26 Apr 2002 13:08:45 -0700 (PDT) Received: by localhost.redhat.com (Postfix, from userid 469) id 0138610A8C; Fri, 26 Apr 2002 16:08:18 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15561.46002.376457.648551@localhost.redhat.com> Date: Fri, 26 Apr 2002 13:08:00 -0000 To: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Add support for dwarf2 vectors In-Reply-To: <15559.25131.290360.770795@localhost.redhat.com> References: <15559.25131.290360.770795@localhost.redhat.com> X-SW-Source: 2002-04/txt/msg01085.txt.bz2 Committed. Elena Elena Zannoni writes: > > This is anohter bit of the support for AltiVec on PowerPC. > > This introduces support for the new gcc debug info introduced by Jason Merrill: > http://gcc.gnu.org/ml/gcc-patches/2002-04/msg01428.html > > It is a bit hard to test, not having the corresponding simulator > changes in the tree yet. It can be done on native G4 machines, though. > > I'll follow up with powerpc ABI updates that actually use this stuff. > > Elena > > Note: this is dependent on a patch for /include/elf/dwarf2.h that I > just posted to the binutils list, otherwise gdb won't build. > > 2002-04-24 Elena Zannoni > > * gdbtypes.h (TYPE_FLAG_VECTOR, TYPE_VECTOR): Define. > * gdbtypes.c (recursive_dump_type): Output the vector flag. > * dwarf2read.c (dwarf_attr_name): Handle new attribute for > vectors. > (read_array_type): Record the fact that this array type is really a > vector (i.e. are passed in by value). > > > Index: dwarf2read.c > =================================================================== > RCS file: /cvs/uberbaum/gdb/dwarf2read.c,v > retrieving revision 1.52 > diff -u -p -r1.52 dwarf2read.c > --- dwarf2read.c 4 Apr 2002 22:26:43 -0000 1.52 > +++ dwarf2read.c 24 Apr 2002 21:40:25 -0000 > @@ -2662,6 +2662,16 @@ read_array_type (struct die_info *die, s > while (ndim-- > 0) > type = create_array_type (NULL, type, range_types[ndim]); > > + /* Understand Dwarf2 support for vector types (like they occur on > + the PowerPC w/ AltiVec). Gcc just adds another attribute to the > + array type. This is not part of the Dwarf2/3 standard yet, but a > + custom vendor extension. The main difference between a regular > + array and the vector variant is that vectors are passed by value > + to functions. */ > + attr = dwarf_attr (die, DW_AT_GNU_vector); > + if (attr) > + TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR; > + > do_cleanups (back_to); > > /* Install the type in the die. */ > @@ -5267,6 +5277,8 @@ dwarf_attr_name (register unsigned attr) > return "DW_AT_body_begin"; > case DW_AT_body_end: > return "DW_AT_body_end"; > + case DW_AT_GNU_vector: > + return "DW_AT_GNU_vector"; > default: > return "DW_AT_"; > } > > Index: gdbtypes.h > =================================================================== > RCS file: /cvs/uberbaum/gdb/gdbtypes.h,v > retrieving revision 1.27 > diff -u -p -r1.27 gdbtypes.h > --- gdbtypes.h 23 Mar 2002 01:24:54 -0000 1.27 > +++ gdbtypes.h 24 Apr 2002 21:42:08 -0000 > @@ -248,6 +248,13 @@ enum type_code > #define TYPE_FLAG_VARARGS (1 << 11) > #define TYPE_VARARGS(t) ((t)->flags & TYPE_FLAG_VARARGS) > > +/* Identify a vector type. Gcc is handling this by adding an extra > + attribute to the array type. We slurp that in as a new flag of a > + type. This is used only in dwarf2read.c. */ > +#define TYPE_FLAG_VECTOR (1 << 12) > +#define TYPE_VECTOR(t) ((t)->flags & TYPE_FLAG_VECTOR) > + > + > struct type > { > > Index: gdbtypes.c > =================================================================== > RCS file: /cvs/uberbaum/gdb/gdbtypes.c,v > retrieving revision 1.43 > diff -u -p -r1.43 gdbtypes.c > --- gdbtypes.c 20 Apr 2002 01:09:28 -0000 1.43 > +++ gdbtypes.c 24 Apr 2002 21:42:31 -0000 > @@ -3031,6 +3031,13 @@ recursive_dump_type (struct type *type, > { > puts_filtered (" TYPE_FLAG_VARARGS"); > } > + /* This is used for things like AltiVec registers on ppc. Gcc emits > + an attribute for the array type, which tells whether or not we > + have a vector, instead of a regular array. */ > + if (TYPE_VECTOR (type)) > + { > + puts_filtered (" TYPE_FLAG_VECTOR"); > + } > puts_filtered ("\n"); > printfi_filtered (spaces, "nfields %d ", TYPE_NFIELDS (type)); > gdb_print_host_address (TYPE_FIELDS (type), gdb_stdout);