Split size in regset section iterators
[deliverable/binutils-gdb.git] / gdb / tic6x-tdep.c
index de6bc6aa0a529b5704ddf2298e427cdc7d42e29f..b1711bad29339b5c3fea6c18c597088dbc60867b 100644 (file)
@@ -1,6 +1,6 @@
 /* Target dependent code for GDB on TI C6x systems.
 
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2018 Free Software Foundation, Inc.
    Contributed by Andrew Jenner <andrew@codesourcery.com>
    Contributed by Yao Qi <yao@codesourcery.com>
 
@@ -36,7 +36,6 @@
 #include "value.h"
 #include "symfile.h"
 #include "arch-utils.h"
-#include "floatformat.h"
 #include "glibc-tdep.h"
 #include "infcall.h"
 #include "regset.h"
 #include "target-descriptions.h"
 #include <algorithm>
 
-#include "features/tic6x-c64xp.c"
-#include "features/tic6x-c64x.c"
-#include "features/tic6x-c62x.c"
-
 #define TIC6X_OPCODE_SIZE 4
 #define TIC6X_FETCH_PACKET_SIZE 32
 
@@ -346,14 +341,6 @@ tic6x_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
     return tdep->breakpoint;
 }
 
-/* This is the implementation of gdbarch method print_insn.  */
-
-static int
-tic6x_print_insn (bfd_vma memaddr, disassemble_info *info)
-{
-  return print_insn_tic6x (memaddr, info);
-}
-
 static void
 tic6x_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
                             struct dwarf2_frame_state_reg *reg,
@@ -606,7 +593,7 @@ tic6x_extract_signed_field (int value, int low_bit, int bits)
 static CORE_ADDR
 tic6x_get_next_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   unsigned long inst;
   int register_number;
   int last = 0;
@@ -699,15 +686,12 @@ tic6x_get_next_pc (struct regcache *regcache, CORE_ADDR pc)
 
 /* This is the implementation of gdbarch method software_single_step.  */
 
-static VEC (CORE_ADDR) *
+static std::vector<CORE_ADDR>
 tic6x_software_single_step (struct regcache *regcache)
 {
   CORE_ADDR next_pc = tic6x_get_next_pc (regcache, regcache_read_pc (regcache));
-  VEC (CORE_ADDR) *next_pcs = NULL;
 
-  VEC_safe_push (CORE_ADDR, next_pcs, next_pc);
-
-  return next_pcs;
+  return {next_pc};
 }
 
 /* This is the implementation of gdbarch method frame_align.  */
@@ -738,10 +722,9 @@ tic6x_extract_return_value (struct type *valtype, struct regcache *regcache,
         register and the second byte occupies byte 0.
         so, we read the contents in VAL from the LSBs of register.  */
       if (len < 3 && byte_order == BFD_ENDIAN_BIG)
-       regcache_cooked_read_part (regcache, TIC6X_A4_REGNUM, 4 - len, len,
-                                  valbuf);
+       regcache->cooked_read_part (TIC6X_A4_REGNUM, 4 - len, len, valbuf);
       else
-       regcache_cooked_read (regcache, TIC6X_A4_REGNUM, valbuf);
+       regcache->cooked_read (TIC6X_A4_REGNUM, valbuf);
     }
   else if (len <= 8)
     {
@@ -752,13 +735,13 @@ tic6x_extract_return_value (struct type *valtype, struct regcache *regcache,
         lower (even) register.  */
       if (byte_order == BFD_ENDIAN_BIG)
        {
-         regcache_cooked_read (regcache, TIC6X_A4_REGNUM, valbuf + 4);
-         regcache_cooked_read (regcache, TIC6X_A5_REGNUM, valbuf);
+         regcache->cooked_read (TIC6X_A4_REGNUM, valbuf + 4);
+         regcache->cooked_read (TIC6X_A5_REGNUM, valbuf);
        }
       else
        {
-         regcache_cooked_read (regcache, TIC6X_A4_REGNUM, valbuf);
-         regcache_cooked_read (regcache, TIC6X_A5_REGNUM, valbuf + 4);
+         regcache->cooked_read (TIC6X_A4_REGNUM, valbuf);
+         regcache->cooked_read (TIC6X_A5_REGNUM, valbuf + 4);
        }
     }
 }
@@ -777,22 +760,21 @@ tic6x_store_return_value (struct type *valtype, struct regcache *regcache,
   if (len <= 4)
     {
       if (len < 3 && byte_order == BFD_ENDIAN_BIG)
-       regcache_cooked_write_part (regcache, TIC6X_A4_REGNUM, 4 - len, len,
-                                   valbuf);
+       regcache->cooked_write_part (TIC6X_A4_REGNUM, 4 - len, len, valbuf);
       else
-       regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf);
+       regcache->cooked_write (TIC6X_A4_REGNUM, valbuf);
     }
   else if (len <= 8)
     {
       if (byte_order == BFD_ENDIAN_BIG)
        {
-         regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf + 4);
-         regcache_cooked_write (regcache, TIC6X_A5_REGNUM, valbuf);
+         regcache->cooked_write (TIC6X_A4_REGNUM, valbuf + 4);
+         regcache->cooked_write (TIC6X_A5_REGNUM, valbuf);
        }
       else
        {
-         regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf);
-         regcache_cooked_write (regcache, TIC6X_A5_REGNUM, valbuf + 4);
+         regcache->cooked_write (TIC6X_A4_REGNUM, valbuf);
+         regcache->cooked_write (TIC6X_A5_REGNUM, valbuf + 4);
        }
     }
 }
@@ -900,7 +882,6 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   int argnum;
   int stack_offset = 4;
   int references_offset = 4;
-  CORE_ADDR func_addr = find_function_addr (function, NULL);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct type *func_type = value_type (function);
   /* The first arg passed on stack.  Mostly the first 10 args are passed by
@@ -974,10 +955,10 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                     so, we write the contents in VAL to the lsp of
                     register.  */
                  if (len < 3 && byte_order == BFD_ENDIAN_BIG)
-                   regcache_cooked_write_part (regcache, arg_regs[argreg],
-                                               4 - len, len, val);
+                   regcache->cooked_write_part (arg_regs[argreg], 4 - len, len,
+                                                val);
                  else
-                   regcache_cooked_write (regcache, arg_regs[argreg], val);
+                   regcache->cooked_write (arg_regs[argreg], val);
                }
              else
                {
@@ -1004,19 +985,15 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                         padding in the LSBs of the lower (even) register.  */
                      if (byte_order == BFD_ENDIAN_BIG)
                        {
-                         regcache_cooked_write (regcache,
-                                                arg_regs[argreg] + 1, val);
-                         regcache_cooked_write_part (regcache,
-                                                     arg_regs[argreg], 0,
-                                                     len - 4, val + 4);
+                         regcache->cooked_write (arg_regs[argreg] + 1, val);
+                         regcache->cooked_write_part (arg_regs[argreg], 0,
+                                                      len - 4, val + 4);
                        }
                      else
                        {
-                         regcache_cooked_write (regcache, arg_regs[argreg],
-                                                val);
-                         regcache_cooked_write_part (regcache,
-                                                     arg_regs[argreg] + 1, 0,
-                                                     len - 4, val + 4);
+                         regcache->cooked_write (arg_regs[argreg], val);
+                         regcache->cooked_write_part (arg_regs[argreg] + 1, 0,
+                                                      len - 4, val + 4);
                        }
                    }
                  else
@@ -1321,8 +1298,6 @@ tic6x_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Single stepping.  */
   set_gdbarch_software_single_step (gdbarch, tic6x_software_single_step);
 
-  set_gdbarch_print_insn (gdbarch, tic6x_print_insn);
-
   /* Call dummy code.  */
   set_gdbarch_frame_align (gdbarch, tic6x_frame_align);
 
@@ -1349,15 +1324,8 @@ tic6x_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   return gdbarch;
 }
 
-/* -Wmissing-prototypes */
-extern initialize_file_ftype _initialize_tic6x_tdep;
-
 void
 _initialize_tic6x_tdep (void)
 {
   register_gdbarch_init (bfd_arch_tic6x, tic6x_gdbarch_init);
-
-  initialize_tdesc_tic6x_c64xp ();
-  initialize_tdesc_tic6x_c64x ();
-  initialize_tdesc_tic6x_c62x ();
 }
This page took 0.028819 seconds and 4 git commands to generate.