summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-09-14 11:08:06 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-09-14 11:08:06 -0400
commit0becda7a5a1845c7e91ccba1b27da3607de3f534 (patch)
tree8b1e4adc8efbc2519504ae34b664406bab7d1c25
parent03cc72491b8139cffaf2c6ce9db84ebc17205323 (diff)
downloadbinutils-gdb-0becda7a5a1845c7e91ccba1b27da3607de3f534.tar.gz
gdb: remove TYPE_GNU_IFUNC
gdb/ChangeLog: * gdbtypes.h (TYPE_GNU_IFUNC): Remove, replace all uses with type::is_gnu_ifunc. Change-Id: I72aae22599b5e582910c5d50588feaf159032bd8
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/compile/compile-c-symbols.c4
-rw-r--r--gdb/compile/compile-cplus-symbols.c4
-rw-r--r--gdb/eval.c4
-rw-r--r--gdb/gdbtypes.h12
-rw-r--r--gdb/infcall.c2
6 files changed, 17 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0c78d2aed3b..eba28b86ce4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2020-09-14 Simon Marchi <simon.marchi@efficios.com>
+ * gdbtypes.h (TYPE_GNU_IFUNC): Remove, replace all
+ uses with type::is_gnu_ifunc.
+
+2020-09-14 Simon Marchi <simon.marchi@efficios.com>
+
* gdbtypes.h (struct type) <is_gnu_ifunc, set_is_gnu_ifunc>: New methods.
(TYPE_GNU_IFUNC): Use type::is_gnu_ifunc, change all write call sites to
use type::set_is_gnu_ifunc.
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;