forked from Imagelibrary/binutils-gdb
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:
@@ -1,3 +1,9 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
2019-02-11 Alan Hayward <alan.hayward@arm.com>
|
2019-02-11 Alan Hayward <alan.hayward@arm.com>
|
||||||
|
|
||||||
* aarch64-linux-tdep.c (aarch64_linux_get_syscall_number): Check
|
* aarch64-linux-tdep.c (aarch64_linux_get_syscall_number): Check
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "demangle.h"
|
#include "demangle.h"
|
||||||
#include "c-lang.h"
|
#include "c-lang.h"
|
||||||
|
#include "cli/cli-style.h"
|
||||||
#include "typeprint.h"
|
#include "typeprint.h"
|
||||||
#include "target-float.h"
|
#include "target-float.h"
|
||||||
#include "ada-lang.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");
|
fprintf_filtered (stream, "function");
|
||||||
|
|
||||||
if (name != NULL && name[0] != '\0')
|
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)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include "language.h"
|
#include "language.h"
|
||||||
#include "demangle.h"
|
#include "demangle.h"
|
||||||
#include "c-lang.h"
|
#include "c-lang.h"
|
||||||
|
#include "cli/cli-style.h"
|
||||||
#include "typeprint.h"
|
#include "typeprint.h"
|
||||||
#include "cp-abi.h"
|
#include "cp-abi.h"
|
||||||
#include "cp-support.h"
|
#include "cp-support.h"
|
||||||
@@ -115,6 +116,7 @@ c_print_type_1 (struct type *type,
|
|||||||
type = check_typedef (type);
|
type = check_typedef (type);
|
||||||
|
|
||||||
local_name = typedef_hash_table::find_typedef (flags, type);
|
local_name = typedef_hash_table::find_typedef (flags, type);
|
||||||
|
code = TYPE_CODE (type);
|
||||||
if (local_name != NULL)
|
if (local_name != NULL)
|
||||||
{
|
{
|
||||||
fputs_filtered (local_name, stream);
|
fputs_filtered (local_name, stream);
|
||||||
@@ -124,7 +126,6 @@ c_print_type_1 (struct type *type,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
c_type_print_base_1 (type, stream, show, level, language, flags, podata);
|
c_type_print_base_1 (type, stream, show, level, language, flags, podata);
|
||||||
code = TYPE_CODE (type);
|
|
||||||
if ((varstring != NULL && *varstring != '\0')
|
if ((varstring != NULL && *varstring != '\0')
|
||||||
/* Need a space if going to print stars or brackets;
|
/* Need a space if going to print stars or brackets;
|
||||||
but not if we will print just a type name. */
|
but not if we will print just a type name. */
|
||||||
@@ -144,6 +145,9 @@ c_print_type_1 (struct type *type,
|
|||||||
|
|
||||||
if (varstring != NULL)
|
if (varstring != NULL)
|
||||||
{
|
{
|
||||||
|
if (code == TYPE_CODE_FUNC || code == TYPE_CODE_METHOD)
|
||||||
|
fputs_styled (varstring, function_name_style.style (), stream);
|
||||||
|
else
|
||||||
fputs_filtered (varstring, stream);
|
fputs_filtered (varstring, stream);
|
||||||
|
|
||||||
/* For demangled function names, we have the arglist as part of
|
/* For demangled function names, we have the arglist as part of
|
||||||
|
|||||||
Reference in New Issue
Block a user