[3/3] gdb: remove TYPE_DYN_PROP_ADDR

Message ID 20200801235935.1110640-4-simon.marchi@polymtl.ca
State New
Headers show
Series
  • Remove last dynamic prop macros
Related show

Commit Message

Eli Zaretskii via Gdb-patches Aug. 1, 2020, 11:59 p.m.
Remove TYPE_DYN_PROP_ADDR, replacing its uses with calling
dynamic_prop::const_val directly.

gdb/ChangeLog:

	* gdbtypes.h (TYPE_DYN_PROP_ADDR): Remove, replace uses with
	dynamic_prop::const_val.

Change-Id: Ie99b9cd9a0627488c1c69a75e57f020d34e392af
---
 gdb/gdbtypes.c | 4 ++--
 gdb/gdbtypes.h | 4 ----
 2 files changed, 2 insertions(+), 6 deletions(-)

-- 
2.28.0

Comments

Tom de Vries Aug. 5, 2020, 9:20 a.m. | #1
On 8/2/20 1:59 AM, Simon Marchi via Gdb-patches wrote:
> Remove TYPE_DYN_PROP_ADDR, replacing its uses with calling

> dynamic_prop::const_val directly.

> 

> gdb/ChangeLog:

> 

> 	* gdbtypes.h (TYPE_DYN_PROP_ADDR): Remove, replace uses with

> 	dynamic_prop::const_val.

> 



This patch causes the following regression for me:
...
FAIL: gdb.fortran/class-allocatable-array.exp: print this%_data%b
...
(and 185 more, all for fortran test-cases).

>    return (prop != nullptr && prop->kind () == PROP_CONST

> -	  && !TYPE_DYN_PROP_ADDR (prop));

> +	  && prop->const_val () != 0);

>  }

> 


Hmm, isn't that supposed to be "== 0" ?

Thanks,
- Tom

Patch

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 4b1f40ab77dc..0cd4b194d982 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4134,7 +4134,7 @@  type_not_allocated (const struct type *type)
   struct dynamic_prop *prop = TYPE_ALLOCATED_PROP (type);
 
   return (prop != nullptr && prop->kind () == PROP_CONST
-	  && !TYPE_DYN_PROP_ADDR (prop));
+	  && prop->const_val () != 0);
 }
 
 /* Associated status of type TYPE.  Return zero if type TYPE is associated.
@@ -4146,7 +4146,7 @@  type_not_associated (const struct type *type)
   struct dynamic_prop *prop = TYPE_ASSOCIATED_PROP (type);
 
   return (prop != nullptr && prop->kind () == PROP_CONST
-	  && !TYPE_DYN_PROP_ADDR (prop));
+	  && prop->const_val () != 0);
 }
 
 /* rank_one_type helper for when PARM's type code is TYPE_CODE_PTR.  */
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index de54a5ed73b6..55a6dafb7e29 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1635,10 +1635,6 @@  extern bool set_type_align (struct type *, ULONGEST);
 #define TYPE_ASSOCIATED_PROP(thistype) \
   ((thistype)->dyn_prop (DYN_PROP_ASSOCIATED))
 
-/* Attribute accessors for dynamic properties.  */
-#define TYPE_DYN_PROP_ADDR(dynprop) \
-  (dynprop->const_val ())
-
 /* C++ */
 
 #define TYPE_SELF_TYPE(thistype) internal_type_self_type (thistype)