[PATCH 18/22] gdb: remove TYPE_GNU_IFUNC

Simon Marchi simon.marchi@efficios.com
Tue Aug 18 16:58:37 GMT 2020


gdb/ChangeLog:

	* gdbtypes.h (TYPE_GNU_IFUNC): Remove, replace all
	uses with type::is_gnu_ifunc.

Change-Id: I72aae22599b5e582910c5d50588feaf159032bd8
---
 gdb/compile/compile-c-symbols.c     |  4 ++--
 gdb/compile/compile-cplus-symbols.c |  4 ++--
 gdb/eval.c                          |  4 ++--
 gdb/gdbtypes.h                      | 12 +++++-------
 gdb/infcall.c                       |  2 +-
 5 files changed, 12 insertions(+), 14 deletions(-)

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 e25b06f0d88..6330d3c8588 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 5534b5bf2fb..499a2d90334 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;
 
-- 
2.28.0



More information about the Gdb-patches mailing list