gdb: add type::bounds / type::set_bounds

Add the `bounds` and `set_bounds` methods on `struct type`, in order to
remove the `TYPE_RANGE_DATA` macro.  In this patch, the
`TYPE_RANGE_DATA` macro is changed to use `type::bounds`, so all the
call sites that are used to set a range type's bounds are changed to use
`type::set_bounds`.  The next patch will remove `TYPE_RANGE_DATA`
completely.

gdb/ChangeLog:

	* gdbtypes.h (struct type) <bounds, set_bounds>: New methods.
	(TYPE_RANGE_DATA): Use type::bounds.  Change all uses that
	are used to set the range type's bounds to use set_bounds.

Change-Id: I62e15506239b98404e62bbea8120db184ed87847
This commit is contained in:
Simon Marchi
2020-07-12 22:58:50 -04:00
committed by Simon Marchi
parent 07716b63cb
commit c4dfcb3638
4 changed files with 39 additions and 12 deletions

View File

@ -1734,8 +1734,8 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
if (t->bt == btRange)
{
tp->set_num_fields (0);
TYPE_RANGE_DATA (tp) = ((struct range_bounds *)
TYPE_ZALLOC (tp, sizeof (struct range_bounds)));
tp->set_bounds (((struct range_bounds *)
TYPE_ZALLOC (tp, sizeof (struct range_bounds))));
TYPE_LOW_BOUND (tp) = AUX_GET_DNLOW (bigend, ax);
ax++;
TYPE_HIGH_BOUND (tp) = AUX_GET_DNHIGH (bigend, ax);