gdb: don't require displaced step copy_insn to be implemented in prepare/finish are
[deliverable/binutils-gdb.git] / gdb / nds32-tdep.c
index d3481e2000bb78d52bad6fecf54d901a3c42a38c..d403b71f10b0e9c4ff17f9dfbc2df0ce7485995f 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for the NDS32 architecture, for GDB.
 
-   Copyright (C) 2013-2019 Free Software Foundation, Inc.
+   Copyright (C) 2013-2020 Free Software Foundation, Inc.
    Contributed by Andes Technology Corporation.
 
    This file is part of GDB.
@@ -34,7 +34,7 @@
 #include "dis-asm.h"
 #include "user-regs.h"
 #include "elf-bfd.h"
-#include "dwarf2-frame.h"
+#include "dwarf2/frame.h"
 #include "remote.h"
 #include "target-descriptions.h"
 
@@ -1387,32 +1387,7 @@ static const struct frame_unwind nds32_epilogue_frame_unwind =
   NULL,
   nds32_epilogue_frame_sniffer
 };
-\f
-/* Implement the "dummy_id" gdbarch method.  */
-
-static struct frame_id
-nds32_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
-{
-  CORE_ADDR sp = get_frame_register_unsigned (this_frame, NDS32_SP_REGNUM);
-
-  return frame_id_build (sp, get_frame_pc (this_frame));
-}
-
-/* Implement the "unwind_pc" gdbarch method.  */
-
-static CORE_ADDR
-nds32_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, NDS32_PC_REGNUM);
-}
-
-/* Implement the "unwind_sp" gdbarch method.  */
 
-static CORE_ADDR
-nds32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
-{
-  return frame_unwind_register_unsigned (next_frame, NDS32_SP_REGNUM);
-}
 \f
 /* Floating type and struct type that has only one floating type member
    can pass value using FPU registers (when FPU ABI is used).  */
@@ -1427,10 +1402,10 @@ nds32_check_calling_use_fpr (struct type *type)
   while (1)
     {
       t = check_typedef (t);
-      typecode = TYPE_CODE (t);
+      typecode = t->code ();
       if (typecode != TYPE_CODE_STRUCT)
        break;
-      else if (TYPE_NFIELDS (t) != 1)
+      else if (t->num_fields () != 1)
        return 0;
       else
        t = TYPE_FIELD_TYPE (t, 0);
@@ -1521,7 +1496,7 @@ nds32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
         and pushes all unnamed arguments in stack.  */
 
       if (abi_use_fpr && TYPE_VARARGS (func_type)
-         && i >= TYPE_NFIELDS (func_type))
+         && i >= func_type->num_fields ())
        goto use_stack;
 
       /* Try to use FPRs to pass arguments only when
@@ -2094,14 +2069,11 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_sp_regnum (gdbarch, NDS32_SP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, NDS32_PC_REGNUM);
-  set_gdbarch_unwind_sp (gdbarch, nds32_unwind_sp);
-  set_gdbarch_unwind_pc (gdbarch, nds32_unwind_pc);
   set_gdbarch_stack_frame_destroyed_p (gdbarch, nds32_stack_frame_destroyed_p);
   set_gdbarch_dwarf2_reg_to_regnum (gdbarch, nds32_dwarf2_reg_to_regnum);
 
   set_gdbarch_push_dummy_call (gdbarch, nds32_push_dummy_call);
   set_gdbarch_return_value (gdbarch, nds32_return_value);
-  set_gdbarch_dummy_id (gdbarch, nds32_dummy_id);
 
   set_gdbarch_skip_prologue (gdbarch, nds32_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -2124,8 +2096,9 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   return gdbarch;
 }
 
+void _initialize_nds32_tdep ();
 void
-_initialize_nds32_tdep (void)
+_initialize_nds32_tdep ()
 {
   /* Initialize gdbarch.  */
   register_gdbarch_init (bfd_arch_nds32, nds32_gdbarch_init);
This page took 0.025834 seconds and 4 git commands to generate.