Fix gdb.trace/entry-values.exp for thumb mode
[deliverable/binutils-gdb.git] / gdb / ada-lang.c
index c12fbb8b6871eae58bf2050b86e5816d93a3aaa2..6956909badf766c72955002dff9f1706f3841308 100644 (file)
@@ -357,7 +357,8 @@ static struct cmd_list_element *maint_show_ada_cmdlist;
 static void
 maint_set_ada_cmd (char *args, int from_tty)
 {
-  help_list (maint_set_ada_cmdlist, "maintenance set ada ", -1, gdb_stdout);
+  help_list (maint_set_ada_cmdlist, "maintenance set ada ", all_commands,
+            gdb_stdout);
 }
 
 /* Implement the "maintenance show ada" (prefix) command.  */
@@ -4167,7 +4168,7 @@ parse_old_style_renaming (struct type *type,
 
 static struct value *
 ada_read_renaming_var_value (struct symbol *renaming_sym,
-                            struct block *block)
+                            const struct block *block)
 {
   const char *sym_name;
   struct expression *expr;
@@ -4393,20 +4394,6 @@ ada_clear_symbol_cache (void)
   ada_init_symbol_cache (sym_cache);
 }
 
-/* STRUCT_DOMAIN symbols are also typedefs for the type.  This function tests
-   the equivalency of two Ada symbol domain types.  */
-
-static int
-ada_symbol_matches_domain (domain_enum symbol_domain, domain_enum domain)
-{
-  if (symbol_domain == domain
-      || ((domain == VAR_DOMAIN || domain == STRUCT_DOMAIN)
-         && symbol_domain == STRUCT_DOMAIN))
-    return 1;
-
-  return 0;
-}
-
 /* Search our cache for an entry matching NAME and NAMESPACE.
    Return it if found, or NULL otherwise.  */
 
@@ -4508,13 +4495,6 @@ standard_lookup (const char *name, const struct block *block,
   if (lookup_cached_symbol (name, domain, &sym, NULL))
     return sym;
   sym = lookup_symbol_in_language (name, block, domain, language_c, 0);
-
-  /* STRUCT_DOMAIN symbols also define a typedef for the type.  Lookup
-     a STRUCT_DOMAIN symbol if one is requested for VAR_DOMAIN and not
-     found.  */
-  if (sym == NULL && domain == VAR_DOMAIN)
-    sym = lookup_symbol_in_language (name, block, STRUCT_DOMAIN, language_c, 0);
-
   cache_symbol (name, domain, sym, block_found);
   return sym;
 }
@@ -5340,29 +5320,13 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name,
       data.objfile = objfile;
 
       if (is_wild_match)
-       {
-         objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
-                                                aux_add_nonlocal_symbols,
-                                                &data, wild_match, NULL);
-         if (domain == VAR_DOMAIN)
-           objfile->sf->qf->map_matching_symbols (objfile, name,
-                                                  STRUCT_DOMAIN, global,
-                                                  aux_add_nonlocal_symbols,
-                                                  &data, wild_match, NULL);
-       }
+       objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
+                                              aux_add_nonlocal_symbols, &data,
+                                              wild_match, NULL);
       else
-       {
-         objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
-                                                aux_add_nonlocal_symbols,
-                                                &data, full_match,
-                                                compare_names);
-         if (domain == VAR_DOMAIN)
-           objfile->sf->qf->map_matching_symbols (objfile, name,
-                                                  STRUCT_DOMAIN, global,
-                                                  aux_add_nonlocal_symbols,
-                                                  &data, full_match,
-                                                  compare_names);
-       }
+       objfile->sf->qf->map_matching_symbols (objfile, name, domain, global,
+                                              aux_add_nonlocal_symbols, &data,
+                                              full_match, compare_names);
     }
 
   if (num_defns_collected (obstackp) == 0 && global && !is_wild_match)
@@ -5886,7 +5850,8 @@ ada_add_block_symbols (struct obstack *obstackp,
       for (sym = block_iter_match_first (block, name, wild_match, &iter);
           sym != NULL; sym = block_iter_match_next (name, wild_match, &iter))
       {
-        if (ada_symbol_matches_domain (SYMBOL_DOMAIN (sym), domain)
+        if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+                                   SYMBOL_DOMAIN (sym), domain)
             && wild_match (SYMBOL_LINKAGE_NAME (sym), name) == 0)
           {
            if (SYMBOL_CLASS (sym) == LOC_UNRESOLVED)
@@ -5908,7 +5873,8 @@ ada_add_block_symbols (struct obstack *obstackp,
      for (sym = block_iter_match_first (block, name, full_match, &iter);
          sym != NULL; sym = block_iter_match_next (name, full_match, &iter))
       {
-        if (ada_symbol_matches_domain (SYMBOL_DOMAIN (sym), domain))
+        if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+                                   SYMBOL_DOMAIN (sym), domain))
           {
            if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED)
              {
@@ -5940,7 +5906,8 @@ ada_add_block_symbols (struct obstack *obstackp,
 
       ALL_BLOCK_SYMBOLS (block, iter, sym)
       {
-        if (ada_symbol_matches_domain (SYMBOL_DOMAIN (sym), domain))
+        if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
+                                   SYMBOL_DOMAIN (sym), domain))
           {
             int cmp;
 
@@ -6166,7 +6133,7 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
   struct symtab *s;
   struct minimal_symbol *msymbol;
   struct objfile *objfile;
-  struct block *b, *surrounding_static_block = 0;
+  const struct block *b, *surrounding_static_block = 0;
   int i;
   struct block_iterator iter;
   struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
@@ -7528,12 +7495,11 @@ ada_find_any_type_symbol (const char *name)
   struct symbol *sym;
 
   sym = standard_lookup (name, get_selected_block (NULL), VAR_DOMAIN);
-  if (sym != NULL
-      && (SYMBOL_DOMAIN (sym) != VAR_DOMAIN
-         || SYMBOL_CLASS (sym) == LOC_TYPEDEF))
+  if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
     return sym;
 
-  return NULL;
+  sym = standard_lookup (name, NULL, STRUCT_DOMAIN);
+  return sym;
 }
 
 /* Find a type named NAME.  Ignores ambiguity.  This routine will look
@@ -12792,7 +12758,7 @@ static void
 ada_add_exceptions_from_frame (regex_t *preg, struct frame_info *frame,
                               VEC(ada_exc_info) **exceptions)
 {
-  struct block *block = get_frame_block (frame, 0);
+  const struct block *block = get_frame_block (frame, 0);
 
   while (block != 0)
     {
@@ -12853,7 +12819,7 @@ ada_add_global_exceptions (regex_t *preg, VEC(ada_exc_info) **exceptions)
 
   ALL_PRIMARY_SYMTABS (objfile, s)
     {
-      struct blockvector *bv = BLOCKVECTOR (s);
+      const struct blockvector *bv = BLOCKVECTOR (s);
       int i;
 
       for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
@@ -13478,7 +13444,7 @@ ada_get_symbol_name_cmp (const char *lookup_name)
 static struct value *
 ada_read_var_value (struct symbol *var, struct frame_info *frame)
 {
-  struct block *frame_block = NULL;
+  const struct block *frame_block = NULL;
   struct symbol *renaming_sym = NULL;
 
   /* The only case where default_read_var_value is not sufficient
@@ -13552,7 +13518,7 @@ set_ada_command (char *arg, int from_tty)
 {
   printf_unfiltered (_(\
 "\"set ada\" must be followed by the name of a setting.\n"));
-  help_list (set_ada_list, "set ada ", -1, gdb_stdout);
+  help_list (set_ada_list, "set ada ", all_commands, gdb_stdout);
 }
 
 /* Implement the "show ada" prefix command.  */
This page took 0.029735 seconds and 4 git commands to generate.