* ada-lang.c (ada_find_any_type): Move check for primitive types ...

(to_fixed_range_type): ... to here.
This commit is contained in:
Ulrich Weigand 2009-05-18 14:00:08 +00:00
parent 556bdfd450
commit dddfab26ac
2 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2009-05-18 Ulrich Weigand <uweigand@de.ibm.com>
* ada-lang.c (ada_find_any_type): Move check for primitive types ...
(to_fixed_range_type): ... to here.
2009-05-18 Ulrich Weigand <uweigand@de.ibm.com> 2009-05-18 Ulrich Weigand <uweigand@de.ibm.com>
* ada-lang.c (desc_data_type): Remove, replace by ... * ada-lang.c (desc_data_type): Remove, replace by ...

View File

@ -6481,22 +6481,19 @@ ada_find_any_symbol (const char *name)
return sym; return sym;
} }
/* Find a type named NAME. Ignores ambiguity. */ /* Find a type named NAME. Ignores ambiguity. This routine will look
solely for types defined by debug info, it will not search the GDB
primitive types. */
struct type * struct type *
ada_find_any_type (const char *name) ada_find_any_type (const char *name)
{ {
struct symbol *sym = ada_find_any_symbol (name); struct symbol *sym = ada_find_any_symbol (name);
struct type *type = NULL;
if (sym != NULL) if (sym != NULL)
type = SYMBOL_TYPE (sym); return SYMBOL_TYPE (sym);
if (type == NULL) return NULL;
type = language_lookup_primitive_type_by_name
(language_def (language_ada), current_gdbarch, name);
return type;
} }
/* Given NAME and an associated BLOCK, search all symbols for /* Given NAME and an associated BLOCK, search all symbols for
@ -9451,6 +9448,11 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
struct type *base_type; struct type *base_type;
char *subtype_info; char *subtype_info;
/* Also search primitive types if type symbol could not be found. */
if (raw_type == NULL)
raw_type = language_lookup_primitive_type_by_name
(language_def (language_ada), current_gdbarch, name);
if (raw_type == NULL) if (raw_type == NULL)
base_type = builtin_type_int32; base_type = builtin_type_int32;
else if (TYPE_CODE (raw_type) == TYPE_CODE_RANGE) else if (TYPE_CODE (raw_type) == TYPE_CODE_RANGE)