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 05/10] vla: allow side effects for sizeof argument


Thanks for your review.

It turns out this patch is not needed anymore as the bounds are resolved 
before the sizeof function is called. So in v2 this patch will be dropped
from the series.

>     (gdb) print sizeof (array[x++])
> 
> For an ordinary array this should not modify x.
Indeed, that is the behavior we have now in HEAD@vla-c99.

> Sanimir> Meanwhile you can track our latest development efforts on
> Sanimir> http://intel-gdb.github.io/ branch vla-c99.
> 
> Is that all rebased to binutils-gdb.git now?
> If so I will start fetching from it again.
Meanwhile the above repository got re-setup to mirror binutils-gdb.git.

 -Sanimir

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf
> Of Tom Tromey
> Sent: Monday, October 28, 2013 10:00 PM
> To: Agovic, Sanimir
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH 05/10] vla: allow side effects for sizeof argument
> 
> >>>>> "Sanimir" == Agovic, Sanimir <sanimir.agovic@intel.com> writes:
> 
> Sanimir> I avoid to re-send the complete patch series, thus see my
> Sanimir> alternative proposal below. Once I receive more feedback
> Sanimir> I will re-publish my patch series including this fix if
> Sanimir> applicable.
> 
> I don't see how this version of the patch solves what I thought the
> problem was.
> 
> I'm sure it is just my misunderstanding though.
> 
> Sanimir> Meanwhile you can track our latest development efforts on
> Sanimir> http://intel-gdb.github.io/ branch vla-c99.
> 
> Is that all rebased to binutils-gdb.git now?
> If so I will start fetching from it again.
> 
> Sanimir> +    case BINOP_SUBSCRIPT:
> Sanimir> +      /* In case of a variable length array we need to evaluate the subscript
> Sanimir> +        with side effects to correcly infere the size.  */
> Sanimir> +      val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL);
> Sanimir> +      return value_from_longest (size_type,
> Sanimir> +                                (LONGEST) TYPE_LENGTH (value_type (val)));
> 
> This makes it seem like the problem case is "sizeof (vla[index])".
> But I would have thought it was "sizeof (vla)".
> 
> In any case I think this patch still has the issue, just at one remove.
> Like:
> 
>     (gdb) print sizeof (array[x++])
> 
> For an ordinary array this should not modify x.
> 
> Tom
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


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