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: [RFA 1/3] Use function_name_style to print Ada and C function names


On Sat, 2019-01-12 at 09:22 -0700, Tom Tromey wrote:
> > > > > > "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
> 
> Philippe> 	* ada-typeprint.c (print_func_type): Print function name
> Philippe> 	style to print function name.
> Philippe> 	* c-typeprint.c (c_print_type_1): Likewise.
> 
> These are printing type names, not function names -- so I wonder whether
> we want to apply the function name styling here.
> 
> Any comments on this aspect?  I am not sure myself.
ada-typeprint.c:print_func_type is only called to print types that are
functions.  So, that effectively prints a function name.

c-typeprint.c (c_print_type_1) is effectively called to print whatever
type (so not only functions), but the following added condition
should ensure function name style is only used for function names:
-      fputs_filtered (varstring, stream);
+      if (code == TYPE_CODE_FUNC || code == TYPE_CODE_METHOD)
+       fputs_styled (varstring, function_name_style.style (), stream );
+      else
+       fputs_filtered (varstring, stream);

> 
> On the one hand, it isn't a function name; maybe we would like a type
> style, but then maybe a type style would be too noisy somehow?
> 
> On the other hand, maybe calling out function type names looks nicer.
> 
> Philippe> +	fputs_styled (varstring, function_name_style.style (), stream );
> 
> Extra space before the close paren.
I will fix this, once/if a go to push ...

Thanks

Philippe


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