diff options
author | Joel Brobecker <brobecker@gnat.com> | 2009-03-12 23:17:33 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2009-03-12 23:17:33 +0000 |
commit | 3c513ee6994571ad21e9b240dea202483d9335cf (patch) | |
tree | cf0a232221afe50f11292717c1ee9b13f09cd130 /gdb/ada-lang.c | |
parent | 680f3fadee04f4243dc604da6cda111a4d087ffe (diff) | |
download | gdb-3c513ee6994571ad21e9b240dea202483d9335cf.zip gdb-3c513ee6994571ad21e9b240dea202483d9335cf.tar.gz gdb-3c513ee6994571ad21e9b240dea202483d9335cf.tar.bz2 |
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.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index fbcc32a..12ee5cf 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 |