gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / sparc64-tdep.c
index ac915d468fd353167a557d120cd0cbe81bb2265c..5d6ef071099fe5ef97c35c22ca2d8e16919d521f 100644 (file)
@@ -86,7 +86,7 @@
 static struct cmd_list_element *sparc64adilist = NULL;
 
 /* ADI stat settings.  */
-typedef struct
+struct adi_stat_t
 {
   /* The ADI block size.  */
   unsigned long blksize;
@@ -108,11 +108,11 @@ typedef struct
   /* ADI is available.  */
   bool is_avail = false;
 
-} adi_stat_t;
+};
 
 /* Per-process ADI stat info.  */
 
-typedef struct sparc64_adi_info
+struct sparc64_adi_info
 {
   sparc64_adi_info (pid_t pid_)
     : pid (pid_)
@@ -124,7 +124,7 @@ typedef struct sparc64_adi_info
   /* The ADI stat.  */
   adi_stat_t stat = {};
 
-} sparc64_adi_info;
+};
 
 static std::forward_list<sparc64_adi_info> adi_proc_list;
 
@@ -186,14 +186,6 @@ sparc64_forget_process (pid_t pid)
 
 }
 
-static void
-info_adi_command (const char *args, int from_tty)
-{
-  printf_unfiltered ("\"adi\" must be followed by \"examine\" "
-                     "or \"assign\".\n");
-  help_list (sparc64adilist, "adi ", all_commands, gdb_stdout);
-}
-
 /* Read attributes of a maps entry in /proc/[pid]/adi/maps.  */
 
 static void
@@ -295,7 +287,7 @@ adi_tag_fd (void)
   snprintf (cl_name, sizeof(cl_name), "/proc/%ld/adi/tags", (long) pid);
   int target_errno;
   proc->stat.tag_fd = target_fileio_open (NULL, cl_name, O_RDWR|O_EXCL, 
-                                          0, &target_errno);
+                                          false, 0, &target_errno);
   return proc->stat.tag_fd;
 }
 
@@ -538,10 +530,9 @@ void _initialize_sparc64_adi_tdep ();
 void
 _initialize_sparc64_adi_tdep ()
 {
-
-  add_prefix_cmd ("adi", class_support, info_adi_command,
-                  _("ADI version related commands."),
-                  &sparc64adilist, "adi ", 0, &cmdlist);
+  add_basic_prefix_cmd ("adi", class_support,
+                       _("ADI version related commands."),
+                       &sparc64adilist, "adi ", 0, &cmdlist);
   add_cmd ("examine", class_support, adi_examine_command,
            _("Examine ADI versions."), &sparc64adilist);
   add_alias_cmd ("x", "examine", no_class, 1, &sparc64adilist);
@@ -559,7 +550,7 @@ _initialize_sparc64_adi_tdep ()
 static int
 sparc64_integral_or_pointer_p (const struct type *type)
 {
-  switch (TYPE_CODE (type))
+  switch (type->code ())
     {
     case TYPE_CODE_INT:
     case TYPE_CODE_BOOL:
@@ -591,7 +582,7 @@ sparc64_integral_or_pointer_p (const struct type *type)
 static int
 sparc64_floating_p (const struct type *type)
 {
-  switch (TYPE_CODE (type))
+  switch (type->code ())
     {
     case TYPE_CODE_FLT:
       {
@@ -611,7 +602,7 @@ sparc64_floating_p (const struct type *type)
 static int
 sparc64_complex_floating_p (const struct type *type)
 {
-  switch (TYPE_CODE (type))
+  switch (type->code ())
     {
     case TYPE_CODE_COMPLEX:
       {
@@ -635,7 +626,7 @@ sparc64_complex_floating_p (const struct type *type)
 static int
 sparc64_structure_or_union_p (const struct type *type)
 {
-  switch (TYPE_CODE (type))
+  switch (type->code ())
     {
     case TYPE_CODE_STRUCT:
     case TYPE_CODE_UNION:
@@ -1174,7 +1165,7 @@ static const struct frame_base sparc64_frame_base =
 static int
 sparc64_16_byte_align_p (struct type *type)
 {
-  if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+  if (type->code () == TYPE_CODE_ARRAY)
     {
       struct type *t = check_typedef (TYPE_TARGET_TYPE (type));
 
@@ -1188,7 +1179,7 @@ sparc64_16_byte_align_p (struct type *type)
     {
       int i;
 
-      for (i = 0; i < TYPE_NFIELDS (type); i++)
+      for (i = 0; i < type->num_fields (); i++)
        {
          struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
 
@@ -1215,7 +1206,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
 
   gdb_assert (element < 16);
 
-  if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+  if (type->code () == TYPE_CODE_ARRAY)
     {
       gdb_byte buf[8];
       int regnum = SPARC_F0_REGNUM + element * 2 + bitpos / 32;
@@ -1265,7 +1256,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
     {
       int i;
 
-      for (i = 0; i < TYPE_NFIELDS (type); i++)
+      for (i = 0; i < type->num_fields (); i++)
        {
          struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
          int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
@@ -1283,7 +1274,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
          probably in older releases to.  To appease GCC, if a
          structure has only a single `float' member, we store its
          value in %f1 too (we already have stored in %f0).  */
-      if (TYPE_NFIELDS (type) == 1)
+      if (type->num_fields () == 1)
        {
          struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, 0));
 
@@ -1304,7 +1295,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
 {
   struct gdbarch *gdbarch = regcache->arch ();
 
-  if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+  if (type->code () == TYPE_CODE_ARRAY)
     {
       int len = TYPE_LENGTH (type);
       int regnum =  SPARC_F0_REGNUM + bitpos / 32;
@@ -1353,7 +1344,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
     {
       int i;
 
-      for (i = 0; i < TYPE_NFIELDS (type); i++)
+      for (i = 0; i < type->num_fields (); i++)
        {
          struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
          int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
@@ -1665,7 +1656,7 @@ sparc64_extract_return_value (struct type *type, struct regcache *regcache,
 
       for (i = 0; i < ((len + 7) / 8); i++)
        regcache->cooked_read (SPARC_O0_REGNUM + i, buf + i * 8);
-      if (TYPE_CODE (type) != TYPE_CODE_UNION)
+      if (type->code () != TYPE_CODE_UNION)
        sparc64_extract_floating_fields (regcache, type, buf, 0);
       memcpy (valbuf, buf, len);
     }
@@ -1676,7 +1667,7 @@ sparc64_extract_return_value (struct type *type, struct regcache *regcache,
        regcache->cooked_read (SPARC_F0_REGNUM + i, buf + i * 4);
       memcpy (valbuf, buf, len);
     }
-  else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+  else if (type->code () == TYPE_CODE_ARRAY)
     {
       /* Small arrays are returned the same way as small structures.  */
       gdb_assert (len <= 32);
@@ -1720,7 +1711,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache,
       memcpy (buf, valbuf, len);
       for (i = 0; i < ((len + 7) / 8); i++)
        regcache->cooked_write (SPARC_O0_REGNUM + i, buf + i * 8);
-      if (TYPE_CODE (type) != TYPE_CODE_UNION)
+      if (type->code () != TYPE_CODE_UNION)
        sparc64_store_floating_fields (regcache, type, buf, 0, 0);
     }
   else if (sparc64_floating_p (type) || sparc64_complex_floating_p (type))
@@ -1730,7 +1721,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache,
       for (i = 0; i < len / 4; i++)
        regcache->cooked_write (SPARC_F0_REGNUM + i, buf + i * 4);
     }
-  else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+  else if (type->code () == TYPE_CODE_ARRAY)
     {
       /* Small arrays are returned the same way as small structures.  */
       gdb_assert (len <= 32);
This page took 0.028416 seconds and 4 git commands to generate.