From: Simon Marchi Date: Mon, 14 Sep 2020 15:08:06 +0000 (-0400) Subject: gdb: remove TYPE_GNU_IFUNC X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0becda7a5a1845c7e91ccba1b27da3607de3f534;p=binutils-gdb.git gdb: remove TYPE_GNU_IFUNC gdb/ChangeLog: * gdbtypes.h (TYPE_GNU_IFUNC): Remove, replace all uses with type::is_gnu_ifunc. Change-Id: I72aae22599b5e582910c5d50588feaf159032bd8 --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c78d2aed3b..eba28b86ce4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-09-14 Simon Marchi + + * gdbtypes.h (TYPE_GNU_IFUNC): Remove, replace all + uses with type::is_gnu_ifunc. + 2020-09-14 Simon Marchi * gdbtypes.h (struct type) : New methods. diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c index f4e0783d4b8..6d455fe6b9a 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -94,7 +94,7 @@ convert_one_symbol (compile_c_instance *context, case LOC_BLOCK: kind = GCC_C_SYMBOL_FUNCTION; addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol)); - if (is_global && TYPE_GNU_IFUNC (SYMBOL_TYPE (sym.symbol))) + if (is_global && SYMBOL_TYPE (sym.symbol)->is_gnu_ifunc ()) addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr); break; @@ -405,7 +405,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context, "gcc_symbol_address \"%s\": full symbol\n", identifier); result = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym)); - if (TYPE_GNU_IFUNC (SYMBOL_TYPE (sym))) + if (SYMBOL_TYPE (sym)->is_gnu_ifunc ()) result = gnu_ifunc_resolve_addr (target_gdbarch (), result); found = 1; } diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c index 11a2d323458..1998584791d 100644 --- a/gdb/compile/compile-cplus-symbols.c +++ b/gdb/compile/compile-cplus-symbols.c @@ -88,7 +88,7 @@ convert_one_symbol (compile_cplus_instance *instance, { kind = GCC_CP_SYMBOL_FUNCTION; addr = BLOCK_START (SYMBOL_BLOCK_VALUE (sym.symbol)); - if (is_global && TYPE_GNU_IFUNC (SYMBOL_TYPE (sym.symbol))) + if (is_global && SYMBOL_TYPE (sym.symbol)->is_gnu_ifunc ()) addr = gnu_ifunc_resolve_addr (target_gdbarch (), addr); } break; @@ -442,7 +442,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context, "gcc_symbol_address \"%s\": full symbol\n", identifier); result = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)); - if (TYPE_GNU_IFUNC (SYMBOL_TYPE (sym))) + if (SYMBOL_TYPE (sym)->is_gnu_ifunc ()) result = gnu_ifunc_resolve_addr (target_gdbarch (), result); found = 1; } diff --git a/gdb/eval.c b/gdb/eval.c index 2d271981626..e5e88f3c9bf 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -735,7 +735,7 @@ evaluate_var_msym_value (enum noside noside, CORE_ADDR address; type *the_type = find_minsym_type_and_address (msymbol, objfile, &address); - if (noside == EVAL_AVOID_SIDE_EFFECTS && !TYPE_GNU_IFUNC (the_type)) + if (noside == EVAL_AVOID_SIDE_EFFECTS && !the_type->is_gnu_ifunc ()) return value_zero (the_type, not_lval); else return value_at_lazy (the_type, address); @@ -793,7 +793,7 @@ eval_call (expression *exp, enum noside noside, else if (ftype->code () == TYPE_CODE_FUNC || ftype->code () == TYPE_CODE_METHOD) { - if (TYPE_GNU_IFUNC (ftype)) + if (ftype->is_gnu_ifunc ()) { CORE_ADDR address = value_address (argvec[0]); type *resolved_type = find_gnu_ifunc_target_type (address); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 4a2dc2a0794..f72f711bdab 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -233,13 +233,6 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags); #define TYPE_NOTTEXT(t) (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_NOTTEXT) -/* * Used only for TYPE_CODE_FUNC where it specifies the real function - address is returned by this function call. TYPE_TARGET_TYPE - determines the final returned function type to be presented to - user. */ - -#define TYPE_GNU_IFUNC(t) ((t)->is_gnu_ifunc ()) - /* * Type owner. If TYPE_OBJFILE_OWNED is true, the type is owned by the objfile retrieved as TYPE_OBJFILE. Otherwise, the type is owned by an architecture; TYPE_OBJFILE is NULL in this case. */ @@ -1133,6 +1126,11 @@ struct type this->main_type->m_flag_stub_supported = stub_is_supported; } + /* Used only for TYPE_CODE_FUNC where it specifies the real function + address is returned by this function call. TYPE_TARGET_TYPE + determines the final returned function type to be presented to + user. */ + bool is_gnu_ifunc () const { return this->main_type->m_flag_gnu_ifunc; diff --git a/gdb/infcall.c b/gdb/infcall.c index 9539d381428..f87b7456ec0 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -275,7 +275,7 @@ find_function_addr (struct value *function, if (ftype->code () == TYPE_CODE_FUNC || ftype->code () == TYPE_CODE_METHOD) { - if (TYPE_GNU_IFUNC (ftype)) + if (ftype->is_gnu_ifunc ()) { CORE_ADDR resolver_addr = funaddr;