* [RFA] Add vector type flag to stabsread.c
@ 2002-05-06 16:44 Michael Snyder
2002-05-07 19:09 ` Elena Zannoni
0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-05-06 16:44 UTC (permalink / raw)
To: gdb-patches; +Cc: jimb
This patch does to stabs what Elena has recently done for dwarf --
add an attribute extension that allows an array type to be tagged
as a vector. Knowing that it is a vector, GDB can then modify the
way the object is passed as a function argument.
The syntax for stabs will be to add the string "@V;" in front of
the "ar" declaration. The "@" attribute extension already exists
in stabs -- we're just adding a new instance of it.
The GCC patch for this extension should be coming out today.
2002-05-06 Michael Snyder <msnyder@redhat.com>
* stabsread.c (read_type): Add recognition for new attribute:
"@V;" means that an array type is actually a vector.
This is analogous to the vector flag that's been added to dwarf2.
Index: stabsread.c
===================================================================
RCS file: /cvs/src/src/gdb/stabsread.c,v
retrieving revision 1.32
diff -p -r1.32 stabsread.c
*** stabsread.c 4 May 2002 00:21:09 -0000 1.32
--- stabsread.c 6 May 2002 23:39:00 -0000
*************** define_symbol (CORE_ADDR valu, char *str
*** 1904,1909 ****
--- 1904,1910 ----
break;
case 't':
+ /* Typedef */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
/* For a nameless type, we don't want a create a symbol, thus we
*************** read_type (register char **pp, struct ob
*** 2359,2364 ****
--- 2360,2368 ----
/* Used to distinguish string and bitstring from char-array and set. */
int is_string = 0;
+ /* Used to distinguish vector from array. */
+ int is_vector = 0;
+
/* Read type number if present. The type number may be omitted.
for instance in a two-dimensional array declared with type
"ar1;1;10;ar1;1;10;4". */
*************** again:
*** 2574,2580 ****
forward-referenced), and we must change it to a pointer, function,
reference, or whatever, *in-place*. */
! case '*':
type1 = read_type (pp, objfile);
type = make_pointer_type (type1, dbx_lookup_type (typenums));
break;
--- 2578,2584 ----
forward-referenced), and we must change it to a pointer, function,
reference, or whatever, *in-place*. */
! case '*': /* Pointer to another type */
type1 = read_type (pp, objfile);
type = make_pointer_type (type1, dbx_lookup_type (typenums));
break;
*************** again:
*** 2732,2747 ****
switch (*attr)
{
! case 's':
type_size = atoi (attr + 1);
if (type_size <= 0)
type_size = -1;
break;
! case 'S':
is_string = 1;
break;
default:
/* Ignore unrecognized type attributes, so future compilers
can invent new ones. */
--- 2736,2757 ----
switch (*attr)
{
! case 's': /* Size attribute */
type_size = atoi (attr + 1);
if (type_size <= 0)
type_size = -1;
break;
! case 'S': /* String attribute */
! /* FIXME: check to see if following type is array? */
is_string = 1;
break;
+ case 'V': /* Vector attribute */
+ /* FIXME: check to see if following type is array? */
+ is_vector = 1;
+ break;
+
default:
/* Ignore unrecognized type attributes, so future compilers
can invent new ones. */
*************** again:
*** 2844,2852 ****
type = read_array_type (pp, type, objfile);
if (is_string)
TYPE_CODE (type) = TYPE_CODE_STRING;
break;
! case 'S':
type1 = read_type (pp, objfile);
type = create_set_type ((struct type *) NULL, type1);
if (is_string)
--- 2854,2864 ----
type = read_array_type (pp, type, objfile);
if (is_string)
TYPE_CODE (type) = TYPE_CODE_STRING;
+ if (is_vector)
+ TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
break;
! case 'S': /* Set or bitstring type */
type1 = read_type (pp, objfile);
type = create_set_type ((struct type *) NULL, type1);
if (is_string)
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [RFA] Add vector type flag to stabsread.c
2002-05-06 16:44 [RFA] Add vector type flag to stabsread.c Michael Snyder
@ 2002-05-07 19:09 ` Elena Zannoni
2002-05-07 19:19 ` Michael Snyder
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Elena Zannoni @ 2002-05-07 19:09 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, jimb
Michael Snyder writes:
>
OK.
Should the stabs doc be updated? Who controls that?
Elena
> This patch does to stabs what Elena has recently done for dwarf --
> add an attribute extension that allows an array type to be tagged
> as a vector. Knowing that it is a vector, GDB can then modify the
> way the object is passed as a function argument.
>
> The syntax for stabs will be to add the string "@V;" in front of
> the "ar" declaration. The "@" attribute extension already exists
> in stabs -- we're just adding a new instance of it.
>
> The GCC patch for this extension should be coming out today.
>
> 2002-05-06 Michael Snyder <msnyder@redhat.com>
>
> * stabsread.c (read_type): Add recognition for new attribute:
> "@V;" means that an array type is actually a vector.
> This is analogous to the vector flag that's been added to dwarf2.
>
> Index: stabsread.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/stabsread.c,v
> retrieving revision 1.32
> diff -p -r1.32 stabsread.c
> *** stabsread.c 4 May 2002 00:21:09 -0000 1.32
> --- stabsread.c 6 May 2002 23:39:00 -0000
> *************** define_symbol (CORE_ADDR valu, char *str
> *** 1904,1909 ****
> --- 1904,1910 ----
> break;
>
> case 't':
> + /* Typedef */
> SYMBOL_TYPE (sym) = read_type (&p, objfile);
>
> /* For a nameless type, we don't want a create a symbol, thus we
> *************** read_type (register char **pp, struct ob
> *** 2359,2364 ****
> --- 2360,2368 ----
> /* Used to distinguish string and bitstring from char-array and set. */
> int is_string = 0;
>
> + /* Used to distinguish vector from array. */
> + int is_vector = 0;
> +
> /* Read type number if present. The type number may be omitted.
> for instance in a two-dimensional array declared with type
> "ar1;1;10;ar1;1;10;4". */
> *************** again:
> *** 2574,2580 ****
> forward-referenced), and we must change it to a pointer, function,
> reference, or whatever, *in-place*. */
>
> ! case '*':
> type1 = read_type (pp, objfile);
> type = make_pointer_type (type1, dbx_lookup_type (typenums));
> break;
> --- 2578,2584 ----
> forward-referenced), and we must change it to a pointer, function,
> reference, or whatever, *in-place*. */
>
> ! case '*': /* Pointer to another type */
> type1 = read_type (pp, objfile);
> type = make_pointer_type (type1, dbx_lookup_type (typenums));
> break;
> *************** again:
> *** 2732,2747 ****
>
> switch (*attr)
> {
> ! case 's':
> type_size = atoi (attr + 1);
> if (type_size <= 0)
> type_size = -1;
> break;
>
> ! case 'S':
> is_string = 1;
> break;
>
> default:
> /* Ignore unrecognized type attributes, so future compilers
> can invent new ones. */
> --- 2736,2757 ----
>
> switch (*attr)
> {
> ! case 's': /* Size attribute */
> type_size = atoi (attr + 1);
> if (type_size <= 0)
> type_size = -1;
> break;
>
> ! case 'S': /* String attribute */
> ! /* FIXME: check to see if following type is array? */
> is_string = 1;
> break;
>
> + case 'V': /* Vector attribute */
> + /* FIXME: check to see if following type is array? */
> + is_vector = 1;
> + break;
> +
> default:
> /* Ignore unrecognized type attributes, so future compilers
> can invent new ones. */
> *************** again:
> *** 2844,2852 ****
> type = read_array_type (pp, type, objfile);
> if (is_string)
> TYPE_CODE (type) = TYPE_CODE_STRING;
> break;
>
> ! case 'S':
> type1 = read_type (pp, objfile);
> type = create_set_type ((struct type *) NULL, type1);
> if (is_string)
> --- 2854,2864 ----
> type = read_array_type (pp, type, objfile);
> if (is_string)
> TYPE_CODE (type) = TYPE_CODE_STRING;
> + if (is_vector)
> + TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
> break;
>
> ! case 'S': /* Set or bitstring type */
> type1 = read_type (pp, objfile);
> type = create_set_type ((struct type *) NULL, type1);
> if (is_string)
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [RFA] Add vector type flag to stabsread.c
2002-05-07 19:09 ` Elena Zannoni
@ 2002-05-07 19:19 ` Michael Snyder
2002-05-08 13:37 ` Jim Blandy
2002-05-09 11:12 ` Michael Snyder
2 siblings, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2002-05-07 19:19 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Michael Snyder, gdb-patches, jimb
Elena Zannoni wrote:
>
> Michael Snyder writes:
> >
>
> OK.
> Should the stabs doc be updated? Who controls that?
>
> Elena
Are you standing in for Eli today? ;-)
OK, I see where it should go, I'll add it tomorrow.
> > This patch does to stabs what Elena has recently done for dwarf --
> > add an attribute extension that allows an array type to be tagged
> > as a vector. Knowing that it is a vector, GDB can then modify the
> > way the object is passed as a function argument.
> >
> > The syntax for stabs will be to add the string "@V;" in front of
> > the "ar" declaration. The "@" attribute extension already exists
> > in stabs -- we're just adding a new instance of it.
> >
> > The GCC patch for this extension should be coming out today.
> >
> > 2002-05-06 Michael Snyder <msnyder@redhat.com>
> >
> > * stabsread.c (read_type): Add recognition for new attribute:
> > "@V;" means that an array type is actually a vector.
> > This is analogous to the vector flag that's been added to dwarf2.
> >
> > Index: stabsread.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/stabsread.c,v
> > retrieving revision 1.32
> > diff -p -r1.32 stabsread.c
> > *** stabsread.c 4 May 2002 00:21:09 -0000 1.32
> > --- stabsread.c 6 May 2002 23:39:00 -0000
> > *************** define_symbol (CORE_ADDR valu, char *str
> > *** 1904,1909 ****
> > --- 1904,1910 ----
> > break;
> >
> > case 't':
> > + /* Typedef */
> > SYMBOL_TYPE (sym) = read_type (&p, objfile);
> >
> > /* For a nameless type, we don't want a create a symbol, thus we
> > *************** read_type (register char **pp, struct ob
> > *** 2359,2364 ****
> > --- 2360,2368 ----
> > /* Used to distinguish string and bitstring from char-array and set. */
> > int is_string = 0;
> >
> > + /* Used to distinguish vector from array. */
> > + int is_vector = 0;
> > +
> > /* Read type number if present. The type number may be omitted.
> > for instance in a two-dimensional array declared with type
> > "ar1;1;10;ar1;1;10;4". */
> > *************** again:
> > *** 2574,2580 ****
> > forward-referenced), and we must change it to a pointer, function,
> > reference, or whatever, *in-place*. */
> >
> > ! case '*':
> > type1 = read_type (pp, objfile);
> > type = make_pointer_type (type1, dbx_lookup_type (typenums));
> > break;
> > --- 2578,2584 ----
> > forward-referenced), and we must change it to a pointer, function,
> > reference, or whatever, *in-place*. */
> >
> > ! case '*': /* Pointer to another type */
> > type1 = read_type (pp, objfile);
> > type = make_pointer_type (type1, dbx_lookup_type (typenums));
> > break;
> > *************** again:
> > *** 2732,2747 ****
> >
> > switch (*attr)
> > {
> > ! case 's':
> > type_size = atoi (attr + 1);
> > if (type_size <= 0)
> > type_size = -1;
> > break;
> >
> > ! case 'S':
> > is_string = 1;
> > break;
> >
> > default:
> > /* Ignore unrecognized type attributes, so future compilers
> > can invent new ones. */
> > --- 2736,2757 ----
> >
> > switch (*attr)
> > {
> > ! case 's': /* Size attribute */
> > type_size = atoi (attr + 1);
> > if (type_size <= 0)
> > type_size = -1;
> > break;
> >
> > ! case 'S': /* String attribute */
> > ! /* FIXME: check to see if following type is array? */
> > is_string = 1;
> > break;
> >
> > + case 'V': /* Vector attribute */
> > + /* FIXME: check to see if following type is array? */
> > + is_vector = 1;
> > + break;
> > +
> > default:
> > /* Ignore unrecognized type attributes, so future compilers
> > can invent new ones. */
> > *************** again:
> > *** 2844,2852 ****
> > type = read_array_type (pp, type, objfile);
> > if (is_string)
> > TYPE_CODE (type) = TYPE_CODE_STRING;
> > break;
> >
> > ! case 'S':
> > type1 = read_type (pp, objfile);
> > type = create_set_type ((struct type *) NULL, type1);
> > if (is_string)
> > --- 2854,2864 ----
> > type = read_array_type (pp, type, objfile);
> > if (is_string)
> > TYPE_CODE (type) = TYPE_CODE_STRING;
> > + if (is_vector)
> > + TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
> > break;
> >
> > ! case 'S': /* Set or bitstring type */
> > type1 = read_type (pp, objfile);
> > type = create_set_type ((struct type *) NULL, type1);
> > if (is_string)
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [RFA] Add vector type flag to stabsread.c
2002-05-07 19:09 ` Elena Zannoni
2002-05-07 19:19 ` Michael Snyder
@ 2002-05-08 13:37 ` Jim Blandy
2002-05-08 13:46 ` Michael Snyder
2002-05-09 11:12 ` Michael Snyder
2 siblings, 1 reply; 8+ messages in thread
From: Jim Blandy @ 2002-05-08 13:37 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Michael Snyder, gdb-patches
Elena Zannoni <ezannoni@redhat.com> writes:
> OK.
> Should the stabs doc be updated? Who controls that?
Yes. Us. :)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Add vector type flag to stabsread.c
2002-05-08 13:37 ` Jim Blandy
@ 2002-05-08 13:46 ` Michael Snyder
2002-05-08 21:44 ` Eli Zaretskii
0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-05-08 13:46 UTC (permalink / raw)
To: Jim Blandy; +Cc: Elena Zannoni, Michael Snyder, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 167 bytes --]
Jim Blandy wrote:
>
> Elena Zannoni <ezannoni@redhat.com> writes:
> > OK.
> > Should the stabs doc be updated? Who controls that?
>
> Yes. Us. :)
OK, how's this?
[-- Attachment #2: vector.patch --]
[-- Type: text/plain, Size: 958 bytes --]
2002-05-08 Michael Snyder <msnyder@redhat.com>
* stabs.texinfo (Attributes): Document new "vector" attribute.
Index: stabs.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/stabs.texinfo,v
retrieving revision 1.5
diff -p -r1.5 stabs.texinfo
*** stabs.texinfo 30 Dec 2001 06:25:16 -0000 1.5
--- stabs.texinfo 8 May 2002 20:36:35 -0000
*************** Indicate that this type is a string inst
*** 287,292 ****
--- 287,298 ----
or a bitstring instead of a set. It doesn't change the layout of the
data being represented, but does enable the debugger to know which type
it is.
+
+ @item V
+ Indicate that this type is a vector instead of an array. The only
+ major difference between vectors and arrays is that vectors are
+ passed by value instead of by reference (vector coprocessor extension).
+
@end table
All of this can make the string field quite long. All versions of GDB,
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Add vector type flag to stabsread.c
2002-05-07 19:09 ` Elena Zannoni
2002-05-07 19:19 ` Michael Snyder
2002-05-08 13:37 ` Jim Blandy
@ 2002-05-09 11:12 ` Michael Snyder
2 siblings, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2002-05-09 11:12 UTC (permalink / raw)
To: Elena Zannoni; +Cc: Michael Snyder, gdb-patches, jimb
Elena Zannoni wrote:
>
> Michael Snyder writes:
> >
>
> OK.
Committed.
> Should the stabs doc be updated? Who controls that?
Done.
>
> Elena
>
> > This patch does to stabs what Elena has recently done for dwarf --
> > add an attribute extension that allows an array type to be tagged
> > as a vector. Knowing that it is a vector, GDB can then modify the
> > way the object is passed as a function argument.
> >
> > The syntax for stabs will be to add the string "@V;" in front of
> > the "ar" declaration. The "@" attribute extension already exists
> > in stabs -- we're just adding a new instance of it.
> >
> > The GCC patch for this extension should be coming out today.
> >
> > 2002-05-06 Michael Snyder <msnyder@redhat.com>
> >
> > * stabsread.c (read_type): Add recognition for new attribute:
> > "@V;" means that an array type is actually a vector.
> > This is analogous to the vector flag that's been added to dwarf2.
> >
> > Index: stabsread.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/stabsread.c,v
> > retrieving revision 1.32
> > diff -p -r1.32 stabsread.c
> > *** stabsread.c 4 May 2002 00:21:09 -0000 1.32
> > --- stabsread.c 6 May 2002 23:39:00 -0000
> > *************** define_symbol (CORE_ADDR valu, char *str
> > *** 1904,1909 ****
> > --- 1904,1910 ----
> > break;
> >
> > case 't':
> > + /* Typedef */
> > SYMBOL_TYPE (sym) = read_type (&p, objfile);
> >
> > /* For a nameless type, we don't want a create a symbol, thus we
> > *************** read_type (register char **pp, struct ob
> > *** 2359,2364 ****
> > --- 2360,2368 ----
> > /* Used to distinguish string and bitstring from char-array and set. */
> > int is_string = 0;
> >
> > + /* Used to distinguish vector from array. */
> > + int is_vector = 0;
> > +
> > /* Read type number if present. The type number may be omitted.
> > for instance in a two-dimensional array declared with type
> > "ar1;1;10;ar1;1;10;4". */
> > *************** again:
> > *** 2574,2580 ****
> > forward-referenced), and we must change it to a pointer, function,
> > reference, or whatever, *in-place*. */
> >
> > ! case '*':
> > type1 = read_type (pp, objfile);
> > type = make_pointer_type (type1, dbx_lookup_type (typenums));
> > break;
> > --- 2578,2584 ----
> > forward-referenced), and we must change it to a pointer, function,
> > reference, or whatever, *in-place*. */
> >
> > ! case '*': /* Pointer to another type */
> > type1 = read_type (pp, objfile);
> > type = make_pointer_type (type1, dbx_lookup_type (typenums));
> > break;
> > *************** again:
> > *** 2732,2747 ****
> >
> > switch (*attr)
> > {
> > ! case 's':
> > type_size = atoi (attr + 1);
> > if (type_size <= 0)
> > type_size = -1;
> > break;
> >
> > ! case 'S':
> > is_string = 1;
> > break;
> >
> > default:
> > /* Ignore unrecognized type attributes, so future compilers
> > can invent new ones. */
> > --- 2736,2757 ----
> >
> > switch (*attr)
> > {
> > ! case 's': /* Size attribute */
> > type_size = atoi (attr + 1);
> > if (type_size <= 0)
> > type_size = -1;
> > break;
> >
> > ! case 'S': /* String attribute */
> > ! /* FIXME: check to see if following type is array? */
> > is_string = 1;
> > break;
> >
> > + case 'V': /* Vector attribute */
> > + /* FIXME: check to see if following type is array? */
> > + is_vector = 1;
> > + break;
> > +
> > default:
> > /* Ignore unrecognized type attributes, so future compilers
> > can invent new ones. */
> > *************** again:
> > *** 2844,2852 ****
> > type = read_array_type (pp, type, objfile);
> > if (is_string)
> > TYPE_CODE (type) = TYPE_CODE_STRING;
> > break;
> >
> > ! case 'S':
> > type1 = read_type (pp, objfile);
> > type = create_set_type ((struct type *) NULL, type1);
> > if (is_string)
> > --- 2854,2864 ----
> > type = read_array_type (pp, type, objfile);
> > if (is_string)
> > TYPE_CODE (type) = TYPE_CODE_STRING;
> > + if (is_vector)
> > + TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
> > break;
> >
> > ! case 'S': /* Set or bitstring type */
> > type1 = read_type (pp, objfile);
> > type = create_set_type ((struct type *) NULL, type1);
> > if (is_string)
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-05-09 18:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-06 16:44 [RFA] Add vector type flag to stabsread.c Michael Snyder
2002-05-07 19:09 ` Elena Zannoni
2002-05-07 19:19 ` Michael Snyder
2002-05-08 13:37 ` Jim Blandy
2002-05-08 13:46 ` Michael Snyder
2002-05-08 21:44 ` Eli Zaretskii
2002-05-09 11:13 ` Michael Snyder
2002-05-09 11:12 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox