21#ifndef F_ARRAY_WALKER_H
22#define F_ARRAY_WALKER_H
40 && (
type->
code () != TYPE_CODE_STRING))
41 error (_(
"can only compute offsets for arrays and strings"));
46 error (
"unable to read array bounds");
115 {
return should_continue; }
145 struct type *elt_type, LONGEST elt_off,
146 LONGEST index,
bool last_p)
148 walk_1 (elt_type, elt_off, last_p);
176 LONGEST index,
bool last_p)
184template<
typename Impl>
197 template <
typename ...Args>
223 LONGEST lowerbound, upperbound;
225 error (
"failed to get range bounds");
232 gdb_assert (range_type->
code () == TYPE_CODE_RANGE);
234 upperbound - lowerbound + 1,
243 for (LONGEST i = lowerbound;
244 m_impl.continue_walking (i < upperbound + 1);
252 ([
this] (
struct type *w_type,
int w_offset,
bool w_last_p) ->
void
254 this->
walk_1 (w_type, w_offset, w_last_p);
256 subarray_type, new_offset, i, i == upperbound);
265 for (LONGEST i = lowerbound;
266 m_impl.continue_walking (i < upperbound + 1);
273 CORE_ADDR e_address =
m_address + elt_off;
277 m_impl.process_element (elt_type, elt_off, i, i == upperbound);
LONGEST index_offset(LONGEST index)
fortran_array_offset_calculator(struct type *type)
gdb_static_assert((std::is_base_of< fortran_array_walker_base_impl, Impl >::value))
fortran_array_walker(struct type *type, CORE_ADDR address, Args... args)
void walk_1(struct type *type, int offset, bool last_p)
int calc_f77_array_dims(struct type *array_type)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
int is_dynamic_type(struct type *type)
bool get_discrete_bounds(struct type *type, LONGEST *lowp, LONGEST *highp)
struct type * resolve_dynamic_type(struct type *type, gdb::array_view< const gdb_byte > valaddr, CORE_ADDR addr, const frame_info_ptr *in_frame)
unsigned int type_length_units(struct type *type)
struct type * check_typedef(struct type *type)
void start_dimension(struct type *index_type, LONGEST nelts, bool inner_p)
void process_element(struct type *elt_type, LONGEST elt_off, LONGEST index, bool last_p)
void process_dimension(gdb::function_view< void(struct type *, int, bool)> walk_1, struct type *elt_type, LONGEST elt_off, LONGEST index, bool last_p)
bool continue_walking(bool should_continue)
void finish_dimension(bool inner_p, bool last_p)
ULONGEST bit_stride() const
struct type * target_type() const
range_bounds * bounds() const
type * index_type() const