aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-07-12 22:58:52 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-07-12 22:58:52 -0400
commit064d9cb9e765b0a064a2e442df0e7bcc79f98c18 (patch)
tree5a7903d08f40b9931b366355181734242656f245
parent5537ddd024adc7d1af6f9572983f77e9dd047fce (diff)
downloadgdb-064d9cb9e765b0a064a2e442df0e7bcc79f98c18.zip
gdb-064d9cb9e765b0a064a2e442df0e7bcc79f98c18.tar.gz
gdb-064d9cb9e765b0a064a2e442df0e7bcc79f98c18.tar.bz2
gdb: remove TYPE_LOW_BOUND_UNDEFINED and TYPE_HIGH_BOUND_UNDEFINED
Remove the macros, use the getters of `struct dynamic_prop` instead. gdb/ChangeLog: * gdbtypes.h (TYPE_LOW_BOUND_UNDEFINED, TYPE_HIGH_BOUND_UNDEFINED): Remove. Update all callers to get the bound property's kind and check against PROP_UNDEFINED. Change-Id: I6a7641ac1aa3fa7fca0c21f00556f185f2e2d68c
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/ada-tasks.c4
-rw-r--r--gdb/eval.c3
-rw-r--r--gdb/gdbtypes.c7
-rw-r--r--gdb/gdbtypes.h8
5 files changed, 17 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e6acbb2..3233cb5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2020-07-12 Simon Marchi <simon.marchi@efficios.com>
+ * gdbtypes.h (TYPE_LOW_BOUND_UNDEFINED,
+ TYPE_HIGH_BOUND_UNDEFINED): Remove. Update all callers
+ to get the bound property's kind and check against
+ PROP_UNDEFINED.
+
+2020-07-12 Simon Marchi <simon.marchi@efficios.com>
+
* gdbtypes.h (TYPE_LOW_BOUND, TYPE_HIGH_BOUND): Remove. Update
all callers to use type::range_bounds followed by
dynamic_prop::{low,high}.
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index 7870a78..27b4587 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -896,8 +896,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data)
&& eltype->code () == TYPE_CODE_PTR)
idxtype = check_typedef (type->index_type ());
if (idxtype != NULL
- && !TYPE_LOW_BOUND_UNDEFINED (idxtype)
- && !TYPE_HIGH_BOUND_UNDEFINED (idxtype))
+ && idxtype->bounds ()->low.kind () != PROP_UNDEFINED
+ && idxtype->bounds ()->high.kind () != PROP_UNDEFINED)
{
data->known_tasks_element = eltype;
data->known_tasks_length =
diff --git a/gdb/eval.c b/gdb/eval.c
index 2191e19..dacd46d 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -3212,7 +3212,8 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
type = value_type (val);
if (type->code () == TYPE_CODE_ARRAY
&& is_dynamic_type (type->index_type ())
- && TYPE_HIGH_BOUND_UNDEFINED (type->index_type ()))
+ && (type->index_type ()->bounds ()->high.kind ()
+ == PROP_UNDEFINED))
return allocate_optimized_out_value (size_type);
}
else
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 507d2f6..227f696 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -5117,10 +5117,11 @@ recursive_dump_type (struct type *type, int spaces)
{
printfi_filtered (spaces, "low %s%s high %s%s\n",
plongest (type->bounds ()->low.const_val ()),
- TYPE_LOW_BOUND_UNDEFINED (type) ? " (undefined)" : "",
+ (type->bounds ()->low.kind () == PROP_UNDEFINED
+ ? " (undefined)" : ""),
plongest (type->bounds ()->high.const_val ()),
- TYPE_HIGH_BOUND_UNDEFINED (type)
- ? " (undefined)" : "");
+ (type->bounds ()->high.kind () == PROP_UNDEFINED
+ ? " (undefined)" : ""));
}
switch (TYPE_SPECIFIC_FIELD (type))
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 044af47..2d277ac 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1594,10 +1594,6 @@ extern unsigned type_align (struct type *);
space in struct type. */
extern bool set_type_align (struct type *, ULONGEST);
-#define TYPE_LOW_BOUND_UNDEFINED(range_type) \
- (TYPE_LOW_BOUND_KIND(range_type) == PROP_UNDEFINED)
-#define TYPE_HIGH_BOUND_UNDEFINED(range_type) \
- (TYPE_HIGH_BOUND_KIND(range_type) == PROP_UNDEFINED)
#define TYPE_HIGH_BOUND_KIND(range_type) \
((range_type)->bounds ()->high.kind ())
#define TYPE_LOW_BOUND_KIND(range_type) \
@@ -1637,9 +1633,9 @@ extern bool set_type_align (struct type *, ULONGEST);
index type. */
#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \
- TYPE_HIGH_BOUND_UNDEFINED((arraytype)->index_type ())
+ ((arraytype)->index_type ()->bounds ()->high.kind () == PROP_UNDEFINED)
#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
- TYPE_LOW_BOUND_UNDEFINED((arraytype)->index_type ())
+ ((arraytype)->index_type ()->bounds ()->low.kind () == PROP_UNDEFINED)
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
((arraytype)->index_type ()->bounds ()->high.const_val ())