+ data->known_tasks_addr = BMSYMBOL_VALUE_ADDRESS (msym);
+
+ /* Try to get pointer type and array length from the symtab. */
+ sym = lookup_symbol_in_language (KNOWN_TASKS_NAME, NULL, VAR_DOMAIN,
+ language_c, NULL).symbol;
+ if (sym != NULL)
+ {
+ /* Validate. */
+ struct type *type = check_typedef (SYMBOL_TYPE (sym));
+ struct type *eltype = NULL;
+ struct type *idxtype = NULL;
+
+ if (type->code () == TYPE_CODE_ARRAY)
+ eltype = check_typedef (TYPE_TARGET_TYPE (type));
+ if (eltype != NULL
+ && eltype->code () == TYPE_CODE_PTR)
+ idxtype = check_typedef (TYPE_INDEX_TYPE (type));
+ if (idxtype != NULL
+ && !TYPE_LOW_BOUND_UNDEFINED (idxtype)
+ && !TYPE_HIGH_BOUND_UNDEFINED (idxtype))
+ {
+ data->known_tasks_element = eltype;
+ data->known_tasks_length =
+ TYPE_HIGH_BOUND (idxtype) - TYPE_LOW_BOUND (idxtype) + 1;
+ return;
+ }
+ }
+
+ /* Fallback to default values. The runtime may have been stripped (as
+ in some distributions), but it is likely that the executable still
+ contains debug information on the task type (due to implicit with of
+ Ada.Tasking). */
+ data->known_tasks_element =
+ builtin_type (target_gdbarch ())->builtin_data_ptr;
+ data->known_tasks_length = MAX_NUMBER_OF_KNOWN_TASKS;