This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Altivec ABI patches
- From: Jim Blandy <jimb at redhat dot com>
- To: Elena Zannoni <ezannoni at redhat dot com>
- Cc: Kevin Buettner <kevinb at redhat dot com>,gdb-patches at sources dot redhat dot com
- Date: 02 May 2002 02:22:43 -0500
- Subject: Re: [RFA] Altivec ABI patches
- References: <15561.48188.141526.557982@localhost.redhat.com><1020426230236.ZM31350@localhost.localdomain><15562.646.506619.140778@localhost.redhat.com><1020427080809.ZM32701@localhost.localdomain><15565.26939.309256.444181@localhost.redhat.com><npg01effwi.fsf@zwingli.cygnus.com><15565.44421.333605.509796@localhost.redhat.com><npvga73kxv.fsf@zwingli.cygnus.com>
Jim Blandy <jimb@redhat.com> writes:
> Elena Zannoni <ezannoni@redhat.com> writes:
> > Jim Blandy writes:
> > >
> > > I don't see anything here that prevents vectors from being coerced to
> > > pointers to their first element. Isn't there some change needed in
> > > evaluate_subexp_with_coercion?
> >
> > You mean value_arg_coerce()?
>
> Err, ... yeah, that's what I meant. :)
Wait, no. If `v' is a vector variable, and the user types `print v +
2', that should be an error, right? But somehow it'll get promoted to
a pointer to its first element. value_add calls COERCE_NUMBER, which
calls COERCE_ARRAY. I think that's what you need to fix. Note that
value_subscript already handles arrays specially --- it doesn't depend
on C's array coercion --- so it should continue to work. I think.
You may have already done this, but I'd grep for TYPE_CODE_ARRAY and
make sure each case is handled properly.