terminated yet. */
void
-iterate_over_live_ada_tasks (ada_task_list_iterator_ftype *iterator)
+iterate_over_live_ada_tasks (ada_task_list_iterator_ftype iterator)
{
struct ada_tasks_inferior_data *data;
array_fieldno = ada_get_field_index (type, "P_ARRAY", 0);
bounds_fieldno = ada_get_field_index (type, "P_BOUNDS", 0);
- bounds_type = TYPE_FIELD_TYPE (type, bounds_fieldno);
- if (TYPE_CODE (bounds_type) == TYPE_CODE_PTR)
+ bounds_type = type->field (bounds_fieldno).type ();
+ if (bounds_type->code () == TYPE_CODE_PTR)
bounds_type = TYPE_TARGET_TYPE (bounds_type);
- if (TYPE_CODE (bounds_type) != TYPE_CODE_STRUCT)
+ if (bounds_type->code () != TYPE_CODE_STRUCT)
error (_("Unknown task name format. Aborting"));
upper_bound_fieldno = ada_get_field_index (bounds_type, "UB0", 0);
task_name = p + 2;
/* Copy the task name. */
- strncpy (task_info->name, task_name, sizeof (task_info->name));
+ strncpy (task_info->name, task_name,
+ sizeof (task_info->name) - 1);
task_info->name[sizeof (task_info->name) - 1] = 0;
}
else
struct type *eltype = NULL;
struct type *idxtype = NULL;
- if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ if (type->code () == TYPE_CODE_ARRAY)
eltype = check_typedef (TYPE_TARGET_TYPE (type));
if (eltype != NULL
- && TYPE_CODE (eltype) == TYPE_CODE_PTR)
- idxtype = check_typedef (TYPE_INDEX_TYPE (type));
+ && 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 =
- TYPE_HIGH_BOUND (idxtype) - TYPE_LOW_BOUND (idxtype) + 1;
+ (idxtype->bounds ()->high.const_val ()
+ - idxtype->bounds ()->low.const_val () + 1);
return;
}
}
/* Validate. */
struct type *type = check_typedef (SYMBOL_TYPE (sym));
- if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ if (type->code () == TYPE_CODE_PTR)
{
data->known_tasks_element = type;
return;
{
/* All objfiles are being cleared, so we should clear all
our caches for all program spaces. */
- struct program_space *pspace;
-
- for (pspace = program_spaces; pspace != NULL; pspace = pspace->next)
+ for (struct program_space *pspace : program_spaces)
ada_tasks_invalidate_pspace_data (pspace);
}
else
ada_tasks_invalidate_inferior_data (inf);
}
+void _initialize_tasks ();
void
-_initialize_tasks (void)
+_initialize_tasks ()
{
/* Attach various observers. */
gdb::observers::normal_stop.attach (ada_tasks_normal_stop_observer);