public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] gdb: make add_dyn_prop a method of struct type
Date: Sat, 23 May 2020 14:54:17 -0400	[thread overview]
Message-ID: <5c54719c22b14f526e72be39a793657ac73d36c5@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 5c54719c22b14f526e72be39a793657ac73d36c5 ***

commit 5c54719c22b14f526e72be39a793657ac73d36c5
Author:     Simon Marchi <simon.marchi@efficios.com>
AuthorDate: Thu May 7 11:17:33 2020 -0400
Commit:     Simon Marchi <simon.marchi@efficios.com>
CommitDate: Thu May 7 11:32:29 2020 -0400

    gdb: make add_dyn_prop a method of struct type
    
    Move add_dyn_prop, currently a free function, to be a method of struct
    type.
    
    gdb/ChangeLog:
    
            * gdbtypes.h (struct type) <add_dyn_prop>: New method.
            (add_dyn_prop): Remove.  Update all users to use
            type::add_dyn_prop.
            * gdbtypes.c (add_dyn_prop): Rename to...
            (type::add_dyn_prop): ... this.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e295fd1d65..857897f8f8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2020-05-07  Simon Marchi via Gdb-patches  <gdb-patches@sourceware.org>
+
+	* gdbtypes.h (struct type) <add_dyn_prop>: New method.
+	(add_dyn_prop): Remove.  Update all users to use
+	type::add_dyn_prop.
+	* gdbtypes.c (add_dyn_prop): Rename to...
+	(type::add_dyn_prop): ... this.
+
 2020-05-07  Simon Marchi  <simon.marchi@efficios.com>
 
 	* gdbtypes.h (struct type) <get_dyn_prop>: New method.
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 1813085d0d..ac208991ff 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -9218,7 +9218,7 @@ alloc_rust_variant (struct obstack *obstack, struct type *type,
   prop.kind = PROP_VARIANT_PARTS;
   prop.data.variant_parts = prop_value;
 
-  add_dyn_prop (DYN_PROP_VARIANT_PARTS, prop, type);
+  type->add_dyn_prop (DYN_PROP_VARIANT_PARTS, prop);
 }
 
 /* Some versions of rustc emitted enums in an unusual way.
@@ -14706,7 +14706,7 @@ add_variant_property (struct field_info *fip, struct type *type,
     = ((gdb::array_view<variant_part> *)
        obstack_copy (&objfile->objfile_obstack, &parts, sizeof (parts)));
 
-  add_dyn_prop (DYN_PROP_VARIANT_PARTS, prop, type);
+  type->add_dyn_prop (DYN_PROP_VARIANT_PARTS, prop);
 }
 
 /* Create the vector of fields, and attach it to the type.  */
@@ -15355,7 +15355,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
 	  struct dynamic_prop prop;
 	  if (attr_to_dynamic_prop (attr, die, cu, &prop,
 				    cu->per_cu->addr_type ()))
-	    add_dyn_prop (DYN_PROP_BYTE_SIZE, prop, type);
+	    type->add_dyn_prop (DYN_PROP_BYTE_SIZE, prop);
           TYPE_LENGTH (type) = 0;
 	}
     }
@@ -23605,7 +23605,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
     {
       struct type *prop_type = cu->per_cu->addr_sized_int_type (false);
       if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
-        add_dyn_prop (DYN_PROP_ALLOCATED, prop, type);
+        type->add_dyn_prop (DYN_PROP_ALLOCATED, prop);
     }
   else if (attr != NULL)
     {
@@ -23620,7 +23620,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
     {
       struct type *prop_type = cu->per_cu->addr_sized_int_type (false);
       if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
-        add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type);
+        type->add_dyn_prop (DYN_PROP_ASSOCIATED, prop);
     }
   else if (attr != NULL)
     {
@@ -23633,7 +23633,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
   attr = dwarf2_attr (die, DW_AT_data_location, cu);
   if (attr_to_dynamic_prop (attr, die, cu, &prop,
 			    cu->per_cu->addr_type ()))
-    add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type);
+    type->add_dyn_prop (DYN_PROP_DATA_LOCATION, prop);
 
   if (dwarf2_per_objfile->die_type_hash == NULL)
     dwarf2_per_objfile->die_type_hash
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 715db0772b..1444351c51 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1286,7 +1286,7 @@ create_array_type_with_stride (struct type *result_type,
     (struct field *) TYPE_ZALLOC (result_type, sizeof (struct field));
   TYPE_INDEX_TYPE (result_type) = range_type;
   if (byte_stride_prop != NULL)
-    add_dyn_prop (DYN_PROP_BYTE_STRIDE, *byte_stride_prop, result_type);
+    result_type->add_dyn_prop (DYN_PROP_BYTE_STRIDE, *byte_stride_prop);
   else if (bit_stride > 0)
     TYPE_FIELD_BITSIZE (result_type, 0) = bit_stride;
 
@@ -2668,20 +2668,19 @@ type::dyn_prop (dynamic_prop_node_kind prop_kind) const
 /* See gdbtypes.h  */
 
 void
-add_dyn_prop (enum dynamic_prop_node_kind prop_kind, struct dynamic_prop prop,
-              struct type *type)
+type::add_dyn_prop (dynamic_prop_node_kind prop_kind, dynamic_prop prop)
 {
   struct dynamic_prop_list *temp;
 
-  gdb_assert (TYPE_OBJFILE_OWNED (type));
+  gdb_assert (TYPE_OBJFILE_OWNED (this));
 
-  temp = XOBNEW (&TYPE_OBJFILE (type)->objfile_obstack,
+  temp = XOBNEW (&TYPE_OBJFILE (this)->objfile_obstack,
 		 struct dynamic_prop_list);
   temp->prop_kind = prop_kind;
   temp->prop = prop;
-  temp->next = TYPE_DYN_PROP_LIST (type);
+  temp->next = TYPE_DYN_PROP_LIST (this);
 
-  TYPE_DYN_PROP_LIST (type) = temp;
+  TYPE_DYN_PROP_LIST (this) = temp;
 }
 
 /* Remove dynamic property from TYPE in case it exists.  */
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 2845b71906..ef991f3c8d 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -878,6 +878,12 @@ struct type
      list of dynamic properties.  */
   dynamic_prop *dyn_prop (dynamic_prop_node_kind kind) const;
 
+  /* * Given a dynamic property PROP of a given KIND, add this dynamic
+     property to this type.
+
+     This function assumes that this type is objfile-owned.  */
+  void add_dyn_prop (dynamic_prop_node_kind kind, dynamic_prop prop);
+
   /* * Type that is a pointer to this type.
      NULL if no such pointer-to type is known yet.
      The debugger may add the address of such a type
@@ -2097,14 +2103,6 @@ extern struct type *resolve_dynamic_type
 /* * Predicate if the type has dynamic values, which are not resolved yet.  */
 extern int is_dynamic_type (struct type *type);
 
-/* * Given a dynamic property PROP of a given KIND, add this dynamic
-   property to the given TYPE.
-
-   This function assumes that TYPE is objfile-owned.  */
-extern void add_dyn_prop
-  (enum dynamic_prop_node_kind kind, struct dynamic_prop prop,
-   struct type *type);
-
 extern void remove_dyn_prop (enum dynamic_prop_node_kind prop_kind,
                              struct type *type);
 


             reply	other threads:[~2020-05-23 18:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 18:54 gdb-buildbot [this message]
2020-05-23 18:54 ` Failures on Fedora-i686, branch master gdb-buildbot
2020-05-23 19:03 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot
2020-05-23 19:28 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2020-05-23 19:37 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2020-05-23 20:12 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2020-05-23 20:21 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2020-05-23 22:24 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c54719c22b14f526e72be39a793657ac73d36c5@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).