gdb: ensure the cast in gdbarch_tdep is valid
[binutils-gdb.git] / gdb / x86-tdep.c
index 96a70d73158e8bb3367fbd639b31e1cde0b84013..fb6656a1f85b1d433972a280222f5f883db2d0db 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for X86-based targets.
 
-   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   Copyright (C) 2018-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 
 #include "defs.h"
 #include "x86-tdep.h"
+#include "symtab.h"
 
 
 /* Check whether NAME is included in NAMES[LO] (inclusive) to NAMES[HI]
    (exclusive).  */
 
 static bool
-x86_is_thunk_register_name (const char *name, const char **names, int lo,
-                           int hi)
+x86_is_thunk_register_name (const char *name, const char * const *names,
+                           int lo, int hi)
 {
   int reg;
   for (reg = lo; reg < hi; ++reg)
@@ -39,14 +40,14 @@ x86_is_thunk_register_name (const char *name, const char **names, int lo,
 /* See x86-tdep.h.  */
 
 bool
-x86_in_indirect_branch_thunk (CORE_ADDR pc, const char **register_names,
+x86_in_indirect_branch_thunk (CORE_ADDR pc, const char * const *register_names,
                              int lo, int hi)
 {
   struct bound_minimal_symbol bmfun = lookup_minimal_symbol_by_pc (pc);
   if (bmfun.minsym == nullptr)
     return false;
 
-  const char *name = MSYMBOL_LINKAGE_NAME (bmfun.minsym);
+  const char *name = bmfun.minsym->linkage_name ();
   if (name == nullptr)
     return false;