gdb: Convert language_data::la_exp_desc to a method
[deliverable/binutils-gdb.git] / gdb / ada-lang.c
index ee8d3f5589cb5efd6cd0b9e3313c184874895a80..876125c4f188f05ed60f859faa4b6664a48eaf3d 100644 (file)
@@ -315,11 +315,11 @@ static int warning_limit = 2;
    expression evaluation.  */
 static int warnings_issued = 0;
 
-static const char *known_runtime_file_name_patterns[] = {
+static const char * const known_runtime_file_name_patterns[] = {
   ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS NULL
 };
 
-static const char *known_auxiliary_function_name_patterns[] = {
+static const char * const known_auxiliary_function_name_patterns[] = {
   ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS NULL
 };
 
@@ -488,23 +488,6 @@ add_angle_brackets (const char *str)
   return string_printf ("<%s>", str);
 }
 
-static const char *
-ada_get_gdb_completer_word_break_characters (void)
-{
-  return ada_completer_word_break_characters;
-}
-
-/* la_watch_location_expression for Ada.  */
-
-static gdb::unique_xmalloc_ptr<char>
-ada_watch_location_expression (struct type *type, CORE_ADDR addr)
-{
-  type = check_typedef (TYPE_TARGET_TYPE (check_typedef (type)));
-  std::string name = type_to_string (type);
-  return gdb::unique_xmalloc_ptr<char>
-    (xstrprintf ("{%s} %s", name.c_str (), core_addr_to_string (addr)));
-}
-
 /* Assuming V points to an array of S objects,  make sure that it contains at
    least M objects, updating V and S as necessary.  */
 
@@ -718,7 +701,7 @@ umax_of_size (int size)
 static LONGEST
 max_of_type (struct type *t)
 {
-  if (TYPE_UNSIGNED (t))
+  if (t->is_unsigned ())
     return (LONGEST) umax_of_size (TYPE_LENGTH (t));
   else
     return max_of_size (TYPE_LENGTH (t));
@@ -728,7 +711,7 @@ max_of_type (struct type *t)
 static LONGEST
 min_of_type (struct type *t)
 {
-  if (TYPE_UNSIGNED (t)) 
+  if (t->is_unsigned ())
     return 0;
   else
     return min_of_size (TYPE_LENGTH (t));
@@ -742,7 +725,21 @@ ada_discrete_type_high_bound (struct type *type)
   switch (type->code ())
     {
     case TYPE_CODE_RANGE:
-      return TYPE_HIGH_BOUND (type);
+      {
+       const dynamic_prop &high = type->bounds ()->high;
+
+       if (high.kind () == PROP_CONST)
+         return high.const_val ();
+       else
+         {
+           gdb_assert (high.kind () == PROP_UNDEFINED);
+
+           /* This happens when trying to evaluate a type's dynamic bound
+              without a live target.  There is nothing relevant for us to
+              return here, so return 0.  */
+           return 0;
+         }
+      }
     case TYPE_CODE_ENUM:
       return TYPE_FIELD_ENUMVAL (type, type->num_fields () - 1);
     case TYPE_CODE_BOOL:
@@ -763,7 +760,21 @@ ada_discrete_type_low_bound (struct type *type)
   switch (type->code ())
     {
     case TYPE_CODE_RANGE:
-      return TYPE_LOW_BOUND (type);
+      {
+       const dynamic_prop &low = type->bounds ()->low;
+
+       if (low.kind () == PROP_CONST)
+         return low.const_val ();
+       else
+         {
+           gdb_assert (low.kind () == PROP_UNDEFINED);
+
+           /* This happens when trying to evaluate a type's dynamic bound
+              without a live target.  There is nothing relevant for us to
+              return here, so return 0.  */
+           return 0;
+         }
+      }
     case TYPE_CODE_ENUM:
       return TYPE_FIELD_ENUMVAL (type, 0);
     case TYPE_CODE_BOOL:
@@ -865,18 +876,11 @@ ada_main_name (void)
 
   if (msym.minsym != NULL)
     {
-      CORE_ADDR main_program_name_addr;
-      int err_code;
-
-      main_program_name_addr = BMSYMBOL_VALUE_ADDRESS (msym);
+      CORE_ADDR main_program_name_addr = BMSYMBOL_VALUE_ADDRESS (msym);
       if (main_program_name_addr == 0)
         error (_("Invalid address for Ada main program name."));
 
-      target_read_string (main_program_name_addr, &main_program_name,
-                          1024, &err_code);
-
-      if (err_code != 0)
-        return NULL;
+      main_program_name = target_read_string (main_program_name_addr, 1024);
       return main_program_name.get ();
     }
 
@@ -1588,7 +1592,7 @@ desc_bounds (struct value *arr)
        {
          struct type *target_type = TYPE_TARGET_TYPE (p_bounds_type);
 
-         if (TYPE_STUB (target_type))
+         if (target_type->is_stub ())
            p_bounds = value_cast (lookup_pointer_type
                                   (ada_check_typedef (target_type)),
                                   p_bounds);
@@ -2104,7 +2108,7 @@ constrained_packed_array_type (struct type *type, long *elt_bits)
         (*elt_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
     }
 
-  TYPE_FIXED_INSTANCE (new_type) = 1;
+  new_type->set_is_fixed_instance (true);
   return new_type;
 }
 
@@ -2272,9 +2276,9 @@ has_negatives (struct type *type)
     default:
       return 0;
     case TYPE_CODE_INT:
-      return !TYPE_UNSIGNED (type);
+      return !type->is_unsigned ();
     case TYPE_CODE_RANGE:
-      return TYPE_LOW_BOUND (type) - TYPE_RANGE_DATA (type)->bias < 0;
+      return type->bounds ()->low.const_val () - type->bounds ()->bias < 0;
     }
 }
 
@@ -2934,7 +2938,7 @@ ada_array_bound_from_type (struct type *arr_type, int n, int which)
   else
     type = arr_type;
 
-  if (TYPE_FIXED_INSTANCE (type))
+  if (type->is_fixed_instance ())
     {
       /* The array has already been fixed, so we do not need to
         check the parallel ___XA type again.  That encoding has
@@ -3384,28 +3388,6 @@ See set/show multiple-symbol."));
   return n_chosen;
 }
 
-/* Same as evaluate_type (*EXP), but resolves ambiguous symbol
-   references (marked by OP_VAR_VALUE nodes in which the symbol has an
-   undefined namespace) and converts operators that are
-   user-defined into appropriate function calls.  If CONTEXT_TYPE is
-   non-null, it provides a preferred result type [at the moment, only
-   type void has any effect---causing procedures to be preferred over
-   functions in calls].  A null CONTEXT_TYPE indicates that a non-void
-   return type is preferred.  May change (expand) *EXP.  */
-
-static void
-resolve (expression_up *expp, int void_context_p, int parse_completion,
-        innermost_block_tracker *tracker)
-{
-  struct type *context_type = NULL;
-  int pc = 0;
-
-  if (void_context_p)
-    context_type = builtin_type ((*expp)->gdbarch)->builtin_void;
-
-  resolve_subexp (expp, &pc, 1, context_type, parse_completion, tracker);
-}
-
 /* Resolve the operator of the subexpression beginning at
    position *POS of *EXPP.  "Resolving" consists of replacing
    the symbols that have undefined namespaces in OP_VAR_VALUE nodes
@@ -5028,13 +5010,13 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
       /* If two symbols have the same name and one of them is a stub type,
          the get rid of the stub.  */
 
-      if (TYPE_STUB (SYMBOL_TYPE ((*syms)[i].symbol))
+      if (SYMBOL_TYPE ((*syms)[i].symbol)->is_stub ()
           && (*syms)[i].symbol->linkage_name () != NULL)
         {
           for (j = 0; j < syms->size (); j++)
             {
               if (j != i
-                  && !TYPE_STUB (SYMBOL_TYPE ((*syms)[j].symbol))
+                  && !SYMBOL_TYPE ((*syms)[j].symbol)->is_stub ()
                   && (*syms)[j].symbol->linkage_name () != NULL
                   && strcmp ((*syms)[i].symbol->linkage_name (),
                              (*syms)[j].symbol->linkage_name ()) == 0)
@@ -5065,8 +5047,8 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
       
       if (remove_p)
        syms->erase (syms->begin () + i);
-
-      i += 1;
+      else
+       i += 1;
     }
 
   /* If all the remaining symbols are identical enumerals, then
@@ -5788,46 +5770,6 @@ ada_lookup_symbol (const char *name, const struct block *block0,
   return info;
 }
 
-static struct block_symbol
-ada_lookup_symbol_nonlocal (const struct language_defn *langdef,
-                           const char *name,
-                            const struct block *block,
-                            const domain_enum domain)
-{
-  struct block_symbol sym;
-
-  sym = ada_lookup_symbol (name, block_static_block (block), domain);
-  if (sym.symbol != NULL)
-    return sym;
-
-  /* If we haven't found a match at this point, try the primitive
-     types.  In other languages, this search is performed before
-     searching for global symbols in order to short-circuit that
-     global-symbol search if it happens that the name corresponds
-     to a primitive type.  But we cannot do the same in Ada, because
-     it is perfectly legitimate for a program to declare a type which
-     has the same name as a standard type.  If looking up a type in
-     that situation, we have traditionally ignored the primitive type
-     in favor of user-defined types.  This is why, unlike most other
-     languages, we search the primitive types this late and only after
-     having searched the global symbols without success.  */
-
-  if (domain == VAR_DOMAIN)
-    {
-      struct gdbarch *gdbarch;
-
-      if (block == NULL)
-       gdbarch = target_gdbarch ();
-      else
-       gdbarch = block_gdbarch (block);
-      sym.symbol = language_lookup_primitive_type_as_symbol (langdef, gdbarch, name);
-      if (sym.symbol != NULL)
-       return sym;
-    }
-
-  return {};
-}
-
 
 /* True iff STR is a possible encoded suffix of a normal Ada name
    that is to be ignored for matching purposes.  Suffixes of parallel
@@ -6285,134 +6227,6 @@ ada_lookup_name_info::matches
   return true;
 }
 
-/* Add the list of possible symbol names completing TEXT to TRACKER.
-   WORD is the entire command on which completion is made.  */
-
-static void
-ada_collect_symbol_completion_matches (completion_tracker &tracker,
-                                      complete_symbol_mode mode,
-                                      symbol_name_match_type name_match_type,
-                                      const char *text, const char *word,
-                                      enum type_code code)
-{
-  struct symbol *sym;
-  const struct block *b, *surrounding_static_block = 0;
-  struct block_iterator iter;
-
-  gdb_assert (code == TYPE_CODE_UNDEF);
-
-  lookup_name_info lookup_name (text, name_match_type, true);
-
-  /* First, look at the partial symtab symbols.  */
-  expand_symtabs_matching (NULL,
-                          lookup_name,
-                          NULL,
-                          NULL,
-                          ALL_DOMAIN);
-
-  /* At this point scan through the misc symbol vectors and add each
-     symbol you find to the list.  Eventually we want to ignore
-     anything that isn't a text symbol (everything else will be
-     handled by the psymtab code above).  */
-
-  for (objfile *objfile : current_program_space->objfiles ())
-    {
-      for (minimal_symbol *msymbol : objfile->msymbols ())
-       {
-         QUIT;
-
-         if (completion_skip_symbol (mode, msymbol))
-           continue;
-
-         language symbol_language = msymbol->language ();
-
-         /* Ada minimal symbols won't have their language set to Ada.  If
-            we let completion_list_add_name compare using the
-            default/C-like matcher, then when completing e.g., symbols in a
-            package named "pck", we'd match internal Ada symbols like
-            "pckS", which are invalid in an Ada expression, unless you wrap
-            them in '<' '>' to request a verbatim match.
-
-            Unfortunately, some Ada encoded names successfully demangle as
-            C++ symbols (using an old mangling scheme), such as "name__2Xn"
-            -> "Xn::name(void)" and thus some Ada minimal symbols end up
-            with the wrong language set.  Paper over that issue here.  */
-         if (symbol_language == language_auto
-             || symbol_language == language_cplus)
-           symbol_language = language_ada;
-
-         completion_list_add_name (tracker,
-                                   symbol_language,
-                                   msymbol->linkage_name (),
-                                   lookup_name, text, word);
-       }
-    }
-
-  /* Search upwards from currently selected frame (so that we can
-     complete on local vars.  */
-
-  for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
-    {
-      if (!BLOCK_SUPERBLOCK (b))
-        surrounding_static_block = b;   /* For elmin of dups */
-
-      ALL_BLOCK_SYMBOLS (b, iter, sym)
-      {
-       if (completion_skip_symbol (mode, sym))
-         continue;
-
-       completion_list_add_name (tracker,
-                                 sym->language (),
-                                 sym->linkage_name (),
-                                 lookup_name, text, word);
-      }
-    }
-
-  /* Go through the symtabs and check the externs and statics for
-     symbols which match.  */
-
-  for (objfile *objfile : current_program_space->objfiles ())
-    {
-      for (compunit_symtab *s : objfile->compunits ())
-       {
-         QUIT;
-         b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), GLOBAL_BLOCK);
-         ALL_BLOCK_SYMBOLS (b, iter, sym)
-           {
-             if (completion_skip_symbol (mode, sym))
-               continue;
-
-             completion_list_add_name (tracker,
-                                       sym->language (),
-                                       sym->linkage_name (),
-                                       lookup_name, text, word);
-           }
-       }
-    }
-
-  for (objfile *objfile : current_program_space->objfiles ())
-    {
-      for (compunit_symtab *s : objfile->compunits ())
-       {
-         QUIT;
-         b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), STATIC_BLOCK);
-         /* Don't do this block twice.  */
-         if (b == surrounding_static_block)
-           continue;
-         ALL_BLOCK_SYMBOLS (b, iter, sym)
-           {
-             if (completion_skip_symbol (mode, sym))
-               continue;
-
-             completion_list_add_name (tracker,
-                                       sym->language (),
-                                       sym->linkage_name (),
-                                       lookup_name, text, word);
-           }
-       }
-    }
-}
-
                                 /* Field Access */
 
 /* Return non-zero if TYPE is a pointer to the GNAT dispatch table used
@@ -6729,10 +6543,9 @@ ada_tag_name_from_tsd (struct value *tsd)
   val = ada_value_struct_elt (tsd, "expanded_name", 1);
   if (val == NULL)
     return NULL;
-  gdb::unique_xmalloc_ptr<char> buffer;
-  int err;
-  if (target_read_string (value_as_address (val), &buffer, INT_MAX, &err) == 0
-      || err != 0)
+  gdb::unique_xmalloc_ptr<char> buffer
+    = target_read_string (value_as_address (val), INT_MAX);
+  if (buffer == nullptr)
     return nullptr;
 
   for (p = buffer.get (); *p != '\0'; ++p)
@@ -8007,7 +7820,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
   rtype->set_fields
    ((struct field *) TYPE_ZALLOC (rtype, nfields * sizeof (struct field)));
   rtype->set_name (ada_type_name (type));
-  TYPE_FIXED_INSTANCE (rtype) = 1;
+  rtype->set_is_fixed_instance (true);
 
   off = 0;
   bit_len = 0;
@@ -8241,7 +8054,7 @@ template_to_static_fixed_type (struct type *type0)
   int f;
 
   /* No need no do anything if the input type is already fixed.  */
-  if (TYPE_FIXED_INSTANCE (type0))
+  if (type0->is_fixed_instance ())
     return type0;
 
   /* Likewise if we already have computed the static approximation.  */
@@ -8287,7 +8100,7 @@ template_to_static_fixed_type (struct type *type0)
              type->set_fields (fields);
 
              type->set_name (ada_type_name (type0));
-             TYPE_FIXED_INSTANCE (type) = 1;
+             type->set_is_fixed_instance (true);
              TYPE_LENGTH (type) = 0;
            }
          type->field (f).set_type (new_type);
@@ -8338,7 +8151,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
   rtype->set_fields (fields);
 
   rtype->set_name (ada_type_name (type));
-  TYPE_FIXED_INSTANCE (rtype) = 1;
+  rtype->set_is_fixed_instance (true);
   TYPE_LENGTH (rtype) = TYPE_LENGTH (type);
 
   branch_type = to_fixed_variant_branch_type
@@ -8394,7 +8207,7 @@ to_fixed_record_type (struct type *type0, const gdb_byte *valaddr,
 {
   struct type *templ_type;
 
-  if (TYPE_FIXED_INSTANCE (type0))
+  if (type0->is_fixed_instance ())
     return type0;
 
   templ_type = dynamic_template_type (type0);
@@ -8410,7 +8223,7 @@ to_fixed_record_type (struct type *type0, const gdb_byte *valaddr,
     }
   else
     {
-      TYPE_FIXED_INSTANCE (type0) = 1;
+      type0->set_is_fixed_instance (true);
       return type0;
     }
 
@@ -8498,13 +8311,13 @@ ada_is_redundant_range_encoding (struct type *range_type,
   n = 8; /* Skip "___XDLU_".  */
   if (!ada_scan_number (bounds_str, n, &lo, &n))
     return 0;
-  if (TYPE_LOW_BOUND (range_type) != lo)
+  if (range_type->bounds ()->low.const_val () != lo)
     return 0;
 
   n += 2; /* Skip the "__" separator between the two bounds.  */
   if (!ada_scan_number (bounds_str, n, &hi, &n))
     return 0;
-  if (TYPE_HIGH_BOUND (range_type) != hi)
+  if (range_type->bounds ()->high.const_val () != hi)
     return 0;
 
   return 1;
@@ -8550,7 +8363,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
   static const char *xa_suffix = "___XA";
 
   type0 = ada_check_typedef (type0);
-  if (TYPE_FIXED_INSTANCE (type0))
+  if (type0->is_fixed_instance ())
     return type0;
 
   constrained_packed_array_p = ada_is_constrained_packed_array_type (type0);
@@ -8676,7 +8489,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
         TYPE_LENGTH (result)++;
     }
 
-  TYPE_FIXED_INSTANCE (result) = 1;
+  result->set_is_fixed_instance (true);
   return result;
 }
 
@@ -8791,7 +8604,7 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
                    Consider the case of an array, for instance, where the size
                    of the array is computed from the number of elements in
                    our array multiplied by the size of its element.  */
-                TYPE_STUB (fixed_record_type) = 0;
+               fixed_record_type->set_is_stub (false);
               }
           }
         return fixed_record_type;
@@ -8870,7 +8683,7 @@ to_static_fixed_type (struct type *type0)
   if (type0 == NULL)
     return NULL;
 
-  if (TYPE_FIXED_INSTANCE (type0))
+  if (type0->is_fixed_instance ())
     return type0;
 
   type0 = ada_check_typedef (type0);
@@ -8949,7 +8762,7 @@ ada_check_typedef (struct type *type)
 
   type = check_typedef (type);
   if (type == NULL || type->code () != TYPE_CODE_ENUM
-      || !TYPE_STUB (type)
+      || !type->is_stub ()
       || type->name () == NULL)
     return type;
   else
@@ -9015,7 +8828,7 @@ ada_to_fixed_value (struct value *val)
 /* Table mapping attribute numbers to names.
    NOTE: Keep up to date with enum ada_attribute definition in ada-lang.h.  */
 
-static const char *attribute_names[] = {
+static const char * const attribute_names[] = {
   "<?>",
 
   "first",
@@ -9334,7 +9147,7 @@ ada_enum_name (const char *name)
 static struct value *
 evaluate_subexp_type (struct expression *exp, int *pos)
 {
-  return evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
+  return evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
 }
 
 /* If VAL is wrapped in an aligner or subtype wrapper, return the
@@ -9541,7 +9354,7 @@ ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
   if (v2 == 0)
     error (_("second operand of %s must not be zero."), op_string (op));
 
-  if (TYPE_UNSIGNED (type1) || op == BINOP_MOD)
+  if (type1->is_unsigned () || op == BINOP_MOD)
     return value_binop (arg1, arg2, op);
 
   v1 = value_as_long (arg1);
@@ -9707,8 +9520,8 @@ assign_aggregate (struct value *container,
     {
       lhs = ada_coerce_to_simple_array (lhs);
       lhs_type = check_typedef (value_type (lhs));
-      low_index = TYPE_ARRAY_LOWER_BOUND_VALUE (lhs_type);
-      high_index = TYPE_ARRAY_UPPER_BOUND_VALUE (lhs_type);
+      low_index = lhs_type->bounds ()->low.const_val ();
+      high_index = lhs_type->bounds ()->high.const_val ();
     }
   else if (lhs_type->code () == TYPE_CODE_STRUCT)
     {
@@ -10320,7 +10133,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       return ada_evaluate_subexp (type, exp, pos, noside);
 
     case BINOP_ASSIGN:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       if (exp->elts[*pos].opcode == OP_AGGREGATE)
        {
          arg1 = assign_aggregate (arg1, arg1, exp, pos, noside);
@@ -10408,8 +10221,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
     case BINOP_DIV:
     case BINOP_REM:
     case BINOP_MOD:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
+      arg2 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -10430,7 +10243,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
     case BINOP_EQUAL:
     case BINOP_NOTEQUAL:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
@@ -10447,7 +10260,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       return value_from_longest (type, (LONGEST) tem);
 
     case UNOP_NEG:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       else if (ada_is_gnat_encoded_fixed_point_type (value_type (arg1)))
@@ -10476,8 +10289,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       {
         struct value *val;
 
-        arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
-        *pos = pc;
+       arg1 = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
+       *pos = pc;
         val = evaluate_subexp_standard (expect_type, exp, pos, noside);
 
         return value_cast (value_type (arg1), val);
@@ -10528,7 +10341,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
                 a fixed type would result in the loss of that type name,
                 thus preventing us from printing the name of the ancestor
                 type in the type description.  */
-             arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL);
+             arg1 = evaluate_subexp (nullptr, exp, pos, EVAL_NORMAL);
 
              if (type->code () != TYPE_CODE_REF)
                {
@@ -10591,8 +10404,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       else
         {
           for (tem = 0; tem <= nargs; tem += 1)
-            argvec[tem] = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-          argvec[tem] = 0;
+           argvec[tem] = evaluate_subexp (nullptr, exp, pos, noside);
+         argvec[tem] = 0;
 
           if (noside == EVAL_SKIP)
             goto nosideret;
@@ -10721,12 +10534,12 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
     case TERNOP_SLICE:
       {
-        struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-        struct value *low_bound_val =
-          evaluate_subexp (NULL_TYPE, exp, pos, noside);
-        struct value *high_bound_val =
-          evaluate_subexp (NULL_TYPE, exp, pos, noside);
-        LONGEST low_bound;
+       struct value *array = evaluate_subexp (nullptr, exp, pos, noside);
+       struct value *low_bound_val
+         = evaluate_subexp (nullptr, exp, pos, noside);
+       struct value *high_bound_val
+         = evaluate_subexp (nullptr, exp, pos, noside);
+       LONGEST low_bound;
         LONGEST high_bound;
 
         low_bound_val = coerce_ref (low_bound_val);
@@ -10804,7 +10617,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
     case UNOP_IN_RANGE:
       (*pos) += 2;
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       type = check_typedef (exp->elts[pc + 1].type);
 
       if (noside == EVAL_SKIP)
@@ -10819,8 +10632,10 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
          return value_from_longest (type, (LONGEST) 1);
 
         case TYPE_CODE_RANGE:
-         arg2 = value_from_longest (type, TYPE_LOW_BOUND (type));
-         arg3 = value_from_longest (type, TYPE_HIGH_BOUND (type));
+         arg2 = value_from_longest (type,
+                                    type->bounds ()->low.const_val ());
+         arg3 = value_from_longest (type,
+                                    type->bounds ()->high.const_val ());
          binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
          binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg3);
          type = language_bool_type (exp->language_defn, exp->gdbarch);
@@ -10834,8 +10649,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
     case BINOP_IN_BOUNDS:
       (*pos) += 2;
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
+      arg2 = evaluate_subexp (nullptr, exp, pos, noside);
 
       if (noside == EVAL_SKIP)
         goto nosideret;
@@ -10866,9 +10681,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
                                 || value_equal (arg2, arg1)));
 
     case TERNOP_IN_RANGE:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
+      arg2 = evaluate_subexp (nullptr, exp, pos, noside);
+      arg3 = evaluate_subexp (nullptr, exp, pos, noside);
 
       if (noside == EVAL_SKIP)
         goto nosideret;
@@ -10891,14 +10706,14 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
         if (exp->elts[*pos].opcode == OP_TYPE)
           {
-            evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-            arg1 = NULL;
+           evaluate_subexp (nullptr, exp, pos, EVAL_SKIP);
+           arg1 = NULL;
             type_arg = check_typedef (exp->elts[pc + 2].type);
           }
         else
           {
-            arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-            type_arg = NULL;
+           arg1 = evaluate_subexp (nullptr, exp, pos, noside);
+           type_arg = NULL;
           }
 
         if (exp->elts[*pos].opcode != OP_LONG)
@@ -11028,7 +10843,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       }
 
     case OP_ATR_TAG:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
 
@@ -11039,9 +10854,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
     case OP_ATR_MIN:
     case OP_ATR_MAX:
-      evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      evaluate_subexp (nullptr, exp, pos, EVAL_SKIP);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
+      arg2 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -11057,8 +10872,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       {
         struct type *type_arg = check_typedef (exp->elts[pc + 2].type);
 
-        evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-        if (noside == EVAL_SKIP)
+       evaluate_subexp (nullptr, exp, pos, EVAL_SKIP);
+       if (noside == EVAL_SKIP)
           goto nosideret;
 
         if (!ada_is_modular_type (type_arg))
@@ -11070,8 +10885,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
 
     case OP_ATR_POS:
-      evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      evaluate_subexp (nullptr, exp, pos, EVAL_SKIP);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       type = builtin_type (exp->gdbarch)->builtin_int;
@@ -11081,7 +10896,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
        return value_pos_atr (type, arg1);
 
     case OP_ATR_SIZE:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       type = value_type (arg1);
 
       /* If the argument is a reference, then dereference its type, since
@@ -11099,8 +10914,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
                                    TARGET_CHAR_BIT * TYPE_LENGTH (type));
 
     case OP_ATR_VAL:
-      evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      evaluate_subexp (nullptr, exp, pos, EVAL_SKIP);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       type = exp->elts[pc + 2].type;
       if (noside == EVAL_SKIP)
         goto nosideret;
@@ -11110,8 +10925,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
         return value_val_atr (type, arg1);
 
     case BINOP_EXP:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
+      arg2 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -11129,14 +10944,14 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
        }
 
     case UNOP_PLUS:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       else
         return arg1;
 
     case UNOP_ABS:
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       unop_promote (exp->language_defn, exp->gdbarch, &arg1);
@@ -11147,7 +10962,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
     case UNOP_IND:
       preeval_pos = *pos;
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       type = ada_check_typedef (value_type (arg1));
@@ -11176,8 +10991,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
                   || type->code () == TYPE_CODE_PTR)
                  && ada_is_tagged_type (TYPE_TARGET_TYPE (type), 0))
                {
-                 arg1 = evaluate_subexp (NULL_TYPE, exp, &preeval_pos,
-                                         EVAL_NORMAL);
+                 arg1
+                   = evaluate_subexp (nullptr, exp, &preeval_pos, EVAL_NORMAL);
                  type = value_type (ada_value_ind (arg1));
                }
              else
@@ -11231,7 +11046,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
       tem = longest_to_int (exp->elts[pc + 1].longconst);
       (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
       preeval_pos = *pos;
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg1 = evaluate_subexp (nullptr, exp, pos, noside);
       if (noside == EVAL_SKIP)
         goto nosideret;
       if (noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -11250,8 +11065,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
 
               if (type == NULL)
                {
-                 arg1 = evaluate_subexp (NULL_TYPE, exp, &preeval_pos,
-                                         EVAL_NORMAL);
+                 arg1
+                   = evaluate_subexp (nullptr, exp, &preeval_pos, EVAL_NORMAL);
                  arg1 = ada_value_struct_elt (arg1,
                                               &exp->elts[pc + 2].string,
                                               0);
@@ -11629,7 +11444,7 @@ ada_is_modular_type (struct type *type)
 
   return (subranged_type != NULL && type->code () == TYPE_CODE_RANGE
           && subranged_type->code () == TYPE_CODE_INT
-          && TYPE_UNSIGNED (subranged_type));
+          && subranged_type->is_unsigned ());
 }
 
 /* Assuming ada_is_modular_type (TYPE), the modulus of TYPE.  */
@@ -11637,7 +11452,14 @@ ada_is_modular_type (struct type *type)
 ULONGEST
 ada_modulus (struct type *type)
 {
-  return (ULONGEST) TYPE_HIGH_BOUND (type) + 1;
+  const dynamic_prop &high = type->bounds ()->high;
+
+  if (high.kind () == PROP_CONST)
+    return (ULONGEST) high.const_val () + 1;
+
+  /* If TYPE is unresolved, the high bound might be a location list.  Return
+     0, for lack of a better value to return.  */
+  return 0;
 }
 \f
 
@@ -11681,7 +11503,7 @@ ada_modulus (struct type *type)
    an Ada83 compiler). As such, we do not include Numeric_Error from
    this list of standard exceptions.  */
 
-static const char *standard_exc[] = {
+static const char * const standard_exc[] = {
   "constraint_error",
   "program_error",
   "storage_error",
@@ -12109,11 +11931,10 @@ ada_exception_message_1 (void)
   if (e_msg_len <= 0)
     return NULL;
 
-  gdb::unique_xmalloc_ptr<char> e_msg;
-  int err;
-  if (target_read_string (value_address (e_msg_val), &e_msg, INT_MAX, &err) == 0
-      || err != 0)
-    return nullptr;
+  gdb::unique_xmalloc_ptr<char> e_msg ((char *) xmalloc (e_msg_len + 1));
+  read_memory (value_address (e_msg_val), (gdb_byte *) e_msg.get (),
+              e_msg_len);
+  e_msg.get ()[e_msg_len] = '\0';
 
   return e_msg;
 }
@@ -13725,21 +13546,6 @@ enum ada_primitive_types {
 \f
                                /* Language vector */
 
-/* Not really used, but needed in the ada_language_defn.  */
-
-static void
-emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
-{
-  ada_emit_char (c, type, stream, quoter, 1);
-}
-
-static int
-parse (struct parser_state *ps)
-{
-  warnings_issued = 0;
-  return ada_parse (ps);
-}
-
 static const struct exp_descriptor ada_exp_descriptor = {
   ada_print_subexp,
   ada_operator_length,
@@ -13789,10 +13595,10 @@ ada_lookup_name_info::ada_lookup_name_info (const lookup_name_info &lookup_name)
     {
       if (user_name.back () == '>')
        m_encoded_name
-         = user_name.substr (1, user_name.size () - 2).to_string ();
+         = gdb::to_string (user_name.substr (1, user_name.size () - 2));
       else
        m_encoded_name
-         = user_name.substr (1, user_name.size () - 1).to_string ();
+         = gdb::to_string (user_name.substr (1, user_name.size () - 1));
       m_encoded_p = true;
       m_verbatim_p = true;
       m_wild_match_p = false;
@@ -13811,10 +13617,10 @@ ada_lookup_name_info::ada_lookup_name_info (const lookup_name_info &lookup_name)
          if (encoded != NULL)
            m_encoded_name = encoded;
          else
-           m_encoded_name = user_name.to_string ();
+           m_encoded_name = gdb::to_string (user_name);
        }
       else
-       m_encoded_name = user_name.to_string ();
+       m_encoded_name = gdb::to_string (user_name);
 
       /* Handle the 'package Standard' special case.  See description
         of m_standard_p.  */
@@ -13876,7 +13682,7 @@ literal_symbol_name_matcher (const char *symbol_search_name,
     return false;
 }
 
-/* Implement the "la_get_symbol_name_matcher" language_defn method for
+/* Implement the "get_symbol_name_matcher" language_defn method for
    Ada.  */
 
 static symbol_name_matcher_ftype *
@@ -13898,49 +13704,11 @@ ada_get_symbol_name_matcher (const lookup_name_info &lookup_name)
     }
 }
 
-static const char *ada_extensions[] =
-{
-  ".adb", ".ads", ".a", ".ada", ".dg", NULL
-};
-
 /* Constant data that describes the Ada language.  */
 
 extern const struct language_data ada_language_data =
 {
-  "ada",                        /* Language name */
-  "Ada",
-  language_ada,
-  range_check_off,
-  case_sensitive_on,            /* Yes, Ada is case-insensitive, but
-                                   that's not quite what this means.  */
-  array_row_major,
-  macro_expansion_no,
-  ada_extensions,
-  &ada_exp_descriptor,
-  parse,
-  resolve,
-  ada_printchar,                /* Print a character constant */
-  ada_printstr,                 /* Function to print string constant */
-  emit_char,                    /* Function to print single char (not used) */
-  ada_print_typedef,            /* Print a typedef using appropriate syntax */
-  ada_value_print_inner,       /* la_value_print_inner */
-  ada_value_print,              /* Print a top-level value */
-  NULL,                         /* name_of_this */
-  true,                         /* la_store_sym_names_in_linkage_form_p */
-  ada_lookup_symbol_nonlocal,   /* Looking up non-local symbols.  */
-  NULL,                         /* Language specific
-                                  class_name_from_physname */
   ada_op_print_tab,             /* expression operators for printing */
-  0,                            /* c-style arrays */
-  1,                            /* String lower bound */
-  ada_get_gdb_completer_word_break_characters,
-  ada_collect_symbol_completion_matches,
-  ada_watch_location_expression,
-  ada_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
-  &ada_varobj_ops,
-  NULL,
-  ada_is_string_type,
-  "(...)"                      /* la_struct_too_deep_ellipsis */
 };
 
 /* Class representing the Ada language.  */
@@ -13952,6 +13720,25 @@ public:
     : language_defn (language_ada, ada_language_data)
   { /* Nothing.  */ }
 
+  /* See language.h.  */
+
+  const char *name () const override
+  { return "ada"; }
+
+  /* See language.h.  */
+
+  const char *natural_name () const override
+  { return "Ada"; }
+
+  /* See language.h.  */
+
+  const std::vector<const char *> &filename_extensions () const override
+  {
+    static const std::vector<const char *> extensions
+      = { ".adb", ".ads", ".a", ".ada", ".dg" };
+    return extensions;
+  }
+
   /* Print an array element index using the Ada syntax.  */
 
   void print_array_index (struct type *index_type,
@@ -14122,6 +13909,315 @@ public:
   {
     ada_print_type (type, varstring, stream, show, level, flags);
   }
+
+  /* See language.h.  */
+
+  const char *word_break_characters (void) const override
+  {
+    return ada_completer_word_break_characters;
+  }
+
+  /* See language.h.  */
+
+  void collect_symbol_completion_matches (completion_tracker &tracker,
+                                         complete_symbol_mode mode,
+                                         symbol_name_match_type name_match_type,
+                                         const char *text, const char *word,
+                                         enum type_code code) const override
+  {
+    struct symbol *sym;
+    const struct block *b, *surrounding_static_block = 0;
+    struct block_iterator iter;
+
+    gdb_assert (code == TYPE_CODE_UNDEF);
+
+    lookup_name_info lookup_name (text, name_match_type, true);
+
+    /* First, look at the partial symtab symbols.  */
+    expand_symtabs_matching (NULL,
+                            lookup_name,
+                            NULL,
+                            NULL,
+                            ALL_DOMAIN);
+
+    /* At this point scan through the misc symbol vectors and add each
+       symbol you find to the list.  Eventually we want to ignore
+       anything that isn't a text symbol (everything else will be
+       handled by the psymtab code above).  */
+
+    for (objfile *objfile : current_program_space->objfiles ())
+      {
+       for (minimal_symbol *msymbol : objfile->msymbols ())
+         {
+           QUIT;
+
+           if (completion_skip_symbol (mode, msymbol))
+             continue;
+
+           language symbol_language = msymbol->language ();
+
+           /* Ada minimal symbols won't have their language set to Ada.  If
+              we let completion_list_add_name compare using the
+              default/C-like matcher, then when completing e.g., symbols in a
+              package named "pck", we'd match internal Ada symbols like
+              "pckS", which are invalid in an Ada expression, unless you wrap
+              them in '<' '>' to request a verbatim match.
+
+              Unfortunately, some Ada encoded names successfully demangle as
+              C++ symbols (using an old mangling scheme), such as "name__2Xn"
+              -> "Xn::name(void)" and thus some Ada minimal symbols end up
+              with the wrong language set.  Paper over that issue here.  */
+           if (symbol_language == language_auto
+               || symbol_language == language_cplus)
+             symbol_language = language_ada;
+
+           completion_list_add_name (tracker,
+                                     symbol_language,
+                                     msymbol->linkage_name (),
+                                     lookup_name, text, word);
+         }
+      }
+
+    /* Search upwards from currently selected frame (so that we can
+       complete on local vars.  */
+
+    for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
+      {
+       if (!BLOCK_SUPERBLOCK (b))
+         surrounding_static_block = b;   /* For elmin of dups */
+
+       ALL_BLOCK_SYMBOLS (b, iter, sym)
+         {
+           if (completion_skip_symbol (mode, sym))
+             continue;
+
+           completion_list_add_name (tracker,
+                                     sym->language (),
+                                     sym->linkage_name (),
+                                     lookup_name, text, word);
+         }
+      }
+
+    /* Go through the symtabs and check the externs and statics for
+       symbols which match.  */
+
+    for (objfile *objfile : current_program_space->objfiles ())
+      {
+       for (compunit_symtab *s : objfile->compunits ())
+         {
+           QUIT;
+           b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), GLOBAL_BLOCK);
+           ALL_BLOCK_SYMBOLS (b, iter, sym)
+             {
+               if (completion_skip_symbol (mode, sym))
+                 continue;
+
+               completion_list_add_name (tracker,
+                                         sym->language (),
+                                         sym->linkage_name (),
+                                         lookup_name, text, word);
+             }
+         }
+      }
+
+    for (objfile *objfile : current_program_space->objfiles ())
+      {
+       for (compunit_symtab *s : objfile->compunits ())
+         {
+           QUIT;
+           b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), STATIC_BLOCK);
+           /* Don't do this block twice.  */
+           if (b == surrounding_static_block)
+             continue;
+           ALL_BLOCK_SYMBOLS (b, iter, sym)
+             {
+               if (completion_skip_symbol (mode, sym))
+                 continue;
+
+               completion_list_add_name (tracker,
+                                         sym->language (),
+                                         sym->linkage_name (),
+                                         lookup_name, text, word);
+             }
+         }
+      }
+  }
+
+  /* See language.h.  */
+
+  gdb::unique_xmalloc_ptr<char> watch_location_expression
+       (struct type *type, CORE_ADDR addr) const override
+  {
+    type = check_typedef (TYPE_TARGET_TYPE (check_typedef (type)));
+    std::string name = type_to_string (type);
+    return gdb::unique_xmalloc_ptr<char>
+      (xstrprintf ("{%s} %s", name.c_str (), core_addr_to_string (addr)));
+  }
+
+  /* See language.h.  */
+
+  void value_print (struct value *val, struct ui_file *stream,
+                   const struct value_print_options *options) const override
+  {
+    return ada_value_print (val, stream, options);
+  }
+
+  /* See language.h.  */
+
+  void value_print_inner
+       (struct value *val, struct ui_file *stream, int recurse,
+        const struct value_print_options *options) const override
+  {
+    return ada_value_print_inner (val, stream, recurse, options);
+  }
+
+  /* See language.h.  */
+
+  struct block_symbol lookup_symbol_nonlocal
+       (const char *name, const struct block *block,
+        const domain_enum domain) const override
+  {
+    struct block_symbol sym;
+
+    sym = ada_lookup_symbol (name, block_static_block (block), domain);
+    if (sym.symbol != NULL)
+      return sym;
+
+    /* If we haven't found a match at this point, try the primitive
+       types.  In other languages, this search is performed before
+       searching for global symbols in order to short-circuit that
+       global-symbol search if it happens that the name corresponds
+       to a primitive type.  But we cannot do the same in Ada, because
+       it is perfectly legitimate for a program to declare a type which
+       has the same name as a standard type.  If looking up a type in
+       that situation, we have traditionally ignored the primitive type
+       in favor of user-defined types.  This is why, unlike most other
+       languages, we search the primitive types this late and only after
+       having searched the global symbols without success.  */
+
+    if (domain == VAR_DOMAIN)
+      {
+       struct gdbarch *gdbarch;
+
+       if (block == NULL)
+         gdbarch = target_gdbarch ();
+       else
+         gdbarch = block_gdbarch (block);
+       sym.symbol
+         = language_lookup_primitive_type_as_symbol (this, gdbarch, name);
+       if (sym.symbol != NULL)
+         return sym;
+      }
+
+    return {};
+  }
+
+  /* See language.h.  */
+
+  int parser (struct parser_state *ps) const override
+  {
+    warnings_issued = 0;
+    return ada_parse (ps);
+  }
+
+  /* See language.h.
+
+     Same as evaluate_type (*EXP), but resolves ambiguous symbol references
+     (marked by OP_VAR_VALUE nodes in which the symbol has an undefined
+     namespace) and converts operators that are user-defined into
+     appropriate function calls.  If CONTEXT_TYPE is non-null, it provides
+     a preferred result type [at the moment, only type void has any
+     effect---causing procedures to be preferred over functions in calls].
+     A null CONTEXT_TYPE indicates that a non-void return type is
+     preferred.  May change (expand) *EXP.  */
+
+  void post_parser (expression_up *expp, int void_context_p, int completing,
+                   innermost_block_tracker *tracker) const override
+  {
+    struct type *context_type = NULL;
+    int pc = 0;
+
+    if (void_context_p)
+      context_type = builtin_type ((*expp)->gdbarch)->builtin_void;
+
+    resolve_subexp (expp, &pc, 1, context_type, completing, tracker);
+  }
+
+  /* See language.h.  */
+
+  void emitchar (int ch, struct type *chtype,
+                struct ui_file *stream, int quoter) const override
+  {
+    ada_emit_char (ch, chtype, stream, quoter, 1);
+  }
+
+  /* See language.h.  */
+
+  void printchar (int ch, struct type *chtype,
+                 struct ui_file *stream) const override
+  {
+    ada_printchar (ch, chtype, stream);
+  }
+
+  /* See language.h.  */
+
+  void printstr (struct ui_file *stream, struct type *elttype,
+                const gdb_byte *string, unsigned int length,
+                const char *encoding, int force_ellipses,
+                const struct value_print_options *options) const override
+  {
+    ada_printstr (stream, elttype, string, length, encoding,
+                 force_ellipses, options);
+  }
+
+  /* See language.h.  */
+
+  void print_typedef (struct type *type, struct symbol *new_symbol,
+                     struct ui_file *stream) const override
+  {
+    ada_print_typedef (type, new_symbol, stream);
+  }
+
+  /* See language.h.  */
+
+  bool is_string_type_p (struct type *type) const override
+  {
+    return ada_is_string_type (type);
+  }
+
+  /* See language.h.  */
+
+  const char *struct_too_deep_ellipsis () const override
+  { return "(...)"; }
+
+  /* See language.h.  */
+
+  bool c_style_arrays_p () const override
+  { return false; }
+
+  /* See language.h.  */
+
+  bool store_sym_names_in_linkage_form_p () const override
+  { return true; }
+
+  /* See language.h.  */
+
+  const struct lang_varobj_ops *varobj_ops () const override
+  { return &ada_varobj_ops; }
+
+  /* See language.h.  */
+
+  const struct exp_descriptor *expression_ops () const override
+  { return &ada_exp_descriptor; }
+
+protected:
+  /* See language.h.  */
+
+  symbol_name_matcher_ftype *get_symbol_name_matcher_inner
+       (const lookup_name_info &lookup_name) const override
+  {
+    return ada_get_symbol_name_matcher (lookup_name);
+  }
 };
 
 /* Single instance of the Ada language class.  */
This page took 0.046005 seconds and 4 git commands to generate.