From: Elena Zannoni <ezannoni@redhat.com>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: gdb@sources.redhat.com, gcc@gcc.gnu.org, rth@redhat.com,
Elena Zannoni <ezannoni@redhat.com>
Subject: Re: rfc: DW_AT_vector
Date: Thu, 21 Feb 2002 21:28:00 -0000 [thread overview]
Message-ID: <15477.55000.987400.13875@localhost.redhat.com> (raw)
In-Reply-To: <20020222041007.GA2446@redhat.com>
Aldy Hernandez writes:
> hullo.
>
> it was brought to my attention that the dwarf2 information emitted
> by gcc for vector types is an array of ints/floats within a structure.
>
> this causes problems for gdb because vectors and structures may have
> different calling conventions. for example, in altivec, vectors
> go in registers and get returned in registers. this may not necessarily
> be true for structures on the same platform so gdb is unable to get
> the correct information.
>
> richard suggested:
>
> I suppose we could invent either (1) a DW_AT_vector flag to go along
> with the current struct-of-array-of representation or (2) a new
> DW_TAG_vector_type, which looks cleaner but wouldn't work at all with
> older gdb or other debuggers.
>
> i am completely clueless in all this, having never heard of DW_AT_
> or DW_TAG_ until about 30 minutes ago. but of course, that doesn't
> keep me from coming up with a patch which i obviously think is correct. :)
>
> i suggest coming up with a DW_AT_vector flag to go along with the
> structure business. this will work with any debugger, and will not
> break any type of compatibility. then gdb can be tweaked to look for
> the right values if a structure has a vector tag as well.
>
> of course, i'm willing to volunteer to code the DW_TAG_vector_type
> stuff, but only as a last and painful resort :).
>
This would work, yes, even though I would personally prefer to have a
new vector type. It represents more closely what these vectors really
are.
Anyway, you'll need to talk to the dwarf2/3 committee as well.
Elena
> here is a proof of concept patch for gcc, gdb, binutils, etc.
>
> comments?
>
> 2002-02-22 Aldy Hernandez <aldyh@redhat.com>
>
> * gdb/dwarf2read.c (dwarf_attr_name): Add case for DW_AT_vector.
>
> * include/elf/dwarf2.h (dwarf_attribute): Add DW_AT_vector.
>
> * binutils/readelf.c (get_AT_name): Add case for DW_AT_vector.
>
> * dwarf2.h (dwarf_attribute): Add DW_AT_vector.
>
> * dwarf2out.c (gen_struct_or_union_type_die): Add vector tag.
> (dwarf_attr_name): Add case for DW_AT_vector.
>
> Index: gcc/dwarf2out.c
> ===================================================================
> RCS file: /cvs/uberbaum/gcc/dwarf2out.c,v
> retrieving revision 1.353
> diff -c -p -r1.353 dwarf2out.c
> *** dwarf2out.c 2002/01/30 00:19:23 1.353
> --- dwarf2out.c 2002/02/22 03:39:41
> *************** dwarf_attr_name (attr)
> *** 4164,4169 ****
> --- 4164,4171 ----
> return "DW_AT_body_begin";
> case DW_AT_body_end:
> return "DW_AT_body_end";
> + case DW_AT_vector:
> + return "DW_AT_vector";
> case DW_AT_VMS_rtnbeg_pd_address:
> return "DW_AT_VMS_rtnbeg_pd_address";
>
> *************** gen_struct_or_union_type_die (type, cont
> *** 10888,10893 ****
> --- 10890,10897 ----
> && ! decl_function_context (TYPE_STUB_DECL (type)))
> VARRAY_PUSH_TREE (incomplete_types, type);
> }
> + if (TREE_CODE (type) == VECTOR_TYPE)
> + add_AT_flag (type_die, DW_AT_vector, 1);
> }
>
> /* Generate a DIE for a subroutine _type_. */
> Index: gcc/dwarf2.h
> ===================================================================
> RCS file: /cvs/uberbaum/gcc/dwarf2.h,v
> retrieving revision 1.22
> diff -c -p -r1.22 dwarf2.h
> *** dwarf2.h 2002/01/28 23:23:26 1.22
> --- dwarf2.h 2002/02/22 03:39:41
> *************** enum dwarf_attribute
> *** 239,244 ****
> --- 239,245 ----
> DW_AT_src_coords = 0x2104,
> DW_AT_body_begin = 0x2105,
> DW_AT_body_end = 0x2106,
> + DW_AT_vector = 0x2107,
> /* VMS Extensions. */
> DW_AT_VMS_rtnbeg_pd_address = 0x2201
> };
> Index: gdb/dwarf2read.c
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/dwarf2read.c,v
> retrieving revision 1.48
> diff -c -p -r1.48 dwarf2read.c
> *** dwarf2read.c 2002/02/15 22:42:33 1.48
> --- dwarf2read.c 2002/02/22 03:39:43
> *************** dwarf_attr_name (register unsigned attr)
> *** 5161,5166 ****
> --- 5161,5168 ----
> return "DW_AT_body_begin";
> case DW_AT_body_end:
> return "DW_AT_body_end";
> + case DW_AT_vector:
> + return "DW_AT_vector";
> default:
> return "DW_AT_<unknown>";
> }
> Index: binutils/readelf.c
> ===================================================================
> RCS file: /cvs/uberbaum/binutils/readelf.c,v
> retrieving revision 1.151
> diff -c -p -r1.151 readelf.c
> *** readelf.c 2002/02/13 18:14:42 1.151
> --- readelf.c 2002/02/22 03:39:46
> *************** get_AT_name (attribute)
> *** 6455,6460 ****
> --- 6455,6461 ----
> case DW_AT_src_coords: return "DW_AT_src_coords";
> case DW_AT_body_begin: return "DW_AT_body_begin";
> case DW_AT_body_end: return "DW_AT_body_end";
> + case DW_AT_vector: return "DW_AT_vector";
> default:
> {
> static char buffer [100];
> Index: gcc/dwarf2out.c
> ===================================================================
> RCS file: /cvs/uberbaum/gcc/dwarf2out.c,v
> retrieving revision 1.353
> diff -c -p -r1.353 dwarf2out.c
> *** dwarf2out.c 2002/01/30 00:19:23 1.353
> --- dwarf2out.c 2002/02/22 03:40:26
> *************** dwarf_attr_name (attr)
> *** 4164,4169 ****
> --- 4164,4171 ----
> return "DW_AT_body_begin";
> case DW_AT_body_end:
> return "DW_AT_body_end";
> + case DW_AT_vector:
> + return "DW_AT_vector";
> case DW_AT_VMS_rtnbeg_pd_address:
> return "DW_AT_VMS_rtnbeg_pd_address";
>
> *************** gen_struct_or_union_type_die (type, cont
> *** 10888,10893 ****
> --- 10890,10897 ----
> && ! decl_function_context (TYPE_STUB_DECL (type)))
> VARRAY_PUSH_TREE (incomplete_types, type);
> }
> + if (TREE_CODE (type) == VECTOR_TYPE)
> + add_AT_flag (type_die, DW_AT_vector, 1);
> }
>
> /* Generate a DIE for a subroutine _type_. */
> Index: gcc/dwarf2.h
> ===================================================================
> RCS file: /cvs/uberbaum/gcc/dwarf2.h,v
> retrieving revision 1.22
> diff -c -p -r1.22 dwarf2.h
> *** dwarf2.h 2002/01/28 23:23:26 1.22
> --- dwarf2.h 2002/02/22 03:40:27
> *************** enum dwarf_attribute
> *** 239,244 ****
> --- 239,245 ----
> DW_AT_src_coords = 0x2104,
> DW_AT_body_begin = 0x2105,
> DW_AT_body_end = 0x2106,
> + DW_AT_vector = 0x2107,
> /* VMS Extensions. */
> DW_AT_VMS_rtnbeg_pd_address = 0x2201
> };
> Index: gdb/dwarf2read.c
> ===================================================================
> RCS file: /cvs/uberbaum/gdb/dwarf2read.c,v
> retrieving revision 1.48
> diff -c -p -r1.48 dwarf2read.c
> *** dwarf2read.c 2002/02/15 22:42:33 1.48
> --- dwarf2read.c 2002/02/22 03:40:29
> *************** dwarf_attr_name (register unsigned attr)
> *** 5161,5166 ****
> --- 5161,5168 ----
> return "DW_AT_body_begin";
> case DW_AT_body_end:
> return "DW_AT_body_end";
> + case DW_AT_vector:
> + return "DW_AT_vector";
> default:
> return "DW_AT_<unknown>";
> }
> Index: include/elf/dwarf2.h
> ===================================================================
> RCS file: /cvs/uberbaum/include/elf/dwarf2.h,v
> retrieving revision 1.8
> diff -c -p -r1.8 dwarf2.h
> *** dwarf2.h 2002/01/28 23:26:53 1.8
> --- dwarf2.h 2002/02/22 03:40:29
> *************** enum dwarf_attribute
> *** 328,333 ****
> --- 328,334 ----
> DW_AT_src_coords = 0x2104,
> DW_AT_body_begin = 0x2105,
> DW_AT_body_end = 0x2106,
> + DW_AT_vector = 0x2107,
> /* VMS Extensions. */
> DW_AT_VMS_rtnbeg_pd_address = 0x2201
> };
> Index: binutils/readelf.c
> ===================================================================
> RCS file: /cvs/uberbaum/binutils/readelf.c,v
> retrieving revision 1.151
> diff -c -p -r1.151 readelf.c
> *** readelf.c 2002/02/13 18:14:42 1.151
> --- readelf.c 2002/02/22 03:40:35
> *************** get_AT_name (attribute)
> *** 6455,6460 ****
> --- 6455,6461 ----
> case DW_AT_src_coords: return "DW_AT_src_coords";
> case DW_AT_body_begin: return "DW_AT_body_begin";
> case DW_AT_body_end: return "DW_AT_body_end";
> + case DW_AT_vector: return "DW_AT_vector";
> default:
> {
> static char buffer [100];
next prev parent reply other threads:[~2002-02-22 5:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-21 20:27 Aldy Hernandez
2002-02-21 20:39 ` Andrew Cagney
2002-02-22 1:29 ` Richard Henderson
2002-02-22 6:49 ` Andrew Cagney
2002-02-22 9:53 ` Richard Henderson
2002-02-21 21:28 ` Elena Zannoni [this message]
2002-02-21 23:05 ` Aldy Hernandez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15477.55000.987400.13875@localhost.redhat.com \
--to=ezannoni@redhat.com \
--cc=aldyh@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=gdb@sources.redhat.com \
--cc=rth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).