OSDN Git Service

Fix segfault when printing short_integer'last.
authorbrobecke <brobecke>
Thu, 12 Mar 2009 23:17:31 +0000 (23:17 +0000)
committerbrobecke <brobecke>
Thu, 12 Mar 2009 23:17:31 +0000 (23:17 +0000)
        * ada-lang.c (ada_find_any_type): Search in the primitive types
        if a symbol could not be found.

gdb/ChangeLog
gdb/ada-lang.c

index 0ae2a97..1105853 100644 (file)
@@ -1,5 +1,12 @@
 2009-03-12  Joel Brobecker  <brobecker@adacore.com>
 
+       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  <brobecker@adacore.com>
+
        * ada-tasks.c (task_states,long_task_states): Add new states
        Activating and Acceptor_Delay_Sleep.  Update the description
        of state Acceptor_Sleep.
index fbcc32a..12ee5cf 100644 (file)
@@ -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