mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 16:38:05 +08:00
gdb: add accessors to struct dynamic_prop
Add setters, to ensure that the kind and value of the property are always kept in sync (a caller can't forget one or the other). Add getters, such that we can assert that when a caller accesses a data bit of the property, the property is indeed of the corresponding kind. Note that because of the way `struct dynamic_prop` is allocated currently, we can't make the `m_kind` and `m_data` fields private. That would make the type non-default-constructible, and we would have to call the constructor when allocating them. However, I still prefixed them with `m_` to indicate that they should not be accessed from outside the class (and also to be able to use the name `kind` for the method). gdb/ChangeLog: * gdbtypes.h (struct dynamic_prop) <kind, set_undefined, const_val, set_const_val, baton, set_locexpr, set_loclist, set_addr_offset, variant_parts, set_variant_parts, original_type, set_original_type>: New methods. <kind>: Rename to... <m_kind>: ... this. Update all users to use the new methods instead. <data>: Rename to... <m_data>: ... this. Update all users to use the new methods instead. Change-Id: Ib72a8eb440dfeb1a5421d0933334230d7f2478f9
This commit is contained in:
@ -172,8 +172,7 @@ type_stack::follow_types (struct type *follow_type)
|
||||
lookup_array_range_type (follow_type,
|
||||
0, array_size >= 0 ? array_size - 1 : 0);
|
||||
if (array_size < 0)
|
||||
TYPE_HIGH_BOUND_KIND (follow_type->index_type ())
|
||||
= PROP_UNDEFINED;
|
||||
follow_type->index_type ()->bounds ()->high.set_undefined ();
|
||||
break;
|
||||
case tp_function:
|
||||
/* FIXME-type-allocation: need a way to free this type when we are
|
||||
|
Reference in New Issue
Block a user