Use function_name_style to print Ada and C function names

Note that ada-typeprint.c print_func_type is called with
types representing functions and is also called to print
a function NAME together with its type.  In such a case, the function
name will be printed using function name style.

Similarly, c_print_type_1 is called to print a type, optionally
with the name of an object of this type in the VARSTRING arg.
So, c_print_type_1 uses function name style to print varstring
when the type code indicates that c_print_type_1 TYPE is some
'real code'.

gdb/ChangeLog
2019-02-12  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* ada-typeprint.c (print_func_type): Print function name
	style to print function name.
	* c-typeprint.c (c_print_type_1): Likewise.
This commit is contained in:
Philippe Waroquiers 2019-01-10 22:31:07 +01:00
parent e486594504
commit ac8c53cc67
3 changed files with 17 additions and 3 deletions

View file

@ -30,6 +30,7 @@
#include "language.h"
#include "demangle.h"
#include "c-lang.h"
#include "cli/cli-style.h"
#include "typeprint.h"
#include "target-float.h"
#include "ada-lang.h"
@ -779,7 +780,10 @@ print_func_type (struct type *type, struct ui_file *stream, const char *name,
fprintf_filtered (stream, "function");
if (name != NULL && name[0] != '\0')
fprintf_filtered (stream, " %s", name);
{
fputs_filtered (" ", stream);
fputs_styled (name, function_name_style.style (), stream);
}
if (len > 0)
{