1 /* Multiple source language support for GDB.
3 Copyright (C) 1991-2014 Free Software Foundation, Inc.
5 Contributed by the Department of Computer Science at the State University
6 of New York at Buffalo.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* This file contains functions that return things that are specific
24 to languages. Each function should examine current_language if necessary,
25 and return the appropriate result. */
27 /* FIXME: Most of these would be better organized as macros which
28 return data out of a "language-specific" struct pointer that is set
29 whenever the working language changes. That would be a lot faster. */
39 #include "expression.h"
43 #include "parser-defs.h"
47 #include "cp-support.h"
49 extern void _initialize_language (void);
51 static void unk_lang_error (char *);
53 static int unk_lang_parser (struct parser_state *);
55 static void show_check (char *, int);
57 static void set_check (char *, int);
59 static void set_range_case (void);
61 static void unk_lang_emit_char (int c, struct type *type,
62 struct ui_file *stream, int quoter);
64 static void unk_lang_printchar (int c, struct type *type,
65 struct ui_file *stream);
67 static void unk_lang_value_print (struct value *, struct ui_file *,
68 const struct value_print_options *);
70 static CORE_ADDR unk_lang_trampoline (struct frame_info *, CORE_ADDR pc);
72 /* Forward declaration */
73 extern const struct language_defn unknown_language_defn;
75 /* The current (default at startup) state of type and range checking.
76 (If the modes are set to "auto", though, these are changed based
77 on the default language at startup, and then again based on the
78 language of the first source file. */
80 enum range_mode range_mode = range_mode_auto;
81 enum range_check range_check = range_check_off;
82 enum case_mode case_mode = case_mode_auto;
83 enum case_sensitivity case_sensitivity = case_sensitive_on;
85 /* The current language and language_mode (see language.h). */
87 const struct language_defn *current_language = &unknown_language_defn;
88 enum language_mode language_mode = language_mode_auto;
90 /* The language that the user expects to be typing in (the language
91 of main(), or the last language we notified them about, or C). */
93 const struct language_defn *expected_language;
95 /* The list of supported languages. The list itself is malloc'd. */
97 static const struct language_defn **languages;
98 static unsigned languages_size;
99 static unsigned languages_allocsize;
100 #define DEFAULT_ALLOCSIZE 4
102 /* The current values of the "set language/type/range" enum
104 static const char *language;
105 static const char *type;
106 static const char *range;
107 static const char *case_sensitive;
109 /* Warning issued when current_language and the language of the current
110 frame do not match. */
111 char lang_frame_mismatch_warn[] =
112 "Warning: the current language does not match this frame.";
114 /* This page contains the functions corresponding to GDB commands
115 and their helpers. */
117 /* Show command. Display a warning if the language set
118 does not match the frame. */
120 show_language_command (struct ui_file *file, int from_tty,
121 struct cmd_list_element *c, const char *value)
123 enum language flang; /* The language of the current frame. */
125 if (language_mode == language_mode_auto)
126 fprintf_filtered (gdb_stdout,
127 _("The current source language is "
128 "\"auto; currently %s\".\n"),
129 current_language->la_name);
131 fprintf_filtered (gdb_stdout,
132 _("The current source language is \"%s\".\n"),
133 current_language->la_name);
135 flang = get_frame_language ();
136 if (flang != language_unknown &&
137 language_mode == language_mode_manual &&
138 current_language->la_language != flang)
139 printf_filtered ("%s\n", lang_frame_mismatch_warn);
142 /* Set command. Change the current working language. */
144 set_language_command (char *ignore, int from_tty, struct cmd_list_element *c)
149 /* Search the list of languages for a match. */
150 for (i = 0; i < languages_size; i++)
152 if (strcmp (languages[i]->la_name, language) == 0)
154 /* Found it! Go into manual mode, and use this language. */
155 if (languages[i]->la_language == language_auto)
157 /* Enter auto mode. Set to the current frame's language, if
158 known, or fallback to the initial language. */
159 language_mode = language_mode_auto;
160 flang = get_frame_language ();
161 if (flang != language_unknown)
162 set_language (flang);
164 set_initial_language ();
165 expected_language = current_language;
170 /* Enter manual mode. Set the specified language. */
171 language_mode = language_mode_manual;
172 current_language = languages[i];
174 expected_language = current_language;
180 internal_error (__FILE__, __LINE__,
181 "Couldn't find language `%s' in known languages list.",
185 /* Show command. Display a warning if the range setting does
186 not match the current language. */
188 show_range_command (struct ui_file *file, int from_tty,
189 struct cmd_list_element *c, const char *value)
191 if (range_mode == range_mode_auto)
200 case range_check_off:
203 case range_check_warn:
207 internal_error (__FILE__, __LINE__,
208 "Unrecognized range check setting.");
211 fprintf_filtered (gdb_stdout,
212 _("Range checking is \"auto; currently %s\".\n"),
216 fprintf_filtered (gdb_stdout, _("Range checking is \"%s\".\n"),
219 if (range_check != current_language->la_range_check)
220 warning (_("the current range check setting "
221 "does not match the language.\n"));
224 /* Set command. Change the setting for range checking. */
226 set_range_command (char *ignore, int from_tty, struct cmd_list_element *c)
228 if (strcmp (range, "on") == 0)
230 range_check = range_check_on;
231 range_mode = range_mode_manual;
233 else if (strcmp (range, "warn") == 0)
235 range_check = range_check_warn;
236 range_mode = range_mode_manual;
238 else if (strcmp (range, "off") == 0)
240 range_check = range_check_off;
241 range_mode = range_mode_manual;
243 else if (strcmp (range, "auto") == 0)
245 range_mode = range_mode_auto;
251 internal_error (__FILE__, __LINE__,
252 _("Unrecognized range check setting: \"%s\""), range);
254 if (range_check != current_language->la_range_check)
255 warning (_("the current range check setting "
256 "does not match the language.\n"));
259 /* Show command. Display a warning if the case sensitivity setting does
260 not match the current language. */
262 show_case_command (struct ui_file *file, int from_tty,
263 struct cmd_list_element *c, const char *value)
265 if (case_mode == case_mode_auto)
269 switch (case_sensitivity)
271 case case_sensitive_on:
274 case case_sensitive_off:
278 internal_error (__FILE__, __LINE__,
279 "Unrecognized case-sensitive setting.");
282 fprintf_filtered (gdb_stdout,
283 _("Case sensitivity in "
284 "name search is \"auto; currently %s\".\n"),
288 fprintf_filtered (gdb_stdout,
289 _("Case sensitivity in name search is \"%s\".\n"),
292 if (case_sensitivity != current_language->la_case_sensitivity)
293 warning (_("the current case sensitivity setting does not match "
297 /* Set command. Change the setting for case sensitivity. */
300 set_case_command (char *ignore, int from_tty, struct cmd_list_element *c)
302 if (strcmp (case_sensitive, "on") == 0)
304 case_sensitivity = case_sensitive_on;
305 case_mode = case_mode_manual;
307 else if (strcmp (case_sensitive, "off") == 0)
309 case_sensitivity = case_sensitive_off;
310 case_mode = case_mode_manual;
312 else if (strcmp (case_sensitive, "auto") == 0)
314 case_mode = case_mode_auto;
320 internal_error (__FILE__, __LINE__,
321 "Unrecognized case-sensitive setting: \"%s\"",
325 if (case_sensitivity != current_language->la_case_sensitivity)
326 warning (_("the current case sensitivity setting does not match "
330 /* Set the status of range and type checking and case sensitivity based on
331 the current modes and the current language.
332 If SHOW is non-zero, then print out the current language,
333 type and range checking status. */
335 set_range_case (void)
337 if (range_mode == range_mode_auto)
338 range_check = current_language->la_range_check;
340 if (case_mode == case_mode_auto)
341 case_sensitivity = current_language->la_case_sensitivity;
344 /* Set current language to (enum language) LANG. Returns previous
348 set_language (enum language lang)
351 enum language prev_language;
353 prev_language = current_language->la_language;
355 for (i = 0; i < languages_size; i++)
357 if (languages[i]->la_language == lang)
359 current_language = languages[i];
365 return prev_language;
369 /* Print out the current language settings: language, range and
370 type checking. If QUIETLY, print only what has changed. */
373 language_info (int quietly)
375 if (quietly && expected_language == current_language)
378 expected_language = current_language;
379 printf_unfiltered (_("Current language: %s\n"), language);
380 show_language_command (NULL, 1, NULL, NULL);
384 printf_unfiltered (_("Range checking: %s\n"), range);
385 show_range_command (NULL, 1, NULL, NULL);
386 printf_unfiltered (_("Case sensitivity: %s\n"), case_sensitive);
387 show_case_command (NULL, 1, NULL, NULL);
392 /* Returns non-zero if the value is a pointer type. */
394 pointer_type (struct type *type)
396 return TYPE_CODE (type) == TYPE_CODE_PTR ||
397 TYPE_CODE (type) == TYPE_CODE_REF;
401 /* This page contains functions that return info about
402 (struct value) values used in GDB. */
404 /* Returns non-zero if the value VAL represents a true value. */
406 value_true (struct value *val)
408 /* It is possible that we should have some sort of error if a non-boolean
409 value is used in this context. Possibly dependent on some kind of
410 "boolean-checking" option like range checking. But it should probably
411 not depend on the language except insofar as is necessary to identify
412 a "boolean" value (i.e. in C using a float, pointer, etc., as a boolean
413 should be an error, probably). */
414 return !value_logical_not (val);
417 /* This page contains functions for the printing out of
418 error messages that occur during type- and range-
421 /* This is called when a language fails a range-check. The
422 first argument should be a printf()-style format string, and the
423 rest of the arguments should be its arguments. If range_check is
424 range_check_on, an error is printed; if range_check_warn, a warning;
425 otherwise just the message. */
428 range_error (const char *string,...)
432 va_start (args, string);
435 case range_check_warn:
436 vwarning (string, args);
439 verror (string, args);
441 case range_check_off:
442 /* FIXME: cagney/2002-01-30: Should this function print anything
443 when range error is off? */
444 vfprintf_filtered (gdb_stderr, string, args);
445 fprintf_filtered (gdb_stderr, "\n");
448 internal_error (__FILE__, __LINE__, _("bad switch"));
454 /* This page contains miscellaneous functions. */
456 /* Return the language enum for a given language string. */
459 language_enum (char *str)
463 for (i = 0; i < languages_size; i++)
464 if (strcmp (languages[i]->la_name, str) == 0)
465 return languages[i]->la_language;
467 return language_unknown;
470 /* Return the language struct for a given language enum. */
472 const struct language_defn *
473 language_def (enum language lang)
477 for (i = 0; i < languages_size; i++)
479 if (languages[i]->la_language == lang)
487 /* Return the language as a string. */
489 language_str (enum language lang)
493 for (i = 0; i < languages_size; i++)
495 if (languages[i]->la_language == lang)
497 return languages[i]->la_name;
504 set_check (char *ignore, int from_tty)
507 "\"set check\" must be followed by the name of a check subcommand.\n");
508 help_list (setchecklist, "set check ", all_commands, gdb_stdout);
512 show_check (char *ignore, int from_tty)
514 cmd_show_list (showchecklist, from_tty, "");
517 /* Add a language to the set of known languages. */
520 add_language (const struct language_defn *lang)
522 /* For the "set language" command. */
523 static const char **language_names = NULL;
524 /* For the "help set language" command. */
525 char *language_set_doc = NULL;
528 struct ui_file *tmp_stream;
530 if (lang->la_magic != LANG_MAGIC)
532 fprintf_unfiltered (gdb_stderr,
533 "Magic number of %s language struct wrong\n",
535 internal_error (__FILE__, __LINE__,
536 _("failed internal consistency check"));
541 languages_allocsize = DEFAULT_ALLOCSIZE;
542 languages = (const struct language_defn **) xmalloc
543 (languages_allocsize * sizeof (*languages));
545 if (languages_size >= languages_allocsize)
547 languages_allocsize *= 2;
548 languages = (const struct language_defn **) xrealloc ((char *) languages,
549 languages_allocsize * sizeof (*languages));
551 languages[languages_size++] = lang;
553 /* Build the language names array, to be used as enumeration in the
554 set language" enum command. */
555 language_names = xrealloc (language_names,
556 (languages_size + 1) * sizeof (const char *));
557 for (i = 0; i < languages_size; ++i)
558 language_names[i] = languages[i]->la_name;
559 language_names[i] = NULL;
561 /* Build the "help set language" docs. */
562 tmp_stream = mem_fileopen ();
564 fprintf_unfiltered (tmp_stream,
565 _("Set the current source language.\n"
566 "The currently understood settings are:\n\nlocal or "
567 "auto Automatic setting based on source file\n"));
569 for (i = 0; i < languages_size; ++i)
571 /* Already dealt with these above. */
572 if (languages[i]->la_language == language_unknown
573 || languages[i]->la_language == language_auto)
576 /* FIXME: i18n: for now assume that the human-readable name
577 is just a capitalization of the internal name. */
578 fprintf_unfiltered (tmp_stream, "%-16s Use the %c%s language\n",
579 languages[i]->la_name,
580 /* Capitalize first letter of language
582 toupper (languages[i]->la_name[0]),
583 languages[i]->la_name + 1);
586 language_set_doc = ui_file_xstrdup (tmp_stream, NULL);
587 ui_file_delete (tmp_stream);
589 add_setshow_enum_cmd ("language", class_support,
590 (const char **) language_names,
593 _("Show the current source language."),
594 NULL, set_language_command,
595 show_language_command,
596 &setlist, &showlist);
598 xfree (language_set_doc);
601 /* Iterate through all registered languages looking for and calling
602 any non-NULL struct language_defn.skip_trampoline() functions.
603 Return the result from the first that returns non-zero, or 0 if all
606 skip_language_trampoline (struct frame_info *frame, CORE_ADDR pc)
610 for (i = 0; i < languages_size; i++)
612 if (languages[i]->skip_trampoline)
614 CORE_ADDR real_pc = (languages[i]->skip_trampoline) (frame, pc);
624 /* Return demangled language symbol, or NULL.
625 FIXME: Options are only useful for certain languages and ignored
626 by others, so it would be better to remove them here and have a
627 more flexible demangler for the languages that need it.
628 FIXME: Sometimes the demangler is invoked when we don't know the
629 language, so we can't use this everywhere. */
631 language_demangle (const struct language_defn *current_language,
632 const char *mangled, int options)
634 if (current_language != NULL && current_language->la_demangle)
635 return current_language->la_demangle (mangled, options);
639 /* Return class name from physname or NULL. */
641 language_class_name_from_physname (const struct language_defn *lang,
642 const char *physname)
644 if (lang != NULL && lang->la_class_name_from_physname)
645 return lang->la_class_name_from_physname (physname);
649 /* Return non-zero if TYPE should be passed (and returned) by
650 reference at the language level. */
652 language_pass_by_reference (struct type *type)
654 return current_language->la_pass_by_reference (type);
657 /* Return zero; by default, types are passed by value at the language
658 level. The target ABI may pass or return some structs by reference
659 independent of this. */
661 default_pass_by_reference (struct type *type)
666 /* Return the default string containing the list of characters
667 delimiting words. This is a reasonable default value that
668 most languages should be able to use. */
671 default_word_break_characters (void)
673 return " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,-";
676 /* Print the index of array elements using the C99 syntax. */
679 default_print_array_index (struct value *index_value, struct ui_file *stream,
680 const struct value_print_options *options)
682 fprintf_filtered (stream, "[");
683 LA_VALUE_PRINT (index_value, stream, options);
684 fprintf_filtered (stream, "] = ");
688 default_get_string (struct value *value, gdb_byte **buffer, int *length,
689 struct type **char_type, const char **charset)
691 error (_("Getting a string is unsupported in this language."));
694 /* Define the language that is no language. */
697 unk_lang_parser (struct parser_state *ps)
703 unk_lang_error (char *msg)
705 error (_("Attempted to parse an expression with unknown language"));
709 unk_lang_emit_char (int c, struct type *type, struct ui_file *stream,
712 error (_("internal error - unimplemented "
713 "function unk_lang_emit_char called."));
717 unk_lang_printchar (int c, struct type *type, struct ui_file *stream)
719 error (_("internal error - unimplemented "
720 "function unk_lang_printchar called."));
724 unk_lang_printstr (struct ui_file *stream, struct type *type,
725 const gdb_byte *string, unsigned int length,
726 const char *encoding, int force_ellipses,
727 const struct value_print_options *options)
729 error (_("internal error - unimplemented "
730 "function unk_lang_printstr called."));
734 unk_lang_print_type (struct type *type, const char *varstring,
735 struct ui_file *stream, int show, int level,
736 const struct type_print_options *flags)
738 error (_("internal error - unimplemented "
739 "function unk_lang_print_type called."));
743 unk_lang_val_print (struct type *type, const gdb_byte *valaddr,
744 int embedded_offset, CORE_ADDR address,
745 struct ui_file *stream, int recurse,
746 const struct value *val,
747 const struct value_print_options *options)
749 error (_("internal error - unimplemented "
750 "function unk_lang_val_print called."));
754 unk_lang_value_print (struct value *val, struct ui_file *stream,
755 const struct value_print_options *options)
757 error (_("internal error - unimplemented "
758 "function unk_lang_value_print called."));
761 static CORE_ADDR unk_lang_trampoline (struct frame_info *frame, CORE_ADDR pc)
766 /* Unknown languages just use the cplus demangler. */
767 static char *unk_lang_demangle (const char *mangled, int options)
769 return gdb_demangle (mangled, options);
772 static char *unk_lang_class_name (const char *mangled)
777 static const struct op_print unk_op_print_tab[] =
779 {NULL, OP_NULL, PREC_NULL, 0}
783 unknown_language_arch_info (struct gdbarch *gdbarch,
784 struct language_arch_info *lai)
786 lai->string_char_type = builtin_type (gdbarch)->builtin_char;
787 lai->bool_type_default = builtin_type (gdbarch)->builtin_int;
788 lai->primitive_type_vector = GDBARCH_OBSTACK_CALLOC (gdbarch, 1,
792 const struct language_defn unknown_language_defn =
801 &exp_descriptor_standard,
805 unk_lang_printchar, /* Print character constant */
808 unk_lang_print_type, /* Print a type using appropriate syntax */
809 default_print_typedef, /* Print a typedef using appropriate syntax */
810 unk_lang_val_print, /* Print a value using appropriate syntax */
811 unk_lang_value_print, /* Print a top-level value */
812 default_read_var_value, /* la_read_var_value */
813 unk_lang_trampoline, /* Language specific skip_trampoline */
814 "this", /* name_of_this */
815 basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
816 basic_lookup_transparent_type,/* lookup_transparent_type */
817 unk_lang_demangle, /* Language specific symbol demangler */
818 unk_lang_class_name, /* Language specific
819 class_name_from_physname */
820 unk_op_print_tab, /* expression operators for printing */
821 1, /* c-style arrays */
822 0, /* String lower bound */
823 default_word_break_characters,
824 default_make_symbol_completion_list,
825 unknown_language_arch_info, /* la_language_arch_info. */
826 default_print_array_index,
827 default_pass_by_reference,
829 NULL, /* la_get_symbol_name_cmp */
830 iterate_over_symbols,
835 /* These two structs define fake entries for the "local" and "auto"
837 const struct language_defn auto_language_defn =
846 &exp_descriptor_standard,
850 unk_lang_printchar, /* Print character constant */
853 unk_lang_print_type, /* Print a type using appropriate syntax */
854 default_print_typedef, /* Print a typedef using appropriate syntax */
855 unk_lang_val_print, /* Print a value using appropriate syntax */
856 unk_lang_value_print, /* Print a top-level value */
857 default_read_var_value, /* la_read_var_value */
858 unk_lang_trampoline, /* Language specific skip_trampoline */
859 "this", /* name_of_this */
860 basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
861 basic_lookup_transparent_type,/* lookup_transparent_type */
862 unk_lang_demangle, /* Language specific symbol demangler */
863 unk_lang_class_name, /* Language specific
864 class_name_from_physname */
865 unk_op_print_tab, /* expression operators for printing */
866 1, /* c-style arrays */
867 0, /* String lower bound */
868 default_word_break_characters,
869 default_make_symbol_completion_list,
870 unknown_language_arch_info, /* la_language_arch_info. */
871 default_print_array_index,
872 default_pass_by_reference,
874 NULL, /* la_get_symbol_name_cmp */
875 iterate_over_symbols,
880 const struct language_defn local_language_defn =
889 &exp_descriptor_standard,
893 unk_lang_printchar, /* Print character constant */
896 unk_lang_print_type, /* Print a type using appropriate syntax */
897 default_print_typedef, /* Print a typedef using appropriate syntax */
898 unk_lang_val_print, /* Print a value using appropriate syntax */
899 unk_lang_value_print, /* Print a top-level value */
900 default_read_var_value, /* la_read_var_value */
901 unk_lang_trampoline, /* Language specific skip_trampoline */
902 "this", /* name_of_this */
903 basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
904 basic_lookup_transparent_type,/* lookup_transparent_type */
905 unk_lang_demangle, /* Language specific symbol demangler */
906 unk_lang_class_name, /* Language specific
907 class_name_from_physname */
908 unk_op_print_tab, /* expression operators for printing */
909 1, /* c-style arrays */
910 0, /* String lower bound */
911 default_word_break_characters,
912 default_make_symbol_completion_list,
913 unknown_language_arch_info, /* la_language_arch_info. */
914 default_print_array_index,
915 default_pass_by_reference,
917 NULL, /* la_get_symbol_name_cmp */
918 iterate_over_symbols,
923 /* Per-architecture language information. */
925 static struct gdbarch_data *language_gdbarch_data;
927 struct language_gdbarch
929 /* A vector of per-language per-architecture info. Indexed by "enum
931 struct language_arch_info arch_info[nr_languages];
935 language_gdbarch_post_init (struct gdbarch *gdbarch)
937 struct language_gdbarch *l;
940 l = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct language_gdbarch);
941 for (i = 0; i < languages_size; i++)
943 if (languages[i] != NULL
944 && languages[i]->la_language_arch_info != NULL)
945 languages[i]->la_language_arch_info
946 (gdbarch, l->arch_info + languages[i]->la_language);
952 language_string_char_type (const struct language_defn *la,
953 struct gdbarch *gdbarch)
955 struct language_gdbarch *ld = gdbarch_data (gdbarch,
956 language_gdbarch_data);
958 return ld->arch_info[la->la_language].string_char_type;
962 language_bool_type (const struct language_defn *la,
963 struct gdbarch *gdbarch)
965 struct language_gdbarch *ld = gdbarch_data (gdbarch,
966 language_gdbarch_data);
968 if (ld->arch_info[la->la_language].bool_type_symbol)
972 sym = lookup_symbol (ld->arch_info[la->la_language].bool_type_symbol,
973 NULL, VAR_DOMAIN, NULL);
976 struct type *type = SYMBOL_TYPE (sym);
978 if (type && TYPE_CODE (type) == TYPE_CODE_BOOL)
983 return ld->arch_info[la->la_language].bool_type_default;
987 language_lookup_primitive_type_by_name (const struct language_defn *la,
988 struct gdbarch *gdbarch,
991 struct language_gdbarch *ld = gdbarch_data (gdbarch,
992 language_gdbarch_data);
993 struct type *const *p;
995 for (p = ld->arch_info[la->la_language].primitive_type_vector;
999 if (strcmp (TYPE_NAME (*p), name) == 0)
1005 /* Initialize the language routines. */
1008 _initialize_language (void)
1010 static const char *const type_or_range_names[]
1011 = { "on", "off", "warn", "auto", NULL };
1013 static const char *const case_sensitive_names[]
1014 = { "on", "off", "auto", NULL };
1016 language_gdbarch_data
1017 = gdbarch_data_register_post_init (language_gdbarch_post_init);
1019 /* GDB commands for language specific stuff. */
1021 add_prefix_cmd ("check", no_class, set_check,
1022 _("Set the status of the type/range checker."),
1023 &setchecklist, "set check ", 0, &setlist);
1024 add_alias_cmd ("c", "check", no_class, 1, &setlist);
1025 add_alias_cmd ("ch", "check", no_class, 1, &setlist);
1027 add_prefix_cmd ("check", no_class, show_check,
1028 _("Show the status of the type/range checker."),
1029 &showchecklist, "show check ", 0, &showlist);
1030 add_alias_cmd ("c", "check", no_class, 1, &showlist);
1031 add_alias_cmd ("ch", "check", no_class, 1, &showlist);
1033 add_setshow_enum_cmd ("range", class_support, type_or_range_names,
1035 _("Set range checking. (on/warn/off/auto)"),
1036 _("Show range checking. (on/warn/off/auto)"),
1037 NULL, set_range_command,
1039 &setchecklist, &showchecklist);
1041 add_setshow_enum_cmd ("case-sensitive", class_support, case_sensitive_names,
1042 &case_sensitive, _("\
1043 Set case sensitivity in name search. (on/off/auto)"), _("\
1044 Show case sensitivity in name search. (on/off/auto)"), _("\
1045 For Fortran the default is off; for other languages the default is on."),
1048 &setlist, &showlist);
1050 add_language (&auto_language_defn);
1051 add_language (&local_language_defn);
1052 add_language (&unknown_language_defn);
1054 language = xstrdup ("auto");
1055 type = xstrdup ("auto");
1056 range = xstrdup ("auto");
1057 case_sensitive = xstrdup ("auto");
1059 /* Have the above take effect. */
1060 set_language (language_auto);