1 /* Multiple source language support for GDB.
2 Copyright 1991 Free Software Foundation, Inc.
3 Contributed by the Department of Computer Science at the State University
4 of New York at Buffalo.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /* This file contains functions that return things that are specific
23 to languages. Each function should examine current_language if necessary,
24 and return the appropriate result. */
26 /* FIXME: Most of these would be better organized as macros which
27 return data out of a "language-specific" struct pointer that is set
28 whenever the working language changes. That would be a lot faster. */
40 #include "expression.h"
42 #include "parser-defs.h"
44 /* Forward function declarations */
45 static void set_type_range ();
47 /* Forward declaration */
48 extern struct language_defn unknown_language_defn
;
50 /* The current (default at startup) state of type and range checking.
51 (If the modes are set to "auto", though, these are changed based
52 on the default language at startup, and then again based on the
53 language of the first source file. */
55 enum range_mode range_mode
= range_mode_auto
;
56 enum range_check range_check
= range_check_off
;
57 enum type_mode type_mode
= type_mode_auto
;
58 enum type_check type_check
= type_check_off
;
60 /* The current language and language_mode (see language.h) */
62 struct language_defn
*current_language
= &unknown_language_defn
;
63 enum language_mode language_mode
= language_mode_auto
;
65 /* The list of supported languages. The list itself is malloc'd. */
67 static struct language_defn
**languages
;
68 static unsigned languages_size
;
69 static unsigned languages_allocsize
;
70 #define DEFAULT_ALLOCSIZE 3
72 /* The "set language/type/range" commands all put stuff in these
73 buffers. This is to make them work as set/show commands. The
74 user's string is copied here, then the set_* commands look at
75 them and update them to something that looks nice when it is
78 static char *language
;
82 /* Warning issued when current_language and the language of the current
83 frame do not match. */
84 char lang_frame_mismatch_warn
[] =
85 "Warning: the current language does not match this frame.";
91 /* This page contains the functions corresponding to GDB commands
94 /* Show command. Display a warning if the language set
95 does not match the frame. */
97 show_language_command (ignore
, from_tty
)
101 enum language flang
; /* The language of the current frame */
103 flang
= get_frame_language();
104 if (flang
!= language_unknown
&&
105 language_mode
== language_mode_manual
&&
106 current_language
->la_language
!= flang
)
107 printf_filtered("%s\n",lang_frame_mismatch_warn
);
110 /* Set command. Change the current working language. */
112 set_language_command (ignore
, from_tty
)
120 /* FIXME -- do this from the list, with HELP. */
121 if (!language
|| !language
[0]) {
122 printf("The currently understood settings are:\n\n\
123 local or auto Automatic setting based on source file\n\
124 c Use the C language\n\
125 modula-2 Use the Modula-2 language\n");
126 /* Restore the silly string. */
127 set_language(current_language
->la_language
);
131 /* Search the list of languages for a match. */
132 for (i
= 0; i
< languages_size
; i
++) {
133 if (!strcmp (languages
[i
]->la_name
, language
)) {
134 /* Found it! Go into manual mode, and use this language. */
135 if (languages
[i
]->la_language
== language_auto
) {
136 /* Enter auto mode. Set to the current frame's language, if known. */
137 language_mode
= language_mode_auto
;
138 flang
= get_frame_language();
139 if (flang
!=language_unknown
)
143 /* Enter manual mode. Set the specified language. */
144 language_mode
= language_mode_manual
;
145 current_language
= languages
[i
];
153 /* Reset the language (esp. the global string "language") to the
155 err_lang
=savestring(language
,strlen(language
));
156 make_cleanup (free
, err_lang
); /* Free it after error */
157 set_language(current_language
->la_language
);
158 error ("Unknown language `%s'.",err_lang
);
161 /* Show command. Display a warning if the type setting does
162 not match the current language. */
164 show_type_command(ignore
, from_tty
)
168 if (type_check
!= current_language
->la_type_check
)
170 "Warning: the current type check setting does not match the language.\n");
173 /* Set command. Change the setting for type checking. */
175 set_type_command(ignore
, from_tty
)
179 if (!strcmp(type
,"on"))
181 type_check
= type_check_on
;
182 type_mode
= type_mode_manual
;
184 else if (!strcmp(type
,"warn"))
186 type_check
= type_check_warn
;
187 type_mode
= type_mode_manual
;
189 else if (!strcmp(type
,"off"))
191 type_check
= type_check_off
;
192 type_mode
= type_mode_manual
;
194 else if (!strcmp(type
,"auto"))
196 type_mode
= type_mode_auto
;
198 /* Avoid hitting the set_type_str call below. We
199 did it in set_type_range. */
203 show_type_command((char *)NULL
, from_tty
);
206 /* Show command. Display a warning if the range setting does
207 not match the current language. */
209 show_range_command(ignore
, from_tty
)
214 if (range_check
!= current_language
->la_range_check
)
216 "Warning: the current range check setting does not match the language.\n");
219 /* Set command. Change the setting for range checking. */
221 set_range_command(ignore
, from_tty
)
225 if (!strcmp(range
,"on"))
227 range_check
= range_check_on
;
228 range_mode
= range_mode_manual
;
230 else if (!strcmp(range
,"warn"))
232 range_check
= range_check_warn
;
233 range_mode
= range_mode_manual
;
235 else if (!strcmp(range
,"off"))
237 range_check
= range_check_off
;
238 range_mode
= range_mode_manual
;
240 else if (!strcmp(range
,"auto"))
242 range_mode
= range_mode_auto
;
244 /* Avoid hitting the set_range_str call below. We
245 did it in set_type_range. */
249 show_range_command((char *)0, from_tty
);
252 /* Set the status of range and type checking based on
253 the current modes and the current language.
254 If SHOW is non-zero, then print out the current language,
255 type and range checking status. */
260 if (range_mode
== range_mode_auto
)
261 range_check
= current_language
->la_range_check
;
263 if (type_mode
== type_mode_auto
)
264 type_check
= current_language
->la_type_check
;
270 /* Set current language to (enum language) LANG. */
278 for (i
= 0; i
< languages_size
; i
++) {
279 if (languages
[i
]->la_language
== lang
) {
280 current_language
= languages
[i
];
287 /* This page contains functions that update the global vars
288 language, type and range. */
295 if (language_mode
== language_mode_auto
)
296 prefix
= "auto; currently ";
298 language
= concat(prefix
, current_language
->la_name
, "");
304 char *tmp
, *prefix
= "";
307 if (type_mode
==type_mode_auto
)
308 prefix
= "auto; currently ";
318 case type_check_warn
:
322 error ("Unrecognized type check setting.");
325 type
= concat(prefix
,tmp
,"");
331 char *tmp
, *pref
= "";
334 if (range_mode
==range_mode_auto
)
335 pref
= "auto; currently ";
342 case range_check_off
:
345 case range_check_warn
:
349 error ("Unrecognized range check setting.");
352 range
= concat(pref
,tmp
,"");
356 /* Print out the current language settings: language, range and
361 printf("Current Language: %s\n",language
);
362 show_language_command((char *)0, 1);
363 printf("Type checking: %s\n",type
);
364 show_type_command((char *)0, 1);
365 printf("Range checking: %s\n",range
);
366 show_range_command((char *)0, 1);
369 /* Return the result of a binary operation. */
371 binop_result_type(v1
,v2
)
376 l1
= TYPE_LENGTH(VALUE_TYPE(v1
));
377 l2
= TYPE_LENGTH(VALUE_TYPE(v2
));
379 switch(current_language
->la_language
)
382 if (TYPE_CODE(VALUE_TYPE(v1
))==TYPE_CODE_FLT
)
383 return TYPE_CODE(VALUE_TYPE(v2
)) == TYPE_CODE_FLT
&& l2
> l1
?
384 VALUE_TYPE(v2
) : VALUE_TYPE(v1
);
385 else if (TYPE_CODE(VALUE_TYPE(v2
))==TYPE_CODE_FLT
)
386 return TYPE_CODE(VALUE_TYPE(v1
)) == TYPE_CODE_FLT
&& l1
> l2
?
387 VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
388 else if (TYPE_UNSIGNED(VALUE_TYPE(v1
)) && l1
> l2
)
389 return VALUE_TYPE(v1
);
390 else if (TYPE_UNSIGNED(VALUE_TYPE(v2
)) && l2
> l1
)
391 return VALUE_TYPE(v2
);
392 else /* Both are signed. Result is the longer type */
393 return l1
> l2
? VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
396 /* If we are doing type-checking, l1 should equal l2, so this is
398 return l1
> l2
? VALUE_TYPE(v1
) : VALUE_TYPE(v2
);
402 return (struct type
*)0; /* For lint */
405 /* This page contains functions that return format strings for
406 printf for printing out numbers in different formats */
408 /* Returns the appropriate printf format for hexadecimal
411 local_hex_format_custom(pre
)
414 static char form
[50];
416 strcpy (form
, current_language
->la_hex_format_pre
);
418 strcat (form
, current_language
->la_hex_format_suf
);
422 /* Converts a number to hexadecimal and stores it in a static
423 string. Returns a pointer to this string. */
425 local_hex_string (num
)
430 sprintf (res
, current_language
->la_hex_format
, num
);
434 /* Converts a number to custom hexadecimal and stores it in a static
435 string. Returns a pointer to this string. */
437 local_hex_string_custom(num
,pre
)
443 sprintf (res
, local_hex_format_custom(pre
), num
);
447 /* Returns the appropriate printf format for octal
450 local_octal_format_custom(pre
)
453 static char form
[50];
455 strcpy (form
, current_language
->la_octal_format_pre
);
457 strcat (form
, current_language
->la_octal_format_suf
);
461 /* This page contains functions that are used in type/range checking.
462 They all return zero if the type/range check fails.
464 It is hoped that these will make extending GDB to parse different
465 languages a little easier. These are primarily used in eval.c when
466 evaluating expressions and making sure that their types are correct.
467 Instead of having a mess of conjucted/disjuncted expressions in an "if",
468 the ideas of type can be wrapped up in the following functions.
470 Note that some of them are not currently dependent upon which language
471 is currently being parsed. For example, floats are the same in
472 C and Modula-2 (ie. the only floating point type has TYPE_CODE of
473 TYPE_CODE_FLT), while booleans are different. */
475 /* Returns non-zero if its argument is a simple type. This is the same for
476 both Modula-2 and for C. In the C case, TYPE_CODE_CHAR will never occur,
477 and thus will never cause the failure of the test. */
482 switch (TYPE_CODE (type
)) {
487 case TYPE_CODE_RANGE
:
496 /* Returns non-zero if its argument is of an ordered type. */
501 switch (TYPE_CODE (type
)) {
506 case TYPE_CODE_RANGE
:
514 /* Returns non-zero if the two types are the same */
516 same_type (arg1
, arg2
)
517 struct type
*arg1
, *arg2
;
519 if (structured_type(arg1
) ? !structured_type(arg2
) : structured_type(arg2
))
520 /* One is structured and one isn't */
522 else if (structured_type(arg1
) && structured_type(arg2
))
524 else if (numeric_type(arg1
) && numeric_type(arg2
))
525 return (TYPE_CODE(arg2
) == TYPE_CODE(arg1
)) &&
526 (TYPE_UNSIGNED(arg1
) == TYPE_UNSIGNED(arg2
))
532 /* Returns non-zero if the type is integral */
537 switch(current_language
->la_language
)
540 return (TYPE_CODE(type
) != TYPE_CODE_INT
) &&
541 (TYPE_CODE(type
) != TYPE_CODE_ENUM
) ? 0 : 1;
543 return TYPE_CODE(type
) != TYPE_CODE_INT
? 0 : 1;
545 error ("Language not supported.");
549 /* Returns non-zero if the value is numeric */
554 switch (TYPE_CODE (type
)) {
564 /* Returns non-zero if the value is a character type */
566 character_type (type
)
569 switch(current_language
->la_language
)
572 return TYPE_CODE(type
) != TYPE_CODE_CHAR
? 0 : 1;
575 return (TYPE_CODE(type
) == TYPE_CODE_INT
) &&
576 TYPE_LENGTH(type
) == sizeof(char)
581 /* Returns non-zero if the value is a boolean type */
586 switch(current_language
->la_language
)
589 return TYPE_CODE(type
) != TYPE_CODE_BOOL
? 0 : 1;
592 return TYPE_CODE(type
) != TYPE_CODE_INT
? 0 : 1;
596 /* Returns non-zero if the value is a floating-point type */
601 return TYPE_CODE(type
) == TYPE_CODE_FLT
;
604 /* Returns non-zero if the value is a pointer type */
609 return TYPE_CODE(type
) == TYPE_CODE_PTR
||
610 TYPE_CODE(type
) == TYPE_CODE_REF
;
613 /* Returns non-zero if the value is a structured type */
615 structured_type(type
)
618 switch(current_language
->la_language
)
621 return (TYPE_CODE(type
) == TYPE_CODE_STRUCT
) ||
622 (TYPE_CODE(type
) == TYPE_CODE_UNION
) ||
623 (TYPE_CODE(type
) == TYPE_CODE_ARRAY
);
625 return (TYPE_CODE(type
) == TYPE_CODE_STRUCT
) ||
626 (TYPE_CODE(type
) == TYPE_CODE_SET
) ||
627 (TYPE_CODE(type
) == TYPE_CODE_ARRAY
);
631 /* This page contains functions that return info about
632 (struct value) values used in GDB. */
634 /* Returns non-zero if the value VAL represents a true value. */
643 switch (current_language
->la_language
) {
646 return !value_zerop (val
);
649 type
= VALUE_TYPE(val
);
650 if (TYPE_CODE (type
) != TYPE_CODE_BOOL
)
651 return 0; /* Not a BOOLEAN at all */
652 /* Search the fields for one that matches the current value. */
653 len
= TYPE_NFIELDS (type
);
654 v
= value_as_long (val
);
655 for (i
= 0; i
< len
; i
++)
658 if (v
== TYPE_FIELD_BITPOS (type
, i
))
662 return 0; /* Not a valid BOOLEAN value */
663 if (!strcmp ("TRUE", TYPE_FIELD_NAME(VALUE_TYPE(val
), i
)))
664 return 1; /* BOOLEAN with value TRUE */
666 return 0; /* BOOLEAN with value FALSE */
670 error ("Language not supported.");
674 /* Returns non-zero if the operator OP is defined on
675 the values ARG1 and ARG2. */
677 binop_type_check(arg1
,arg2
,op
)
681 struct type
*t1
, *t2
;
683 /* If we're not checking types, always return success. */
688 if (arg2
!=(value
)NULL
)
697 if ((numeric_type(t1
) && pointer_type(t2
)) ||
698 (pointer_type(t1
) && numeric_type(t2
)))
700 printf("warning: combining pointer and integer.\n");
706 if (!numeric_type(t1
) || !numeric_type(t2
))
707 type_op_error ("Arguments to %s must be numbers.",op
);
708 else if (!same_type(t1
,t2
))
709 type_op_error ("Arguments to %s must be of the same type.",op
);
714 if (!boolean_type(t1
) || !boolean_type(t2
))
715 type_op_error ("Arguments to %s must be of boolean type.",op
);
719 if ((pointer_type(t1
) && !(pointer_type(t2
) || integral_type(t2
))) ||
720 (pointer_type(t2
) && !(pointer_type(t1
) || integral_type(t1
))))
721 type_op_error ("A pointer can only be compared to an integer or pointer.",op
);
722 else if ((pointer_type(t1
) && integral_type(t2
)) ||
723 (integral_type(t1
) && pointer_type(t2
)))
725 printf("warning: combining integer and pointer.\n");
728 else if (!simple_type(t1
) || !simple_type(t2
))
729 type_op_error ("Arguments to %s must be of simple type.",op
);
730 else if (!same_type(t1
,t2
))
731 type_op_error ("Arguments to %s must be of the same type.",op
);
735 if (!integral_type(t1
) || !integral_type(t2
))
736 type_op_error ("Arguments to %s must be of integral type.",op
);
743 if (!ordered_type(t1
) || !ordered_type(t2
))
744 type_op_error ("Arguments to %s must be of ordered type.",op
);
745 else if (!same_type(t1
,t2
))
746 type_op_error ("Arguments to %s must be of the same type.",op
);
750 if (pointer_type(t1
) && !integral_type(t2
))
751 type_op_error ("A pointer can only be assigned an integer.",op
);
752 else if (pointer_type(t1
) && integral_type(t2
))
754 printf("warning: combining integer and pointer.");
757 else if (!simple_type(t1
) || !simple_type(t2
))
758 type_op_error ("Arguments to %s must be of simple type.",op
);
759 else if (!same_type(t1
,t2
))
760 type_op_error ("Arguments to %s must be of the same type.",op
);
763 /* Unary checks -- arg2 is null */
766 if (!boolean_type(t1
))
767 type_op_error ("Argument to %s must be of boolean type.",op
);
772 if (!numeric_type(t1
))
773 type_op_error ("Argument to %s must be of numeric type.",op
);
777 if (integral_type(t1
))
779 printf("warning: combining pointer and integer.\n");
782 else if (!pointer_type(t1
))
783 type_op_error ("Argument to %s must be a pointer.",op
);
786 case UNOP_PREINCREMENT
:
787 case UNOP_POSTINCREMENT
:
788 case UNOP_PREDECREMENT
:
789 case UNOP_POSTDECREMENT
:
790 if (!ordered_type(t1
))
791 type_op_error ("Argument to %s must be of an ordered type.",op
);
795 /* Ok. The following operators have different meanings in
796 different languages. */
797 switch(current_language
->la_language
)
804 if (!numeric_type(t1
) || !numeric_type(t2
))
805 type_op_error ("Arguments to %s must be numbers.",op
);
816 if (!float_type(t1
) || !float_type(t2
))
817 type_op_error ("Arguments to %s must be floating point numbers.",op
);
820 if (!integral_type(t1
) || !integral_type(t2
))
821 type_op_error ("Arguments to %s must be of integral type.",op
);
829 /* This page contains functions for the printing out of
830 error messages that occur during type- and range-
833 /* Prints the format string FMT with the operator as a string
834 corresponding to the opcode OP. If FATAL is non-zero, then
835 this is an error and error () is called. Otherwise, it is
836 a warning and printf() is called. */
838 op_error (fmt
,op
,fatal
)
844 error (fmt
,op_string(op
));
848 printf(fmt
,op_string(op
));
853 /* These are called when a language fails a type- or range-check.
854 The first argument should be a printf()-style format string, and
855 the rest of the arguments should be its arguments. If
856 [type|range]_check is [type|range]_check_on, then return_to_top_level()
857 is called in the style of error (). Otherwise, the message is prefixed
858 by "warning: " and we do not return to the top level. */
860 type_error (va_alist
)
866 if (type_check
==type_check_warn
)
867 fprintf(stderr
,"warning: ");
869 target_terminal_ours();
872 string
= va_arg (args
, char *);
873 vfprintf (stderr
, string
, args
);
874 fprintf (stderr
, "\n");
876 if (type_check
==type_check_on
)
877 return_to_top_level();
881 range_error (va_alist
)
887 if (range_check
==range_check_warn
)
888 fprintf(stderr
,"warning: ");
890 target_terminal_ours();
893 string
= va_arg (args
, char *);
894 vfprintf (stderr
, string
, args
);
895 fprintf (stderr
, "\n");
897 if (range_check
==range_check_on
)
898 return_to_top_level();
902 /* This page contains miscellaneous functions */
904 /* Return the language as a string */
911 for (i
= 0; i
< languages_size
; i
++) {
912 if (languages
[i
]->la_language
== lang
) {
913 return languages
[i
]->la_name
;
919 struct cmd_list_element
*setchecklist
= NULL
;
920 struct cmd_list_element
*showchecklist
= NULL
;
923 set_check (ignore
, from_tty
)
928 "\"set check\" must be followed by the name of a check subcommand.\n");
929 help_list(setchecklist
, "set check ", -1, stdout
);
933 show_check (arg
, from_tty
)
937 cmd_show_list(showchecklist
, from_tty
, "");
940 /* Add a language to the set of known languages. */
944 struct language_defn
*lang
;
946 if (lang
->la_magic
!= LANG_MAGIC
)
948 fprintf(stderr
, "Magic number of %s language struct wrong\n",
955 languages_allocsize
= DEFAULT_ALLOCSIZE
;
956 languages
= (struct language_defn
**) xmalloc
957 (languages_allocsize
* sizeof (*languages
));
959 if (languages_size
>= languages_allocsize
)
961 languages_allocsize
*= 2;
962 languages
= (struct language_defn
**) xrealloc (languages
,
963 languages_allocsize
* sizeof (*languages
));
965 languages
[languages_size
++] = lang
;
968 if (targetlist
== NULL
)
969 add_prefix_cmd ("target", class_run
, target_command
,
970 "Connect to a target machine or process.\n\
971 The first argument is the type or protocol of the target machine.\n\
972 Remaining arguments are interpreted by the target protocol. For more\n\
973 information on the arguments for a particular protocol, type\n\
974 `help target ' followed by the protocol name.",
975 &targetlist
, "target ", 0, &cmdlist
);
976 add_cmd (t
->to_shortname
, no_class
, t
->to_open
, t
->to_doc
, &targetlist
);
980 /* Define the language that is no language. */
991 error ("Attempted to parse an expression with unknown language");
994 static struct type
** const (unknown_builtin_types
[]) = { 0 };
995 static const struct op_print unk_op_print_tab
[] = { 0 };
997 const struct language_defn unknown_language_defn
= {
1000 &unknown_builtin_types
[0],
1005 &builtin_type_error
, /* longest signed integral type */
1006 &builtin_type_error
, /* longest unsigned integral type */
1007 &builtin_type_error
, /* longest floating point type */
1008 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1009 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1010 unk_op_print_tab
, /* expression operators for printing */
1014 /* These two structs define fake entries for the "local" and "auto" options. */
1015 const struct language_defn auto_language_defn
= {
1018 &unknown_builtin_types
[0],
1023 &builtin_type_error
, /* longest signed integral type */
1024 &builtin_type_error
, /* longest unsigned integral type */
1025 &builtin_type_error
, /* longest floating point type */
1026 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1027 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1028 unk_op_print_tab
, /* expression operators for printing */
1032 const struct language_defn local_language_defn
= {
1035 &unknown_builtin_types
[0],
1040 &builtin_type_error
, /* longest signed integral type */
1041 &builtin_type_error
, /* longest unsigned integral type */
1042 &builtin_type_error
, /* longest floating point type */
1043 "0x%x", "0x%", "x", /* Hex format, prefix, suffix */
1044 "0%o", "0%", "o", /* Octal format, prefix, suffix */
1045 unk_op_print_tab
, /* expression operators for printing */
1049 /* Initialize the language routines */
1052 _initialize_language()
1054 struct cmd_list_element
*set
, *show
;
1056 /* GDB commands for language specific stuff */
1058 set
= add_set_cmd ("language", class_support
, var_string_noescape
,
1060 "Set the current source language.",
1062 show
= add_show_from_set (set
, &showlist
);
1063 set
->function
= set_language_command
;
1064 show
->function
= show_language_command
;
1066 add_prefix_cmd ("check", no_class
, set_check
,
1067 "Set the status of the type/range checker",
1068 &setchecklist
, "set check ", 0, &setlist
);
1069 add_alias_cmd ("c", "check", no_class
, 1, &setlist
);
1070 add_alias_cmd ("ch", "check", no_class
, 1, &setlist
);
1072 add_prefix_cmd ("check", no_class
, show_check
,
1073 "Show the status of the type/range checker",
1074 &showchecklist
, "show check ", 0, &showlist
);
1075 add_alias_cmd ("c", "check", no_class
, 1, &showlist
);
1076 add_alias_cmd ("ch", "check", no_class
, 1, &showlist
);
1078 set
= add_set_cmd ("type", class_support
, var_string_noescape
,
1080 "Set type checking. (on/warn/off/auto)",
1082 show
= add_show_from_set (set
, &showchecklist
);
1083 set
->function
= set_type_command
;
1084 show
->function
= show_type_command
;
1086 set
= add_set_cmd ("range", class_support
, var_string_noescape
,
1088 "Set range checking. (on/warn/off/auto)",
1090 show
= add_show_from_set (set
, &showchecklist
);
1091 set
->function
= set_range_command
;
1092 show
->function
= show_range_command
;
1094 add_language (&unknown_language_defn
);
1095 add_language (&local_language_defn
);
1096 add_language (&auto_language_defn
);
1098 language
= savestring ("auto",strlen("auto"));
1099 range
= savestring ("auto",strlen("auto"));
1100 type
= savestring ("auto",strlen("auto"));
1102 /* Have the above take effect */
1104 set_language_command (language
, 0);
1105 set_type_command (NULL
, 0);
1106 set_range_command (NULL
, 0);