This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Small fix for assigning values to vectors


On Wed, Jul 07, 2010 at 07:50:14PM +0200, Ulrich Weigand wrote:
> Ken Werner wrote:
> 
> > As can be seen the GDB behaves incorrect for vector types. A quick look to the 
> > valops.c:value_assign function shows that value_coerce_to_target creates a 
> > value with lval set to lval_memory for array types (including vectors). The 
> > code was introduced with the following patch: http://sourceware.org/ml/gdb-
> > patches/2008-03/msg00079.html. I have to admit that I do not entirely 
> > understand why value_coerce_to_target is called here.
> 
> Dan, do you recall why you added a value_coerce_to_target for the *destination*
> of an assignment?  It seems this shouldn't really be necessary ...

I'm not sure now.  We could try dropping it.

> > @@ -1424,6 +1424,9 @@ value_must_coerce_to_target (struct valu
> >  
> >    valtype = check_typedef (value_type (val));
> >  
> > +  if (TYPE_VECTOR (valtype))
> > +    return 0;
> > +
> >    switch (TYPE_CODE (valtype))
> >      {
> >      case TYPE_CODE_ARRAY:
> 
> Ken, this doesn't look quite right: the TYPE_VECTOR flag is defined only for
> TYPE_CODE_ARRAY types; you should never look at TYPE_VECTOR for any other type.
> 
> Otherwise, this looks reasonable to me ...

It does seem reasonable that a vector does not have to live in target
memory.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]