+
+ /* Build the language names array, to be used as enumeration in the
+ set language" enum command. */
+ language_names = xrealloc (language_names,
+ (languages_size + 1) * sizeof (const char *));
+ for (i = 0; i < languages_size; ++i)
+ language_names[i] = languages[i]->la_name;
+ language_names[i] = NULL;
+
+ /* Build the "help set language" docs. */
+ tmp_stream = mem_fileopen ();
+
+ fprintf_unfiltered (tmp_stream, _("\
+Set the current source language.\n\
+The currently understood settings are:\n\n\
+local or auto Automatic setting based on source file\n"));
+
+ for (i = 0; i < languages_size; ++i)
+ {
+ /* Already dealt with these above. */
+ if (languages[i]->la_language == language_unknown
+ || languages[i]->la_language == language_auto)
+ continue;
+
+ /* FIXME: i18n: for now assume that the human-readable name
+ is just a capitalization of the internal name. */
+ fprintf_unfiltered (tmp_stream, "%-16s Use the %c%s language\n",
+ languages[i]->la_name,
+ /* Capitalize first letter of language
+ name. */
+ toupper (languages[i]->la_name[0]),
+ languages[i]->la_name + 1);
+ }
+
+ language_set_doc = ui_file_xstrdup (tmp_stream, NULL);
+ ui_file_delete (tmp_stream);
+
+ add_setshow_enum_cmd ("language", class_support,
+ (const char **) language_names,
+ &language,
+ language_set_doc, _("\
+Show the current source language."), NULL,
+ set_language_command,
+ show_language_command,
+ &setlist, &showlist);
+
+ xfree (language_set_doc);
+}
+
+/* Iterate through all registered languages looking for and calling
+ any non-NULL struct language_defn.skip_trampoline() functions.
+ Return the result from the first that returns non-zero, or 0 if all
+ `fail'. */
+CORE_ADDR
+skip_language_trampoline (struct frame_info *frame, CORE_ADDR pc)
+{
+ int i;
+
+ for (i = 0; i < languages_size; i++)
+ {
+ if (languages[i]->skip_trampoline)
+ {
+ CORE_ADDR real_pc = (languages[i]->skip_trampoline) (frame, pc);
+ if (real_pc)
+ return real_pc;
+ }
+ }
+
+ return 0;
+}
+
+/* Return demangled language symbol, or NULL.
+ FIXME: Options are only useful for certain languages and ignored
+ by others, so it would be better to remove them here and have a
+ more flexible demangler for the languages that need it.
+ FIXME: Sometimes the demangler is invoked when we don't know the
+ language, so we can't use this everywhere. */
+char *
+language_demangle (const struct language_defn *current_language,
+ const char *mangled, int options)
+{
+ if (current_language != NULL && current_language->la_demangle)
+ return current_language->la_demangle (mangled, options);
+ return NULL;
+}
+
+/* Return class name from physname or NULL. */
+char *
+language_class_name_from_physname (const struct language_defn *current_language,
+ const char *physname)
+{
+ if (current_language != NULL && current_language->la_class_name_from_physname)
+ return current_language->la_class_name_from_physname (physname);
+ return NULL;
+}
+
+/* Return non-zero if TYPE should be passed (and returned) by
+ reference at the language level. */
+int
+language_pass_by_reference (struct type *type)
+{
+ return current_language->la_pass_by_reference (type);
+}
+
+/* Return zero; by default, types are passed by value at the language
+ level. The target ABI may pass or return some structs by reference
+ independent of this. */
+int
+default_pass_by_reference (struct type *type)
+{
+ return 0;
+}
+
+/* Return the default string containing the list of characters
+ delimiting words. This is a reasonable default value that
+ most languages should be able to use. */
+
+char *
+default_word_break_characters (void)
+{
+ return " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-";
+}
+
+/* Print the index of array elements using the C99 syntax. */
+
+void
+default_print_array_index (struct value *index_value, struct ui_file *stream,
+ const struct value_print_options *options)
+{
+ fprintf_filtered (stream, "[");
+ LA_VALUE_PRINT (index_value, stream, options);
+ fprintf_filtered (stream, "] = ");
+}
+
+void
+default_get_string (struct value *value, gdb_byte **buffer, int *length,
+ struct type **char_type, const char **charset)
+{
+ error (_("Getting a string is unsupported in this language."));