From: Joel Brobecker Date: Thu, 12 Mar 2009 23:17:33 +0000 (+0000) Subject: Fix segfault when printing short_integer'last. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c513ee6994571ad21e9b240dea202483d9335cf;p=binutils-gdb.git Fix segfault when printing short_integer'last. * ada-lang.c (ada_find_any_type): Search in the primitive types if a symbol could not be found. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0ae2a976de1..11058531d93 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2009-03-12 Joel Brobecker + + Fix segfault when printing short_integer'last. + + * ada-lang.c (ada_find_any_type): Search in the primitive types + if a symbol could not be found. + 2009-03-12 Joel Brobecker * ada-tasks.c (task_states,long_task_states): Add new states diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index fbcc32ad2fc..12ee5cf630e 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -6535,11 +6535,16 @@ struct type * ada_find_any_type (const char *name) { struct symbol *sym = ada_find_any_symbol (name); + struct type *type = NULL; if (sym != NULL) - return SYMBOL_TYPE (sym); + type = SYMBOL_TYPE (sym); - return NULL; + if (type == 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