diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-04-26 20:08:19 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-04-26 20:08:19 +0000 |
commit | f5f8a0099eaa5d5a75a801d5c4357024b1550d2f (patch) | |
tree | f01ae119e77af5a39f2a728c8f5df404c95fb792 /gdb | |
parent | e54fdaa5c98411e1874ba00e0b2d08815148ac06 (diff) | |
download | fsf-binutils-gdb-f5f8a0099eaa5d5a75a801d5c4357024b1550d2f.zip fsf-binutils-gdb-f5f8a0099eaa5d5a75a801d5c4357024b1550d2f.tar.gz fsf-binutils-gdb-f5f8a0099eaa5d5a75a801d5c4357024b1550d2f.tar.bz2 |
2002-04-24 Elena Zannoni <ezannoni@redhat.com>
* 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).
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 12 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 7 | ||||
-rw-r--r-- | gdb/gdbtypes.h | 7 |
4 files changed, 35 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6084d5e..8045153 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2002-04-26 Elena Zannoni <ezannoni@redhat.com> + + * 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). + 2002-04-26 Jason Thorpe <thorpej@wasabisystems.com> * alpha-tdep.h (gdbarch_tdep): Add sigcontext_addr member. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 4673f9a..0f05c09 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2662,6 +2662,16 @@ read_array_type (struct die_info *die, struct objfile *objfile, 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_<unknown>"; } diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index bad0ad8..fa01f36 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -3031,6 +3031,13 @@ recursive_dump_type (struct type *type, int spaces) { 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); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index f4a2cf6..0411aaa 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -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 { |