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: Remove type prefix for -var-evaluate-expression/functions


> Hi,
> the following patch removes 'type prefix' from output of
> -var-evaluate-expression applied to objects of function type (not pointers
> to functions, but functions).
> 
> It causes no regression in the testsuite for me.

But I guess a new test would help prevent a regression (in the code) in the
future.

> Changelog:
> 
> 2006-03-15 Vladimir Prus <ghost@cs.msu.su>
>         
>         * c-valprint.c 
>          (c_val_print): Don't print type prefix for functions.
>          (c_value_print): Print type prefix for functions here.


> Patch attached.

... 
> +  if (TYPE_CODE (type) == TYPE_CODE_FUNC)

This condition must always be true here (case TYPE_CODE_FUNC:).

> +    {
> +      /* FIXME, we should consider, at least for ANSI C language, eliminating
> +         the distinction made between FUNCs and POINTERs to FUNCs.  */
> +      fprintf_filtered (stream, "{");
> +      type_print (type, "", stream, -1);
> +      fprintf_filtered (stream, "} ");
> +    }
> +
> +
>    if (objectprint && (TYPE_CODE (type) == TYPE_CODE_CLASS))
>      {
>        /* Attempt to determine real type of object */


Where's the patch for c_value_print?


-- 
Nick                                           http://www.inet.net.nz/~nickrob


PS As Jason Molenda suggested to me, if you put "diff -p" in your it will
add the name of the function at the top of each hunk which makes it easier
for others to read.


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