[patch] initial OpenCL C language support

Ken Werner ken@linux.vnet.ibm.com
Tue Oct 26 13:05:00 GMT 2010


On Tuesday, October 26, 2010 12:45:58 am Tom Tromey wrote:
> >>>>> "Ken" == Ken Werner <ken@linux.vnet.ibm.com> writes:
> Ken> This patch implements initial GDB support for the OpenCL C
> Ken> Programming Language. Since OpenCL is based on C99 I tried to reuse
> Ken> GDBs C infrastructure where possible (expression parser, printing
> Ken> routines, etc).
> 
> I have been skimming this patch a bit and I think it is very good.
> 
> I don't have time to fully review it right now, as I'm at the GCC
> Summit.

Thanks for having a look at the patch.
Have fun on the summit! : )

> > But I did notice one thing:
> 
> Ken> +/* Expression evaluator for the OpenCL.  Most operations are
> delegated to Ken> +   evaluate_subexp_standard; see that function for a
> description of the Ken> +   arguments.  */
> Ken> +static struct value *
> Ken> +evaluate_subexp_opencl (struct type *expect_type, struct expression
> *exp, Ken> +		   int *pos, enum noside noside)
> [...]
> Ken> +  return evaluate_subexp_standard (expect_type, exp, pos, noside);
> 
> I think this ought to call the C-specific evaluate_subexp_c.
> You'll need to at least make this non-static, maybe even rename it.
> 
> I believe that without this some forms of string constants will not work
> properly.

My understanding is that the only additional functionality of 
evaluate_subexp_c is to provide wide character support which is not available 
in OpenCL C. Of course calling evaluate_subexp_c won't hurt since 
evaluate_subexp_standard gets called in most cases but I don't see where the 
OpenCL support could benefit from doing so. Do you have an example?

Regards
Ken



More information about the Gdb-patches mailing list